Skip to content

ci(release): PyPI Trusted Publishing#19

Merged
denfry merged 1 commit into
mainfrom
ci/pypi-trusted-publishing
Jun 24, 2026
Merged

ci(release): PyPI Trusted Publishing#19
denfry merged 1 commit into
mainfrom
ci/pypi-trusted-publishing

Conversation

@denfry

@denfry denfry commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Wires PyPI publishing into release.yml via Trusted Publishing (OIDC) — no stored token.

  • New pypi-publish job (pypa/gh-action-pypi-publish, id-token: write, environment: pypi) consumes the same dist/ artifact that already passed twine check + clean-machine smoke.
  • github-release now guards on refs/tags/*, and a workflow_dispatch trigger lets us publish the current main build to PyPI without recreating a GitHub release — used to push the already-tagged v1.6.0 to PyPI.
  • Future v* tags publish to both GitHub and PyPI automatically.
  • RELEASE_CHECKLIST.md intro updated (no longer "GitHub-only").

Assumes the PyPI trusted publisher uses environment name pypi (the recommended setup). If it was configured without an environment, that still matches; if it uses a different name, I'll adjust environment:.

🤖 Generated with Claude Code

Add a pypi-publish job using pypa/gh-action-pypi-publish with id-token: write
(no stored token). github-release now guards on tag refs; a workflow_dispatch
run publishes the current build to PyPI without recreating a GitHub release —
used to publish an already-tagged version (v1.6.0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@denfry denfry merged commit 41bb25b into main Jun 24, 2026
10 checks passed
@denfry denfry deleted the ci/pypi-trusted-publishing branch June 24, 2026 07:02

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1c15d37e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


permissions:
contents: write # create the GitHub release (the sole distribution channel)
workflow_dispatch: # manual (re)publish — e.g. push an already-tagged version to PyPI

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit manual PyPI publishes to main

When a maintainer manually dispatches this workflow from any branch other than main (GitHub's manual-run UI/CLI allow selecting a branch/ref, and github.ref then points at that ref), the build checks out that branch and pypi-publish still gets OIDC credentials and uploads it. That contradicts the "current main build" release path and can publish an unreviewed branch/version to PyPI without a GitHub release; add an if guard for workflow_dispatch on refs/heads/main or explicitly check out main for manual publishes.

Useful? React with 👍 / 👎.

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