commit 3c82e54f76cf9737978969c724b37499716e7c62 from: mtmn date: Sun Jun 14 11:34:01 2026 UTC hack: update release script commit - 0702b003d751f0c30b372cb697669b62c36b1c85 commit + 3c82e54f76cf9737978969c724b37499716e7c62 blob - d479c82864b4847f8bf68f0fb15c8877d256e3e4 blob + 601775c00272aebd8c3263d97b2767108ea7a385 --- hack/release +++ hack/release @@ -23,16 +23,10 @@ update_version_file() { command -v git >/dev/null 2>&1 || die "git not found" -usage="usage: $(basename "$0") current | [--push]" +current=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n1) +current=${current#v} +usage="$(basename "$0") [--push] (${current:-none})" -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 - version="" push=0 for arg in "$@"; do @@ -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