Skip to content

ci: use OIDC trusted publishing for PyPI releases#54

Merged
brendanjryan merged 1 commit intomainfrom
brendan/oidc-trusted-publishing
May 2, 2026
Merged

ci: use OIDC trusted publishing for PyPI releases#54
brendanjryan merged 1 commit intomainfrom
brendan/oidc-trusted-publishing

Conversation

@brendanjryan
Copy link
Copy Markdown
Contributor

Problem

Release commits since v0.5.0 have failed with 403 Forbidden from PyPI:

ERROR    HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/

The release job ran wevm/changelogs, which did its own twine upload with no pypi-token input, so twine had no auth and PyPI rejected it. The separate publish job using pypa/gh-action-pypi-publish never ran because release errored first.

Fix

wevm/changelogs now natively supports PyPI Trusted Publishing (OIDC) as of tempoxyz/changelogs#116. When pypi-token is empty and the workflow has id-token: write, it mints a short-lived PyPI API token at PyPI's _/oidc/mint-token endpoint and uses it for the upload.

Collapse the two-job workflow into a single release job that:

  • Pins wevm/changelogs to the merge commit with OIDC support (de02501).
  • Grants id-token: write and environment: pypi so the OIDC mint flow matches the registered Trusted Publisher entry on PyPI.

Setup

The PyPI Trusted Publisher entry on pytempo should match:

  • Owner: tempoxyz
  • Repository: pytempo
  • Workflow: publish.yml
  • Environment: pypi

No new secrets are needed — the PYPI_TOKEN secret can be removed after this lands.

Releases since v0.5.0 have failed with 403 Forbidden because
wevm/changelogs ran twine upload with no token (no pypi-token input
was provided), and the separate publish job using
pypa/gh-action-pypi-publish never ran since the release job errored
first.

wevm/changelogs now natively supports PyPI Trusted Publishing (OIDC)
as of tempoxyz/changelogs#116. When pypi-token is empty and the
workflow has id-token: write, it mints a short-lived PyPI API token
by exchanging the GitHub OIDC ID token at PyPI's _/oidc/mint-token
endpoint.

Collapse the two-job workflow into a single release job that:
- pins to the changelogs commit with OIDC support (de02501)
- grants id-token: write + environment: pypi so the OIDC mint flow
  matches the registered Trusted Publisher entry on PyPI.
@brendanjryan brendanjryan merged commit 3ebf32f into main May 2, 2026
11 of 13 checks passed
@brendanjryan brendanjryan deleted the brendan/oidc-trusted-publishing branch May 2, 2026 19:31
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