Skip to content

Create GitHub Release automatically when a tag publishes to PyPI - #47

Merged
anna-opal merged 1 commit into
mainfrom
fix/create-github-release-on-publish
Jul 30, 2026
Merged

Create GitHub Release automatically when a tag publishes to PyPI#47
anna-opal merged 1 commit into
mainfrom
fix/create-github-release-on-publish

Conversation

@claude

@claude claude Bot commented Jul 30, 2026

Copy link
Copy Markdown

Requested via Slack thread

Before: Pushing a v* tag publishes to PyPI, but the Releases page stays stale — GitHub Releases were created by hand. Worse, a no-op upload still shows a green run: twine upload --skip-existing exits 0 even when it uploads nothing, which is how the broken v1.0.6/v1.0.7 tags looked successful.

After: Every successful publish automatically creates the matching GitHub Release with generated notes, and a tag whose version already exists on PyPI fails the run instead of silently doing nothing — so the Releases page reflects exactly what actually published.

How: Two changes to .github/workflows/build-and-publish-to-pypi.yml:

  1. Removed --skip-existing from the twine upload, so duplicate versions fail loudly (and skip the release step).
  2. Added a Create GitHub Release step after the upload that runs gh release create (preinstalled on GitHub-hosted runners) for the pushed tag with --generate-notes, plus a job-level permissions: contents: write block scoped to this job.

Builds on #46.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ssy8nmvQp1U5d73pCMFNXi


Generated by Claude Code

@anna-opal
anna-opal marked this pull request as ready for review July 30, 2026 23:30
@anna-opal
anna-opal merged commit 68772a9 into main Jul 30, 2026
10 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.

3 participants