Skip to content

fix(ci): make Release workflow idempotent on existing tag#244

Merged
avrabe merged 1 commit into
mainfrom
fix/release-workflow-idempotent
Apr 29, 2026
Merged

fix(ci): make Release workflow idempotent on existing tag#244
avrabe merged 1 commit into
mainfrom
fix/release-workflow-idempotent

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 29, 2026

Problem

The `Create Release` step in `.github/workflows/release.yml` runs:

```bash
gh release create "$VERSION" --title "Rivet $VERSION" --generate-notes release/*
```

This fails with `a release with the same tag name already exists` if a maintainer ran `gh release create` manually right after pushing the tag.

That is exactly what happened on every release in this session — v0.5.0, v0.5.1, and v0.6.0 all hit this failure. Net effect: each release page exists with the auto-generated changelog notes but has no binary / VSIX / SHA256 assets attached.

Fix

Make the step idempotent:

```bash
if gh release view "$VERSION" >/dev/null 2>&1; then
gh release upload "$VERSION" --clobber release/*
else
gh release create "$VERSION" --title "Rivet $VERSION" --generate-notes release/*
fi
```

If the release already exists, upload assets to it. Otherwise create it from scratch. `--clobber` lets re-runs overwrite assets that a previous failed attempt partially uploaded.

Backfill plan

After this lands, the v0.5.0 / v0.5.1 / v0.6.0 releases all need their binaries uploaded. Re-running the Release workflow on each tag via `workflow_dispatch` (or pushing a no-op tag update) will trigger the now-idempotent `Create or update Release` step, which will detect the existing release and upload the binaries that were built but never published.

Test plan

  • CI green
  • After merge: re-run Release workflow on v0.6.0 (most recent), verify assets land on the release page
  • If successful, backfill v0.5.1 and v0.5.0 the same way
  • Future releases: maintainer can still run `gh release create` manually right after pushing the tag (for the changelog) without breaking the asset upload

🤖 Generated with Claude Code

The "Create Release" step in release.yml runs `gh release create
$VERSION ...` unconditionally. This fails with "a release with the
same tag name already exists" if a maintainer ran `gh release create`
manually right after pushing the tag — which is exactly what
happened on every release in the v0.5.0 / v0.5.1 / v0.6.0 sequence.
Net effect: the release page exists with the changelog notes but
has no binary / VSIX / SHA256 assets attached.

Fix: make the step idempotent. If `gh release view $VERSION`
succeeds (release already exists), `gh release upload --clobber` the
built assets to the existing release. Otherwise create it the
normal way.

`--clobber` lets a re-run overwrite assets that a previous failed
attempt partially uploaded — also useful when re-running the
workflow via workflow_dispatch to backfill assets on an old release.

Backfill plan: after this lands, re-run the Release workflow on
v0.5.0, v0.5.1, v0.6.0 via workflow_dispatch (or push a no-op tag
update). Each run will detect the existing release and upload the
binaries that were built but never published.

Trace: skip
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit 67f0e08 into main Apr 29, 2026
24 of 39 checks passed
@avrabe avrabe deleted the fix/release-workflow-idempotent branch April 29, 2026 20:44
avrabe added a commit that referenced this pull request Apr 30, 2026
…246)

Workspace, vscode-rivet, and npm root package versions bumped to 0.7.0.
Platform packages stay on the release-npm.yml override path.

What's in 0.7.0:

- feat(schema): rivet schema migrate Phase 2 (#242) — full git-rebase
  conflict-resolution UX. Conflict markers in YAML, --continue,
  --skip, --edit. New MigrationConflict invariant in rivet docs check.
- feat(docs-check): subcommand-coverage gate (#241) — walks the live
  clap CLI tree and asserts each path has an embedded docs topic.
  Default warn-only; --strict makes it enforcing.
- feat(validate): prose-mention-without-typed-link warning (#234,
  closes #207).
- feat(schemas): vv-coverage repo-status type (#232, partial #188).
- feat(mutants): canonical cargo-mutants template (#229, closes #185).
- docs(pre-commit): canonical 21-hook template (#222, closes #186).
- fix(ci): Release workflow now idempotent on existing tag (#244).

Known issue: v0.5.0 / v0.5.1 / v0.6.0 release pages have no binary
assets attached because the workflow's Create Release step failed
on each (race with manual gh release create). The fix in #244 lands
in this release; v0.7.0 onward is unaffected. Older releases need
a manual gh release upload to backfill.

Verified: cargo check, cargo clippy --workspace -- -D warnings,
cargo test -p rivet-cli, rivet docs check (clean), rivet docs check
--coverage reports 48/81 paths covered (warn-only).

Trace: skip
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