Uh oh!
There was an error while loading. Please reload this page.
fix(release): stop goreleaser creating a duplicate draft for the same tag - #2957
Open
mikeland73 wants to merge 3 commits into
Open
fix(release): stop goreleaser creating a duplicate draft for the same tag#2957mikeland73 wants to merge 3 commits into
mikeland73 wants to merge 3 commits into
Conversation
goreleaser's `use_existing_draft` matches an existing draft by *title*, not by tag: findDraftRelease compares `r.GetName() == tag` against the tag string it was handed. Any draft whose title wasn't verbatim the tag went unmatched, so goreleaser created a second draft for the same tag — with a bare list of commit SHAs for notes — and put all the artifacts on it. That is what happened to 0.17.5 and 0.18.0. A matched draft fared no better: CreateRelease overwrites the title from `name_template`, so a hand-written title could never survive. Disable goreleaser's release pipe instead. It still builds every binary, archive and checksum into dist/; it just no longer owns the GitHub release. cli-release uploads dist/ with `gh release upload`, which resolves drafts by tag (GraphQL `release(tagName:)`), so a tag always maps to exactly one release regardless of its title. Both ways of cutting a release keep working. `devbox run draft-release` creates the draft with its real title and notes before pushing the tag, and the artifacts land on it. A tag pushed by hand has no draft, so cli-release creates one titled after the tag with GitHub's generated notes and uploads onto that; it stays a draft for a human to retitle and publish. Uploads use --clobber so re-runs are idempotent. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The skill still described goreleaser attaching artifacts via `use_existing_draft`. It now builds dist/ and nothing else; cli-release does the upload, resolving the release by tag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
goreleaser's
use_existing_draftmatches an existing draft by title, not by tag — itsfindDraftReleasecomparesr.GetName() == tagagainst the tag string it was handed — so any draft whose title wasn't verbatim the tag went unmatched and goreleaser silently created a second draft for that tag, with a bare list of commit SHAs for notes and all the artifacts on it (0.17.5, and 0.18.0 which is stuck on it now). This disables goreleaser's release pipe — it still builds every binary, archive and checksum intodist/, it just no longer owns the GitHub release — and hascli-releaseuploaddist/withgh release upload, which resolves drafts by tag via GraphQL and so maps a tag to exactly one release regardless of its title. Both ways of cutting a release keep working:devbox run draft-releasecreates the draft with its real title and hand-written notes before the tag is pushed and the artifacts land on it, while a tag pushed by hand gets a draft created from GitHub's generated notes to retitle and publish. Uploads use--clobberso re-running the workflow is idempotent.scripts/release.tsand the release skill are updated to describe the new path.How was it tested?
goreleaser checkparses the config and reports one skipped pipe (reason=release is disabled); a full localgoreleaser release --clean --snapshotstill produced all 7 artifacts (6 tarballs +checksums.txt) that the upload glob picks up; the new workflow step passesbash -nand dry-runs correctly for both a release tag and a prerelease tag;release.tsstill runs.Community Contribution License
All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.
By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.
🤖 Generated with Claude Code