Skip to content

fix(release): overwrite existing artifacts on re-run - #96

Merged
sairus2k merged 1 commit into
mainfrom
fix/goreleaser-replace-artifacts
Sep 16, 2026
Merged

sairus2k merged 1 commit into
mainfrom
fix/goreleaser-replace-artifacts

Conversation

@sairus2k

Copy link
Copy Markdown
Owner

Problem

The v0.1.15 release failed at the homebrew formula step on an expired TAP_GITHUB_TOKENafter the GitHub release and all five assets had already published.

Re-running after refreshing the token failed earlier, at asset upload:

scm releases: failed to publish artifacts: failed to upload glmt_0.1.15_linux_amd64.tar.gz:
422 Validation Failed [{Resource:ReleaseAsset Field:name Code:already_exists}]

scm releases runs before homebrew 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_artifacts defaults to false. Setting it true makes 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.yml checks 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:

  • Release: all 5 assets present
  • sairus2k/homebrew-tapversion "0.1.15"
  • Formula sha256 values match the published checksums.txt exactly, so brew install verifies

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
sairus2k enabled auto-merge (rebase) September 16, 2026 14:47
@sairus2k
sairus2k disabled auto-merge September 16, 2026 14:47
@sairus2k
sairus2k enabled auto-merge (rebase) September 16, 2026 14:47
@sairus2k
sairus2k merged commit 7d16d3d into main Sep 16, 2026
7 checks 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