Skip to content

fix(release): build the tag that started the run; a release's changelog from the previous one - #110

Merged
Teg79 merged 1 commit into
mainfrom
fix/release-current-tag
Nov 17, 2026
Merged

Teg79 merged 1 commit into
mainfrom
fix/release-current-tag

Conversation

@Teg79

@Teg79 Teg79 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Summary

.github/workflows/release.yml, the GoReleaser step:

  • GORELEASER_CURRENT_TAG is the tag that started the run (github.ref_name).
  • GORELEASER_PREVIOUS_TAG is the previous release without a suffix that sorts before it (sort -V), or the first commit for the first release; the step prints both.

Why

v0.1.0 was pushed on the commit of v0.1.0-rc.1 (8fccb7f). Left to itself, GoReleaser picked the rc tag: the run of v0.1.0 built 0.1.0-rc.1 again and failed uploading onto the rc's release (422 already_exists). Nothing was published or changed: the rc release, its assets and notes are as they were, and the run stopped before the image.

Without a previous tag set, an rc on the same commit would also leave the final release's changelog empty.

Tests I ran

  • The previous-tag rule, with GNU grep, on a scratch repo: v0.1.0-rc.1 → first commit, v0.1.0 → first commit, v0.1.1 → v0.1.0, v0.2.0-rc.1 → v0.1.1, v0.2.0 → v0.1.1, and a later hotfix v0.1.2 → v0.1.1 (not v0.2.0).
  • GoReleaser locally on 8fccb7f, which has both tags, with the two variables as the workflow sets them and --skip=publish,announce: archives urbex_0.1.0_*, urbex version says 0.1.0, 51 changelog entries.
  • Not run: the workflow itself. After merging, v0.1.0 must be moved onto the new main: a tag runs the workflow of its own commit, and 8fccb7f has the old one.

Checklist before review

  • Conventional Commit title
  • No secrets, tokens or private addresses

Part of urbforge/redemptor#53 (follows #102).

🤖 Generated with Claude Code

https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA

…og from the previous one

v0.1.0 was pushed on v0.1.0-rc.1's commit, and GoReleaser picked the rc tag: it built 0.1.0-rc.1 again and failed to upload onto the rc's release. GORELEASER_CURRENT_TAG is now the run's tag, and GORELEASER_PREVIOUS_TAG the previous release without a suffix (or the first commit), so that an rc on the same commit doesn't leave the changelog empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182yxsfwRowwnxCfgrQwjnA
@Teg79
Teg79 merged commit 6d81dd9 into main Nov 17, 2026
1 check passed
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