fix(release): let GoReleaser own the GitHub release#61
Merged
Conversation
The .releaserc added in #59 (copied verbatim from dotnet-template) included @semantic-release/github, which creates an immutable GitHub Release for each new tag. The CD - Go workflow's GoReleaser then fails with HTTP 422 "Cannot upload assets to an immutable release" when attaching the built binaries. dotnet-template is .NET (no GoReleaser), so semantic-release owning the release is correct there. A Go repo additionally runs GoReleaser, which must own the release to publish assets atomically. Mirror ksail's proven config: semantic-release uses only @semantic-release/commit-analyzer to compute the version and create the tag; GoReleaser (triggered by the tag push) creates the GitHub Release and uploads the binaries.
There was a problem hiding this comment.
Pull request overview
Adjusts the repository’s semantic-release configuration so semantic-release only computes the next version and creates the tag, avoiding creation of an immutable GitHub Release that prevents GoReleaser from uploading assets.
Changes:
- Removes
@semantic-release/githubso semantic-release no longer creates the GitHub Release (GoReleaser will create it instead). - Removes
@semantic-release/release-notes-generator, leaving only@semantic-release/commit-analyzerin the plugin chain.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 free
to 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.
Problem
CD - Go(GoReleaser) has failed on every tag since #59. Latest run onv1.0.0(run):Root cause
#59 added
.releasercby copying it verbatim fromdotnet-template, which includes@semantic-release/github. That plugin creates a GitHub Release for each new tag, and GitHub now makes published releases immutable. The sequence is:Release(semantic-release) pushes the tag and creates the immutable GitHub Release (empty — semantic-release attaches no binaries).CD - Gofires on the tag, GoReleaser builds the binaries and tries to upload them to that release → 422, immutable.For
dotnet-templatethe copied config is correct (it's .NET — no GoReleaser, so semantic-release rightly owns the release). A Go repo additionally runs GoReleaser, which must own the release to publish assets atomically.Fix
Mirror ksail's proven
.releaserc(a Go CLI with the identicalRelease+ GoReleaserCDpair, releasing green):semantic-release now only computes the version and creates the tag; GoReleaser owns the GitHub Release and its assets (no conflict). The resulting file is byte-identical to ksail's
.releaserc.Validation
fix:PR will itself triggercommit-analyzer→ a patch release (v1.0.1), which GoReleaser will publish cleanly — confirming the fix on merge.Note for the maintainer
The pre-existing
v1.0.0GitHub Release (created empty + immutable by the old config) can't be repaired in place. It's harmless to leave; the next release (v1.0.1) will be created correctly by GoReleaser with binaries. Deletev1.0.0if you'd prefer a clean release list.