virittaa

Log | Files | Refs | README | LICENSE

commit 160315b4b9378dd1e6e2a4f59097b2f46979da38
parent eecd67b5a7cff02681a5ee7e5d56ad7306c94bb7
Author: mtmn <miro@haravara.org>
Date:   Sun, 14 Jun 2026 13:34:01 +0200

hack: update release script

Diffstat:
Mhack/release | 22+++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/hack/release b/hack/release @@ -23,15 +23,9 @@ update_version_file() { command -v git >/dev/null 2>&1 || die "git not found" -usage="usage: $(basename "$0") current | <version> [--push]" - -if [ "${1:-}" = "current" ]; then - [ "$#" -eq 1 ] || die "$usage" - latest=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n1) - [ -n "$latest" ] || die "no release tags yet" - echo "${latest#v}" - exit 0 -fi +current=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n1) +current=${current#v} +usage="$(basename "$0") <version> [--push] (${current:-none})" version="" push=0 @@ -50,11 +44,6 @@ done echo "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+([-+][0-9A-Za-z.-]+)*$' || die "'$version' is not a semantic version" -if [ "$push" -eq 0 ]; then - echo "would release v$version" - exit 0 -fi - [ "$(git rev-parse --abbrev-ref HEAD)" = "$BRANCH" ] || die "not on $BRANCH branch" [ -z "$(git status --porcelain)" ] || die "working tree is dirty" git rev-parse -q --verify "refs/tags/v$version" >/dev/null 2>&1 && die "tag v$version already exists" @@ -63,4 +52,7 @@ update_version_file "$version" git commit -m "release: v$version" git tag -a "v$version" -m "v$version" -git push "$REMOTE" "$BRANCH" --follow-tags + +if [ "$push" -eq 1 ]; then + git push "$REMOTE" "$BRANCH" --follow-tags +fi