From 3e402312bc6d118f15844344b276528e82b6b049 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Mon, 16 Oct 2023 16:27:15 +0300 Subject: [PATCH 1/2] .github: use 'v'-prefixed image version tags. Don't strip the 'v' prefix from version tags. For consistency, also inject a leading 'v' prefix to versions derived from release branch names. IOW, call the image generated from the tip of a release-0.2 branch 'v0.2-unstable' instead of '0.2-unstable'. Signed-off-by: Krisztian Litkey --- .github/workflows/publish-images.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml index 2b1508fb9..e31709778 100644 --- a/.github/workflows/publish-images.yaml +++ b/.github/workflows/publish-images.yaml @@ -53,7 +53,7 @@ jobs: tag=unstable ;; refs/heads/release-*) - tag="${GITREF#refs/heads/release-}-unstable" + tag="v${GITREF#refs/heads/release-}-unstable" ;; *) echo "error: can't determine tag." From f90ee4cc020d0b36499ead46f07f3a840619a97d Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Mon, 16 Oct 2023 16:40:02 +0300 Subject: [PATCH 2/2] scripts: use 'v'-prefixed versions in binaries. Use a 'v' prefix in the version strings linked into binaries. Signed-off-by: Krisztian Litkey --- scripts/build/get-buildid | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/build/get-buildid b/scripts/build/get-buildid index 83ab799c4..2c8eeff50 100755 --- a/scripts/build/get-buildid +++ b/scripts/build/get-buildid @@ -67,11 +67,10 @@ dotgit_version() { fi case "$_v" in - v*) _v="${_v#v}" - ;; + v*) ;; *) _count=$(git rev-list --count HEAD) - _v="0.0.0-$_count-g$_id$_dirty" + _v="v0.0.0-$_count-g$_id$_dirty" ;; esac @@ -127,7 +126,7 @@ unknown_version() { package_versions() { case "$VERSION" in - [0-9.]**-g[0-9a-f]*) + v[0-9.]**-g[0-9a-f]*) local _full="$VERSION" local _numeric=${_full%%-*} local _cntsha1=${_full#*-} @@ -143,7 +142,7 @@ package_versions() { RPM=$(echo "$VERSION" | tr '+-' '_') DEB=$VERSION ;; - [0-9.]*) + v[0-9.]*) RPM=$VERSION DEB=$VERSION ;;