Skip to content

ci: Publish to PyPI with trusted publishing - #93

Open
kylebarron wants to merge 1 commit into
mainfrom
ci/trusted-publishing
Open

kylebarron wants to merge 1 commit into
mainfrom
ci/trusted-publishing

Conversation

@kylebarron

Copy link
Copy Markdown
Owner

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

Switches PyPI publishing from the PYPI_PASSWORD API token to trusted publishing (OIDC), as in kylebarron/pydelatin#56. This is separate from the modernization stack (#84–#90).

Changes

  • upload_pypi runs in a pypi-release environment with id-token: write and no stored credentials. It now runs only on tag pushes, and uses pypa/gh-action-pypi-publish@release/v1 instead of @master.
  • The sdist is built with uv build --sdist instead of setup-python@v2 + pip install numpy Cython build.

It merges cleanly with the Python 3.14 wheels PR. The workflow file keeps the name build-wheels.yml, which the PyPI trusted publisher setting needs to match.

Setup needed before the next release

  1. On PyPI, under quantized-mesh-encoder → Settings → Publishing, add a GitHub trusted publisher: owner kylebarron, repository quantized-mesh-encoder, workflow build-wheels.yml, environment pypi-release.
  2. In the repo settings, create a pypi-release environment.
  3. After a release succeeds, delete the PYPI_PASSWORD secret and revoke the token on PyPI.

🤖 Written by Claude Code

Replace the long-lived `PYPI_PASSWORD` API token with PyPI trusted
publishing (OIDC), so no PyPI credentials are stored in the repo. Uploads
run in a `pypi-release` environment, which can require approval before a
release goes out, and only on tag pushes. Use the `release/v1` branch of
gh-action-pypi-publish instead of `master`, and build the sdist with uv
instead of setup-python + build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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