Adding one more build step to ensure correct source code revision is used for the release.

This commit is contained in:
Petr Pokorny
2021-02-01 10:03:18 +01:00
parent a96af1d78d
commit 09640e64af
2 changed files with 30 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ jobs:
submodules: recursive
fetch-depth: 0
- name: Ensure source code revision
run: scripts/ensure-code-revision.sh
working-directory: platform/android
shell: bash
- name: Cache node modules
uses: actions/cache@v2
env:

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
set -o pipefail
set -u
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT
VERSION_TAG=${VERSION_TAG:-''}
if [[ -z ${VERSION_TAG} ]]; then
step "Determining version number from most recent relevant git tag…"
VERSION_TAG=$( git describe --tags --match=android-v*.*.* --abbrev=0 )
echo "Found tag: ${VERSION_TAG}"
fi
if [[ $( echo ${VERSION_TAG} | grep --invert-match android-v ) ]]; then
echo "Error: ${VERSION_TAG} is not a valid android version tag"
echo "VERSION_TAG should be in format: android-vX.X.X-pre.X"
exit 1
fi
step "Checking out source code at ${VERSION_TAG}"
git checkout ${VERSION_TAG}