From b3d2a8cdcb8747f7fc0db5e233749827d82eede9 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Mon, 18 Dec 2023 16:05:46 +1300 Subject: [PATCH] Build system: Fix Local Build Script for android. Change the name of the `GITHUB_WORKSPACE` environment variable in the android build script to `OUTPUT_DIR`, which is more intuitive when the script is used for local builds. Also test if the variable is defined before attempting to use it as the target of the build output. Signed-off-by: Michael Keller --- .github/workflows/android.yml | 2 +- packaging/android/qmake-build.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index fb59a3061..61ffe0eac 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -55,7 +55,7 @@ jobs: apt-get install --reinstall cpp-7 gcc-7-base libgcc-7-dev libcc1-0 gcc-7 git config --global --add safe.directory ${SUBSURFACE_REPO_PATH} git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer - bash -x ./subsurface/packaging/android/qmake-build.sh + OUTPUT_DIR=$GITHUB_WORKSPACE bash -x ./subsurface/packaging/android/qmake-build.sh - name: create version number id: version_number diff --git a/packaging/android/qmake-build.sh b/packaging/android/qmake-build.sh index 26ff53395..196cdfcd0 100755 --- a/packaging/android/qmake-build.sh +++ b/packaging/android/qmake-build.sh @@ -404,4 +404,7 @@ fi # now build the Subsurface aab make apk -mv $(find . -name Subsurface-mobile.apk) "$GITHUB_WORKSPACE"/Subsurface-mobile-"$CANONICALVERSION".apk + +if [ -n "${OUTPUT_DIR+X}" ] ; then + mv $(find . -name Subsurface-mobile.apk) "$OUTPUT_DIR"/Subsurface-mobile-"$CANONICALVERSION".apk +fi