mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CICD: Use correct version information on pull request builds.
Use the version information detected in the manage-version action, as the actual build is happening in the speculative post-merge branch, resulting in a bogus 'commit distance' number. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
2b7900b68d
commit
df4358d252
3 changed files with 24 additions and 3 deletions
5
.github/actions/manage-version/action.yml
vendored
5
.github/actions/manage-version/action.yml
vendored
|
@ -12,6 +12,9 @@ outputs:
|
||||||
version:
|
version:
|
||||||
description: The long form version number
|
description: The long form version number
|
||||||
value: ${{ steps.version_number.outputs.version }}
|
value: ${{ steps.version_number.outputs.version }}
|
||||||
|
version_4:
|
||||||
|
description: The 4 part version number
|
||||||
|
value: ${{ steps.version_number.outputs.version_4 }}
|
||||||
buildnr:
|
buildnr:
|
||||||
description: The build number
|
description: The build number
|
||||||
value: ${{ steps.version_number.outputs.buildnr }}
|
value: ${{ steps.version_number.outputs.buildnr }}
|
||||||
|
@ -51,6 +54,8 @@ runs:
|
||||||
git checkout $PULL_REQUEST_HEAD_SHA
|
git checkout $PULL_REQUEST_HEAD_SHA
|
||||||
version=$(scripts/get-version.sh)
|
version=$(scripts/get-version.sh)
|
||||||
echo "version=$version" >> $GITHUB_OUTPUT
|
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)
|
buildnr=$(scripts/get-version.sh 1)
|
||||||
echo "buildnr=$buildnr" >> $GITHUB_OUTPUT
|
echo "buildnr=$buildnr" >> $GITHUB_OUTPUT
|
||||||
git checkout $GITHUB_SHA
|
git checkout $GITHUB_SHA
|
||||||
|
|
4
.github/workflows/android.yml
vendored
4
.github/workflows/android.yml
vendored
|
@ -46,6 +46,8 @@ jobs:
|
||||||
KEYSTORE_PASSWORD: pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
KEYSTORE_PASSWORD: pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||||
KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
|
KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
|
||||||
BUILDNR: ${{ steps.version_number.outputs.buildnr }}
|
BUILDNR: ${{ steps.version_number.outputs.buildnr }}
|
||||||
|
VERSION: ${{ steps.version_number.outputs.version }}
|
||||||
|
VERSION_4: ${{ steps.version_number.outputs.version_4 }}
|
||||||
run: |
|
run: |
|
||||||
# this is rather awkward, but it allows us to use the preinstalled
|
# this is rather awkward, but it allows us to use the preinstalled
|
||||||
# Android and Qt versions with relative paths
|
# Android and Qt versions with relative paths
|
||||||
|
@ -63,7 +65,7 @@ jobs:
|
||||||
git config --global --add safe.directory $GITHUB_WORKSPACE/libdivecomputer
|
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
|
# get the build number via curl so this works both for a pull request as well as a push
|
||||||
export OUTPUT_DIR="$GITHUB_WORKSPACE"
|
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
|
- name: delete the keystore
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
|
|
|
@ -51,6 +51,16 @@ while [ "$#" -gt 0 ] ; do
|
||||||
BUILDNR=$1
|
BUILDNR=$1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-canonicalversion)
|
||||||
|
shift
|
||||||
|
CANONICALVERSION=$1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-canonicalversion_4)
|
||||||
|
shift
|
||||||
|
CANONICALVERSION_4=$1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-version)
|
-version)
|
||||||
# only update the version info without rebuilding
|
# only update the version info without rebuilding
|
||||||
# this is useful when working with Xcode
|
# this is useful when working with Xcode
|
||||||
|
@ -86,9 +96,13 @@ mkdir -p "$BUILDROOT"/subsurface-mobile-build
|
||||||
pushd "$BUILDROOT"/subsurface-mobile-build
|
pushd "$BUILDROOT"/subsurface-mobile-build
|
||||||
|
|
||||||
# set up the Subsurface versions by hand
|
# 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
|
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
|
echo "#define CANONICAL_VERSION_STRING_4 \"$CANONICALVERSION_4\"" >> ssrf-version.h
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue