Skip to content

ci(release): create the draft once and tag up front - #8

Merged
itsmbaqer merged 2 commits into
mainfrom
fix/release-race
Sep 23, 2026
Merged

itsmbaqer merged 2 commits into
mainfrom
fix/release-race

Conversation

@itsmbaqer

Copy link
Copy Markdown
Owner

Why

v0.2.0 ended up with a published release and a duplicate draft (id 394686744). There were two causes:

  1. Race. All 4 matrix jobs asked tauri-action to create the draft, and two did.
  2. Rebuild on publish. From the version workflow (workflow_call), the tag didn't exist until you published the draft. Publishing created it, and that tag push ran release.yml again.

Fix

  • New create job. It runs once, before the matrix:
    • Tags the commit through the API with GITHUB_TOKEN. Those pushes trigger no workflows, so publishing later creates nothing new. For a tag pushed by hand, the tag already exists and nothing changes.
    • If the tag already has a published release, it outputs no id and the builds are skipped.
    • Otherwise it reuses the existing draft, or creates one (marked prerelease when the tag has a -).
  • Builds pass releaseId to tauri-action instead of tagName and the draft options.

Checked

  • actionlint, which includes shellcheck on the run script.
  • Ran the lookup against this repo:
    • v0.2.0 finds the published release 394679607 (not the leftover draft), so no build runs.
    • Unknown tags return nothing, so a draft gets created.

CI-only change, so no changeset. The first real test is the next version PR merge.

🤖 Generated with Claude Code

itsmbaqer and others added 2 commits September 23, 2026 16:48
The four matrix jobs each asked tauri-action to create the draft, and two could race to
create duplicates (v0.2.0 got two). Publishing a draft from a workflow_call run also created
the tag, and that push rebuilt the release.

A create job now finds or makes the draft and passes its id to every build. It tags the
commit with GITHUB_TOKEN first, which triggers nothing, and it skips the build when the tag
is already published.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@itsmbaqer
itsmbaqer merged commit 7fd1026 into main Sep 23, 2026
3 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