build: move to use `releases/` prefix

The team decided to use `releases/*.*.*` for the naming scheme of release tags.

This change needs to be reflected in the `build` tooling as well.
This commit is contained in:
Fintan Halpenny 2025-08-25 12:38:47 +01:00
parent 819ae5fdf5
commit de38d97418
5 changed files with 17 additions and 11 deletions

View File

@ -17,8 +17,8 @@ main() {
echo "fatal: empty version number" >&2 ; exit 1
fi
if ! git rev-parse --verify "v$version^{tag}" >/dev/null 2>&1; then
echo "error: '$version' is not a valid version, tag 'v$version' not found" >&2
if ! git rev-parse --verify "releases/$version^{tag}" >/dev/null 2>&1; then
echo "error: '$version' is not a valid version, tag 'releases/$version' not found" >&2
exit 1
fi

View File

@ -3,11 +3,12 @@ set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <version-number>"
echo "Produces a Git Tag under 'releases/<version-number>', signed by the 'user.signingKey' which must match 'rad self --ssh-key'"
exit 1
fi
version="$1"
tag="v$version"
tag="releases/$version"
git_config_key="user.signingKey"

View File

@ -58,7 +58,7 @@ main() {
# `rad://z3gqcJUoA1n9HaHKufZs5FCSGazv5/<nid>`, where `<nid>` is the local Node
# ID.
echo "Pushing tags to ${rad_remote}.."
git push "${rad_remote}" --tags
git push "${rad_remote}" "releases/${version}"
echo "Done."
}

View File

@ -1,9 +1,9 @@
#!/bin/sh
if ! version="$(git describe --match='v*' --candidates=1 2>/dev/null)"; then
if ! version="$(git describe --match='releases/*' --candidates=1 2>/dev/null)"; then
echo "fatal: no version tag found by 'git describe'" >&2 ; exit 1
fi
# Remove `v` prefix from version.
version=${version#v}
# Remove the `releases/` prefix from version.
version=${version#releases/}
echo "$version"

View File

@ -12,7 +12,7 @@ while [ $# -gt 0 ]; do
exit 1
fi
shift
from=$(echo "$1" | sed 's/^v//')
from=$(echo "$1" | sed 's/^releases\///')
break
;;
*)
@ -23,13 +23,18 @@ while [ $# -gt 0 ]; do
done
# Current/latest tag.
current=$(git describe --tags --match='v*' --abbrev=0)
version=$(echo "$current" | sed 's/^v//')
version="$(build/version)"
current="releases/${version}"
if ! git rev-parse --verify "$current^{tag}" >/dev/null 2>&1; then
echo "error: tag '$current' not found" >&2
exit 1
fi
if [ -z "$from" ]; then
previous="$(git describe --abbrev=0 HEAD^)"
else
previous="v$from"
previous="releases/$from"
fi
if ! git rev-parse --verify "$previous^{tag}" >/dev/null 2>&1; then