Skip to content

Publish releases to PyPI via Trusted Publishing (deferred) - #203

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

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

Conversation

@smmaurer

Copy link
Copy Markdown
Member

Summary

Adds a publish job to build-wheels.yml, split out of #201 (authored by @waddell). On a published GitHub release, it:

  • waits for all wheel and sdist builds to succeed
  • checks that the release tag matches the package version in setup.py
  • runs twine check on the distributions
  • uploads via pypa/gh-action-pypi-publish using OIDC — no stored API token — with id-token: write limited to this job
  • pins the checkout, artifact-download, and PyPI-publish actions by commit SHA

Why draft

Prerequisites that aren't in place yet (see #199 and the UDST CI and Release Plan):

  1. Protected pypi environment — the job references environment: pypi, which should require release-manager approval. The UDST org is on the legacy GitHub Silver plan, which doesn't support deployment environments; migrating the org plan is a one-time owner task.
  2. Trusted Publisher registration on PyPI: owner UDST, repository pandana, workflow build-wheels.yml, environment pypi.
  3. Repository settings — default workflow permissions should be read-only, workflows should not be able to approve PRs, and tag protection / rulesets should exist so a release can't be created from an arbitrary commit.

Until then, releases are uploaded manually with twine from the artifacts of the Build wheels workflow (see CONTRIBUTING.md). Rehearse the automated path with a release candidate before using it for a final release.

Publishes tested wheels and the sdist on a published GitHub release,
with OIDC permission limited to the publishing job, a tag/version
check, Twine checks before upload, and the checkout, artifact-download,
and PyPI-publish actions pinned by commit SHA.

Split out of PR #201 and deferred until the repository prerequisites
are in place.
@smmaurer
smmaurer changed the base branch from dev to main August 24, 2026 20:30

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.

2 participants