Skip to content

Commit 95a867b

Browse files
authored
Use github.ref_name in package action (#34)
ci: Use github.ref_name in package action Allows passing the VERSION setting to the Makefile. If not given, falls back to detection from git. This should fix not choosing the latest tag for the version if there is more than one on the latest commit.
1 parent 7d2ee8b commit 95a867b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/actions/package/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ runs:
3131
make test
3232
- name: Build x86_64 packages
3333
env:
34+
VERSION: {{ github.ref_name }}
3435
CARGO_TARGET: x86_64-unknown-linux-gnu
3536
GLIBC_VERSION: 2.27
3637
shell: bash
3738
run: make package
3839
- name: Build aarch64 packages
3940
env:
41+
VERSION: {{ github.ref_name }}
4042
CARGO_TARGET: aarch64-unknown-linux-gnu
4143
BIN_UTIL_PREFIX: aarch64-linux-gnu-
4244
GLIBC_VERSION: 2.27

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif
1717

1818
# Defines VERSION from the git history. Used by the binaries to build their own version string.
1919
# To satisfy semver we fall back to `0.0.0` if there is no matching tag
20-
VERSION := $(shell (git describe --tags --match "v*.*.*" 2>/dev/null || echo "v0.0.0") | sed 's/\-/~/g')
20+
VERSION ?= $(shell (git describe --tags --match "v*.*.*" 2>/dev/null || echo "v0.0.0") | sed 's/\-/~/g')
2121
# Strip the first character, which is usually "v" to allow usage in semver contexts
2222
VERSION_TRIMMED := $(shell V="$(VERSION)" && echo $${V:1})
2323

0 commit comments

Comments
 (0)