Skip to content

ci: auto-publish CLI to PyPI on GitHub release#2

Merged
DavyMorgan merged 2 commits into
mainfrom
dev
Apr 12, 2026
Merged

ci: auto-publish CLI to PyPI on GitHub release#2
DavyMorgan merged 2 commits into
mainfrom
dev

Conversation

@DavyMorgan

Copy link
Copy Markdown
Collaborator

Summary

Adds a GitHub Actions workflow that auto-publishes the CLI to PyPI when a GitHub Release is published. Uses PyPI trusted publishing (OIDC) — no stored tokens.

  • Triggers on Release publication (not on every push)
  • Builds sdist + wheel with python -m build
  • Verifies release tag matches pyproject.toml version (e.g. tag v0.1.2 must match version = "0.1.2")
  • Publishes via pypa/gh-action-pypi-publish using OIDC

Release workflow going forward

  1. Bump version in pyproject.toml
  2. Commit, merge to main
  3. Create GitHub Release with tag v<version> → CI publishes automatically

Test plan

🤖 Generated with Claude Code

Uses PyPI trusted publishing (OIDC) — no stored tokens needed. Triggered
when a GitHub Release is published. Verifies the tag matches the version
in pyproject.toml before uploading.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 12, 2026 17:23
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gp300 c8a80c2 Commit Preview URL

Branch Preview URL
Apr 12 2026, 05:29 PM

Copilot AI 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.

Pull request overview

Adds a GitHub Actions release workflow to build and publish the gp300 Python CLI package to PyPI using Trusted Publishing (OIDC), with a guard that checks the GitHub Release tag version matches pyproject.toml.

Changes:

  • Introduces a Publish to PyPI workflow triggered on release.published.
  • Builds sdist + wheel via python -m build.
  • Verifies the release tag version matches the project.version in pyproject.toml, then publishes using pypa/gh-action-pypi-publish.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +16
environment: pypi
permissions:
id-token: write # required for PyPI trusted publishing (OIDC)

steps:
- uses: actions/checkout@v4

@DavyMorgan

Copy link
Copy Markdown
Collaborator Author

@codex[agent] review this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Co-authored-by: DavyMorgan <27959377+DavyMorgan@users.noreply.github.com>
@Codex

Codex AI commented Apr 12, 2026

Copy link
Copy Markdown

@codex[agent] review this PR

Reviewed and added contents: read to the publish job permissions so checkout works (c8a80c2). Pytest still passes.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@DavyMorgan

Copy link
Copy Markdown
Collaborator Author

@copilot to review again.

Copilot AI commented Apr 12, 2026

Copy link
Copy Markdown

@copilot to review again.

The workflow looks good. The previously flagged issue (missing contents: read permission) was already addressed in commit 74efc6e — both contents: read and id-token: write are set at the job level. No further issues found.

@DavyMorgan DavyMorgan merged commit 46c6810 into main Apr 12, 2026
2 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.

4 participants