Releases use PyPI Trusted Publishing: the workflow .github/workflows/release.yml proves its
identity to PyPI with a short-lived OpenID Connect token. No password or API token exists in the
repository, in GitHub secrets or on a developer machine.
- GitHub environment. Repository Settings → Environments → New environment, name
pypi. Add yourself under Required reviewers so that every publish needs an explicit approval. Optionally restrict Deployment branches and tags to the patternv*. - PyPI pending publisher. On https://pypi.org/manage/account/publishing/ add a pending
publisher (this creates the project name
spillgateon the first publish):- PyPI project name:
spillgate - Owner:
FelixMiddelhoff - Repository name:
spillgate-python - Workflow name:
release.yml - Environment name:
pypi
- PyPI project name:
- Turn on two-factor authentication for the PyPI account and keep the recovery codes safe.
The PyPI name is reserved only when the first release is published, so do step 2 and the first release close together.
- Update
CHANGELOG.mdand setversioninpyproject.toml(for example0.1.0). Commit tomainand wait for a green CI. - Tag exactly that version and push the tag:
git tag -a v0.1.0 -m "v0.1.0" git push origin v0.1.0 - The
releaseworkflow builds once, checks that the tag equals the version, runs the whole suite with brotli and zstd installed and nothing skipped, checks the wheel in a clean environment, and waits for your approval in thepypienvironment. After the approval it publishes the same files, with build attestations, to PyPI. - Check from a clean directory:
python -m venv t && t/bin/python -m pip install "spillgate[brotli,zstd]==0.1.0" - Create the GitHub release from the tag with the changelog text.
Never delete or move a published tag, and never re-upload a version: PyPI refuses it. A wrong release is yanked on PyPI and fixed with the next patch version. Versions at or above 1.0 need separate, explicit consent.