fix(release): overwrite existing artifacts on re-run - #96
Merged
Merged
Conversation
The v0.1.15 release failed at the homebrew step on an expired
TAP_GITHUB_TOKEN, after the GitHub release and its five assets had
already published. Re-running after refreshing the token failed
earlier, at asset upload:
422 Validation Failed [{Resource:ReleaseAsset Field:name
Code:already_exists}]
goreleaser aborts the scm releases step before it reaches the homebrew
formula, so a late-stage failure cannot be recovered by re-running --
the assets have to be deleted by hand first.
replace_existing_artifacts removes a conflicting artifact only when an
upload fails because it already exists, so the retry path costs nothing
on a normal release.
sairus2k
enabled auto-merge (rebase)
September 16, 2026 14:47
sairus2k
disabled auto-merge
September 16, 2026 14:47
sairus2k
enabled auto-merge (rebase)
September 16, 2026 14:47
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
The v0.1.15 release failed at the
homebrew formulastep on an expiredTAP_GITHUB_TOKEN— after the GitHub release and all five assets had already published.Re-running after refreshing the token failed earlier, at asset upload:
scm releasesruns beforehomebrew formula, so goreleaser aborted without ever retrying the step that actually failed. Recovering meant deleting all five published assets by hand, then re-running.Fix
release.replace_existing_artifactsdefaults tofalse. Setting ittruemakes goreleaser remove a conflicting artifact and retry — but only when an upload fails because it already exists, so a normal release pays nothing for it.Any future release that dies after publishing assets — expired credential, tap outage, rate limit — becomes recoverable with a plain
gh run rerun --failed.Note
Because
release.ymlchecks out the tag, this only takes effect for tags cut after it merges. It does not change re-runs of v0.1.15.Verification
v0.1.15 is fully published and the tap is updated, recovered manually via the delete-and-rerun path this change automates:
sairus2k/homebrew-tap→version "0.1.15"sha256values match the publishedchecksums.txtexactly, sobrew installverifies