aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-12-02 13:39:50 -0700
committerSelene ToyKeeper2023-12-02 13:39:50 -0700
commit4461bdfd63493d1c2e08678337dc8ea31024225d (patch)
tree795359fe1566768a184e240de083a087d714afea /bin
parentadded docs/battery-rainbow.png from old repo, since it's still relevant (diff)
parentgithub CI: fetch history too, to allow detection of version tags (diff)
downloadanduril-4461bdfd63493d1c2e08678337dc8ea31024225d.tar.gz
anduril-4461bdfd63493d1c2e08678337dc8ea31024225d.tar.bz2
anduril-4461bdfd63493d1c2e08678337dc8ea31024225d.zip
Merge branch 'github-ci-fix-version-tags' into trunk
Fixed missing version strings during github CI builds. Made "git describe" work within github's CI environment, so it can detect the most recent release tag and generate a version number for each build. * github-ci-fix-version-tags: github CI: fetch history too, to allow detection of version tags build-all: handle the case where "git describe" can't get any tags run CI on all branches, not just on trunk fetch tags on CI checkout, so 'git describe' can work
Diffstat (limited to '')
-rwxr-xr-xbin/build-all.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/build-all.sh b/bin/build-all.sh
index 444809e..f239217 100755
--- a/bin/build-all.sh
+++ b/bin/build-all.sh
@@ -88,6 +88,11 @@ function make-version-h {
# strip rev hash (git won't give "commits since tag" without the rev hash)
REV="${REV/-g[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/}"
REV="${REV/-dirty/.1}" # convert '-dirty' to '.1'
+ # handle an empty name (happens during github action runs)
+ if [[ -z "$REV" ]]; then
+ HASH=$(git describe --always)
+ REV="0.$HASH"
+ fi
# save the version name to version.h
mkdir -p ".build/$UI"
echo '#define VERSION_NUMBER "'"$REV"'"' > ".build/$UI/version.h"