Skip to content

ci: automate PyPI releases - #144

Merged
sydneycollins-cio merged 3 commits into
mainfrom
ci/release-please
Nov 26, 2026
Merged

sydneycollins-cio merged 3 commits into
mainfrom
ci/release-please

Conversation

@sydneycollins-cio

Copy link
Copy Markdown
Contributor

Releases are cut by hand today. This adds release-please, the same setup the Node SDK uses.

  • Merging a fix: or feat: PR opens a release PR with the version bump and changelog.
  • Merging the release PR tags the release and publishes to PyPI in the same run. Publishing stays in publish.yml because PyPI trusted publishing is bound to that file.
  • The build now fails if the built version does not match the tag.
  • The registry check reads the version from the tag for these runs and skips pushes that released nothing.

Hand made GitHub releases still publish as before. Main already holds an unreleased feat: commit, so the first release PR will be for 3.3.0.

🤖 Generated with Claude Code

Merging a fix or feat PR now opens a release PR, and merging that one
tags the release and publishes to PyPI from the same workflow run.
The registry check works out the version from the tag for those runs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sydneycollins-cio
sydneycollins-cio marked this pull request as ready for review November 26, 2026 16:21
@sydneycollins-cio
sydneycollins-cio requested a review from a team as a code owner November 26, 2026 16:21

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5bd6d83. Configure here.

Comment thread .github/workflows/publish.yml Resolved
Comment thread .github/workflows/registry-check.yml Resolved
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sydneycollins-cio sydneycollins-cio changed the title ci: release with release-please ci: automate PyPI releases Nov 26, 2026

@mahmoud-elmorabea mahmoud-elmorabea left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Comments inline, none block the merge.

run: python -m build

# A build that cannot see the tag gets a dev version, which must not ship.
- name: Check the built version matches the tag

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A hand-made prerelease tag like v3.3.0-rc.1 builds as 3.3.0rc1, so this glob won't match and the build fails. Worth normalizing the tag before comparing if you still plan manual prereleases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The check now rewrites the tag the same way Python does before comparing, so v3.3.0-rc.1 matches 3.3.0rc1. Fixed in 4a07d38.

fetch-depth: 0
ref: ${{ github.event.workflow_run.head_sha || github.sha }}

- name: Work out which version to look for

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; release-please only sees conventional squash titles, and nothing lints them. A feat merged as "Add X" would silently miss the release PR. A PR title check could be a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I left it out of this PR to keep it small, and a PR title check is a good follow-up.

sha: ${{ steps.release.outputs.sha }}
steps:
- id: release
uses: googleapis/release-please-action@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm the repo allows Actions to create pull requests? I couldn't read that setting, so the first run after merge will show it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sydneycollins-cio
sydneycollins-cio merged commit 7547a50 into main Nov 26, 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.

2 participants