Skip to content

Harden release workflow: fail fast on tag/version mismatch, tolerate re-runs#20

Merged
jumbodaddystack merged 1 commit into
mainfrom
claude/pypi-publish-skipping-eetxbw
Jul 2, 2026
Merged

Harden release workflow: fail fast on tag/version mismatch, tolerate re-runs#20
jumbodaddystack merged 1 commit into
mainfrom
claude/pypi-publish-skipping-eetxbw

Conversation

@jumbodaddystack

Copy link
Copy Markdown
Owner

Why

The v0.1.5 release failed to publish. Root cause: the v0.1.5 tag was cut at commit c2f90e2 (merge of #17), where pyproject.toml still read version = "0.1.4". The version bump to 0.1.5 landed on main in the next commit (#18), after the tag. So the release built crumb_kit-0.1.4 and PyPI rejected it with 400 File already exists — 0.1.4 was already published on 6/29.

The failure surfaced only at the very last step (the PyPI upload) with a confusing "already exists" message for a version nobody intended to publish. These changes make that mistake obvious and cheap to recover from.

Changes

  • Fail fast on tag/version mismatch (release.yml): on a release event, assert the built wheel's version equals the release tag before doing anything else. A mistagged release now fails in the build job with an actionable message ("re-tag on the bumped commit") instead of dying at the upload step.
  • skip-existing: true on the publish step: if a release ever half-uploads (wheel succeeds, sdist fails), a re-run skips the already-present file instead of erroring on File already exists, so a partial failure no longer forces a version bump.

Notes

  • No version change here. crumb-kit 0.1.5 was never uploaded (PyPI 404), so the version number is still free to use.
  • Shipping 0.1.5 still requires re-cutting the release so its tag points at main: delete the failed v0.1.5 release and tag, then create a new v0.1.5 release with Target main.

🤖 Generated with Claude Code


Generated by Claude Code

A release tag pointing at a pre-bump commit silently builds the old
version and fails at PyPI upload with a confusing 'File already exists'.
Assert tag == built version in the build job so the mistake is caught
early with an actionable message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017d8fQYnfiBRFrimcC55BLa
@jumbodaddystack jumbodaddystack merged commit 046cac1 into main Jul 2, 2026
14 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.

2 participants