Skip to content

fix(release): pin release tag to commit, refuse 1.x, add prerelease input - #37

Merged
sivert-io merged 1 commit into
devfrom
fix/release-script-target
Sep 24, 2026
Merged

sivert-io merged 1 commit into
devfrom
fix/release-script-target

Conversation

@sivert-io

Copy link
Copy Markdown
Collaborator

Summary

Ports the fixes from hotfix/1.4.x's release.sh back to dev, adapted to the 2.x layout (AutoTournamentCS2 naming, addons/+cfg/ at the zip root).

  • --target on gh release create: without it, the tag is created on the default branch (dev) instead of on the actual release commit.
  • Changelog from the last reachable tag: switched git tag --sort=-v:refname (newest tag anywhere in the repo) to git tag --merged HEAD --sort=-v:refname, so a tag on another line (e.g. a hotfix/1.4.x 1.x tag) can't be picked up as the changelog's starting point.
  • Zip verified before publishing: the two required-file checks now read a single unzip -Z1 listing instead of two separate unzip -l calls, and the zip now also fails the build if it contains a stray database.json (which must never ship, since it holds the operator's DB config).
  • Existing tags refused, local or remote: the tag-exists check now also does git ls-remote --tags origin, so a tag that's on GitHub but not fetched locally still blocks the release.
  • 1.x guard: dev now refuses to release a 1.x version (that's hotfix/1.4.x's job), and refuses to run from a detached HEAD.

New: prerelease input

Adds a prerelease boolean input to the Release workflow (default false), passed through to release.sh as PRERELEASE. When true, the script publishes with --prerelease and skips --latest, so a release (e.g. the upcoming 2.0.0) can go out without touching what GitHub's "latest" release points to.

Test plan

  • bash -n release.sh passes
  • Manual read-through of the diff against hotfix/1.4.x's fixes, adapted to 2.x
  • CI (build workflow) green

…nput

Ports the hotfix/1.4.x release-script fixes to dev, adapted to 2.x naming:
- gh release create now gets --target <release commit>, so the tag lands
  on that commit instead of the default branch (dev).
- The changelog is now built from the last tag reachable from HEAD, not
  the newest tag in the repo (which could be off another line, e.g. 1.x).
- The release zip's contents are verified from a single listing before
  anything is committed or published, and a stray database.json now
  fails the build instead of shipping.
- An existing tag is refused whether it's local or already on origin.
- dev now refuses to release a 1.x version (1.x releases come from
  hotfix/1.4.x), and refuses to run from a detached HEAD.

Also adds a `prerelease` workflow_dispatch input (default false), passed
through as PRERELEASE to release.sh: true builds with --prerelease and
skips --latest, so a release (e.g. 2.0.0) can ship without touching what
"latest" points to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sivert-io
sivert-io merged commit f9e2af8 into dev Sep 24, 2026
1 check passed
@sivert-io
sivert-io deleted the fix/release-script-target branch September 24, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant