wirekx publishes to PyPI with GitHub Actions Trusted Publishing, using OIDC. Do not create or store PyPI API tokens for the publish workflow.
From the repository root:
python -m pip install build twine
python -m pytest
python -m build
python -m twine check dist/*
unzip -l dist/*.whl | grep wirekxThe build must produce both:
dist/wirekx-X.Y.Z-py3-none-any.whl
dist/wirekx-X.Y.Z.tar.gz
Do not commit dist/, build/, or *.egg-info/ artifacts.
Publishing is triggered when a GitHub Release is published.
The release workflow is:
- The
buildjob checks out the repository, installsbuild, and runspython -m build. - The
buildjob uploads thedist/artifacts. - The
publishjob downloads those artifacts. - The
publishjob uses PyPI Trusted Publishing through OIDC withpypa/gh-action-pypi-publish@release/v1.
The publish job uses the GitHub Environment named pypi, which should require
manual approval before publishing.
The workflow currently uses:
pypa/gh-action-pypi-publish@release/v1For stronger supply-chain hardening, consider pinning this action to a full commit SHA after reviewing the action version you want to trust.
Do these by hand. Do not automate them in this repository.
- pypi.org -> Publishing -> Trusted Publishers -> Add: GitHub Actions, owner
wirekx, repowirekx, workflowpublish.yml, environmentpypi. - Repeat on test.pypi.org as a dry run. Hardening: consider pinning
pypa/gh-action-pypi-publishto a full commit SHA instead of@release/v1. - GitHub repo Settings -> Environments -> create
pypi, add yourself as a required reviewer for manual approval on every run. - Release: bump version, commit, tag
vX.Y.Z, create a GitHub Release. This triggers the workflow.