diff --git a/.github/actions/manage-version/action.yml b/.github/actions/manage-version/action.yml index 72926fbf9..7f7f94197 100644 --- a/.github/actions/manage-version/action.yml +++ b/.github/actions/manage-version/action.yml @@ -12,6 +12,9 @@ outputs: version: description: The long form version number value: ${{ steps.version_number.outputs.version }} + version_4: + description: The 4 part version number + value: ${{ steps.version_number.outputs.version_4 }} buildnr: description: The build number value: ${{ steps.version_number.outputs.buildnr }} @@ -51,6 +54,8 @@ runs: git checkout $PULL_REQUEST_HEAD_SHA version=$(scripts/get-version.sh) echo "version=$version" >> $GITHUB_OUTPUT + version_4=$(scripts/get-version.sh 4) + echo "version_4=$version_4" >> $GITHUB_OUTPUT buildnr=$(scripts/get-version.sh 1) echo "buildnr=$buildnr" >> $GITHUB_OUTPUT git checkout $GITHUB_SHA diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 17da5d9e7..07399ddb9 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -46,6 +46,8 @@ jobs: KEYSTORE_PASSWORD: pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }} KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} BUILDNR: ${{ steps.version_number.outputs.buildnr }} + VERSION: ${{ steps.version_number.outputs.version }} + VERSION_4: ${{ steps.version_number.outputs.version_4 }} run: | # this is rather awkward, but it allows us to use the preinstalled # Android and Qt versions with relative paths @@ -63,7 +65,7 @@ jobs: git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer # get the build number via curl so this works both for a pull request as well as a push export OUTPUT_DIR="$GITHUB_WORKSPACE" - bash -x ./subsurface/packaging/android/qmake-build.sh -buildnr $BUILDNR + bash -x ./subsurface/packaging/android/qmake-build.sh -buildnr $BUILDNR -canonicalversion $VERSION -canonicalversion_4 $VERSION_4 - name: delete the keystore if: github.event_name == 'push' diff --git a/packaging/android/qmake-build.sh b/packaging/android/qmake-build.sh index a9ac999c5..d6b885e85 100755 --- a/packaging/android/qmake-build.sh +++ b/packaging/android/qmake-build.sh @@ -51,6 +51,16 @@ while [ "$#" -gt 0 ] ; do BUILDNR=$1 shift ;; + -canonicalversion) + shift + CANONICALVERSION=$1 + shift + ;; + -canonicalversion_4) + shift + CANONICALVERSION_4=$1 + shift + ;; -version) # only update the version info without rebuilding # this is useful when working with Xcode @@ -86,9 +96,13 @@ mkdir -p "$BUILDROOT"/subsurface-mobile-build pushd "$BUILDROOT"/subsurface-mobile-build # set up the Subsurface versions by hand -CANONICALVERSION=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh) +if [ -z "${CANONICALVERSION+X}" ] ; then + CANONICALVERSION=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh) +fi echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" > ssrf-version.h -CANONICALVERSION_4=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 4) +if [ -z "${CANONICALVERSION_4+X}" ] ; then + CANONICALVERSION_4=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 4) +fi echo "#define CANONICAL_VERSION_STRING_4 \"$CANONICALVERSION_4\"" >> ssrf-version.h popd