Skip to content

Auto-release on version bump merged to main#75

Merged
fracapuano merged 1 commit into
mainfrom
chore/auto-release-on-merge
Jun 12, 2026
Merged

Auto-release on version bump merged to main#75
fracapuano merged 1 commit into
mainfrom
chore/auto-release-on-merge

Conversation

@fracapuano

Copy link
Copy Markdown
Collaborator

What

Extends .github/workflows/release.yml so that merging a version bump into main automatically publishes to PyPI — closing the gap that caused the recent missed 0.3.0 release (a bump was merged, but no v* tag was ever pushed, so nothing fired).

How it works

The workflow now triggers on push to main and on v* tags:

  • check job decides whether to release:
    • main push: release only if no v<version> tag exists yet for the current pyproject.toml version (idempotent — re-running on main does nothing).
    • tag push: release only if the tag matches pyproject.toml (preserves the existing manual-release path).
  • build → publish run only when should_release == true, using the existing PyPI trusted-publishing setup (same release.yml filename, pypi environment, OIDC).
  • tag job (main-push path only) creates and pushes v<version> after a successful publish, so tags and releases stay in sync.

Notes

  • Kept everything in release.yml on purpose: PyPI trusted publishing is bound to the workflow filename, so a new file would have its uploads rejected.
  • Merging this PR will not re-release 0.3.0 — the v0.3.0 tag already exists, so the check job short-circuits.

🤖 Generated with Claude Code

Extend the release workflow so merging a version bump to main triggers a
PyPI release automatically, while still supporting manual v* tag pushes.

- Trigger on push to main (in addition to v* tags)
- check job: release only when no tag exists for the current pyproject
  version (main push) or when a pushed tag matches it (manual)
- After publishing from a main push, create and push the v<version> tag

This closes the gap where bumping the version and merging did nothing
because no tag was ever pushed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@fracapuano
fracapuano merged commit e8a57c1 into main Jun 12, 2026
1 check 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