ci: skip moving nightly tag when locating nearest ancestor

This commit is contained in:
darshankabariya 2026-05-28 16:39:58 +05:30
parent 1926b86d06
commit 0dca710ac0
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22

View File

@ -28,8 +28,11 @@ jobs:
set -euo pipefail set -euo pipefail
NIMBLE_VERSION=$(grep -m1 '^version = ' waku.nimble | sed -E 's/version = "([^"]+)"/\1/') NIMBLE_VERSION=$(grep -m1 '^version = ' waku.nimble | sed -E 's/version = "([^"]+)"/\1/')
# Nearest tag reachable from HEAD; --abbrev=0 drops the -<n>-g<sha> # Nearest tag reachable from HEAD; --abbrev=0 drops the -<n>-g<sha>
# suffix so we get the bare tag (e.g. v0.38.0). # suffix so we get the bare tag (e.g. v0.38.0). `--match 'v*'` skips
BASE_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") # the moving `nightly` tag (auto-updated by the daily CI to point at
# master HEAD), which would otherwise be picked as the nearest tag
# and break the version-sort comparison below.
BASE_TAG=$(git describe --tags --abbrev=0 --match 'v*' 2>/dev/null || echo "")
BASE_TAG=${BASE_TAG#v} BASE_TAG=${BASE_TAG#v}
# Compare on the base version, ignoring any -rc.N prerelease suffix. # Compare on the base version, ignoring any -rc.N prerelease suffix.
BASE_TAG=${BASE_TAG%%-*} BASE_TAG=${BASE_TAG%%-*}