Skip to content

CI: publish wheels to PyPI on version tags (Trusted Publishing, no secrets) - #4

Merged
morousg merged 1 commit into
Libraries-Openly-Fused:mainfrom
johnnynunez:ci/pypi-trusted-publishing
Jun 11, 2026
Merged

morousg merged 1 commit into
Libraries-Openly-Fused:mainfrom
johnnynunez:ci/pypi-trusted-publishing

Conversation

@johnnynunez

Copy link
Copy Markdown
Contributor

Summary

Adds a publish-pypi job to the wheels workflow: on v* tags, after the build + codegen compile checks pass, the sdist and wheel are uploaded to PyPI so users can simply:

pip install fkl-python

How it works

  • Uses PyPI Trusted Publishing (OIDC) via pypa/gh-action-pypi-publish — no API tokens or long-lived secrets stored in GitHub. PyPI verifies the upload comes from this exact repo + workflow + environment.
  • Runs only on version tags, gated on the same needs: as the GitHub Release job (which is unchanged and runs in parallel).
  • skip-existing: true makes tag re-runs idempotent.

One-time setup needed (whoever owns the PyPI side)

The fkl-python name is currently unclaimed on PyPI (verified against the simple index). Before the first tagged release, someone (suggest: Oscar or the org) needs to register the pending publisher on pypi.org:

PyPI → Your projects → Publishing → Add a new pending publisher

  • project: fkl-python
  • owner: Libraries-Openly-Fused
  • repository: fkl_python
  • workflow: wheels.yml
  • environment: pypi

…and create the pypi environment in this repo's GitHub settings (Settings → Environments → New environment → pypi; optionally add required reviewers as a release gate).

After that, publishing a release is just: git tag v0.7.0 && git push origin v0.7.0.

These steps are also documented inline in the workflow file.

New publish-pypi job: on v* tags (after build + codegen compile checks
pass) the sdist+wheel are uploaded to PyPI with pypa/gh-action-pypi-publish
using OIDC Trusted Publishing — no API tokens or secrets stored in GitHub.

One-time setup required on pypi.org (documented in the workflow):
add a pending publisher for project 'fkl-python' pointing at this
repository, workflow wheels.yml, environment 'pypi'. The 'fkl-python'
name is currently unclaimed on PyPI (verified via the simple index).

skip-existing=true makes tag re-runs idempotent; the GitHub Release job
is unchanged and runs in parallel.
@morousg
morousg merged commit a8c4c90 into Libraries-Openly-Fused:main Jun 11, 2026
5 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.

2 participants