Skip to content

fix: avoid duplicate GitHub releases caused by race condition#37

Merged
lwshang merged 2 commits intomainfrom
fix/release-workflow-race-condition
Mar 24, 2026
Merged

fix: avoid duplicate GitHub releases caused by race condition#37
lwshang merged 2 commits intomainfrom
fix/release-workflow-race-condition

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Mar 23, 2026

Problem

Pushing tag v12.0.0-2026-03-19-04-43 triggered the Release workflow and produced two duplicate releases on the GitHub Releases page:

The root cause was that the release job used a matrix with 4 entries (x86_64-linux, arm64-linux, arm64-darwin, x86_64-darwin). All 4 jobs ran concurrently and each attempted to create the GitHub Release via svenstaro/upload-release-action, resulting in a race condition where multiple releases were created for the same tag.

Fix

  • Replace the matrix release job + separate create-release job with a single release job that downloads all 4 artifacts at once (using pattern + merge-multiple: true) and creates the release with all assets in one gh release create call.
  • Add permissions: contents: write to the release job (required by gh release create).
  • Additional cleanup: upgrade actions/cache to v4, replace env.VER with github.ref_name for artifact names, remove invalid --no-fail-on-no-commits flag, remove deprecated install: true from setup-buildx-action.

Post-merge plan

After this PR is merged:

  1. Delete the duplicate release(s) at https://github.com/dfinity/icp-cli-network-launcher/releases
  2. Delete the tag v12.0.0-2026-03-19-04-43 from the remote:
    git push origin --delete v12.0.0-2026-03-19-04-43
    
  3. Re-push the tag to trigger the fixed workflow:
    git tag v12.0.0-2026-03-19-04-43
    git push origin v12.0.0-2026-03-19-04-43
    

The Docker images already published to ghcr.io do not need to be removed — the workflow will overwrite them with the same tags.

🤖 Generated with Claude Code

lwshang and others added 2 commits March 23, 2026 19:06
Replace the matrix release job (4 parallel jobs each creating/uploading
to the release) with a single job that downloads all artifacts at once
and creates the release with all assets in one gh release create call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Upgrade actions/cache from v3 to v4
- Use github.ref_name instead of env.VER for artifact names (statically known)
- Add permissions: contents: write to release job
- Remove invalid --no-fail-on-no-commits flag from gh release create
- Remove deprecated install: true from setup-buildx-action

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review March 23, 2026 23:18
@lwshang lwshang requested a review from a team as a code owner March 23, 2026 23:18
@lwshang lwshang enabled auto-merge (squash) March 23, 2026 23:18
@lwshang lwshang merged commit be78e7d into main Mar 24, 2026
15 checks passed
@lwshang lwshang deleted the fix/release-workflow-race-condition branch March 24, 2026 08:37
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.

2 participants