The repository contains separate workflows for validation, TestPyPI, and the production PyPI index. Long-lived PyPI tokens are not required.
- Create the public GitHub repository
troyrock/distlink-pythonand push themainbranch. - On TestPyPI, create a pending Trusted Publisher with:
- owner:
troyrock - repository:
distlink-python - workflow:
test-publish.yml - environment:
testpypi
- owner:
- On PyPI, create a pending Trusted Publisher with:
- owner:
troyrock - repository:
distlink-python - workflow:
release.yml - environment:
pypi
- owner:
- Create matching
testpypiandpypiGitHub environments. Configure required reviewers for the productionpypienvironment if desired.
The distlink-python distribution name was reserved by the first successful
PyPI upload of version 0.2.0.
-
Confirm that the CI workflow passes on
main. -
Run the Publish to TestPyPI workflow manually.
-
Install the uploaded version in a clean environment and run a smoke test:
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps distlink-python python -c "from distlink import COrbitData; print(COrbitData())"
- Update the version in
pyproject.tomland add its release notes toCHANGELOG.md. PyPI does not permit replacing an uploaded distribution file with different content. - Confirm that CI and the TestPyPI installation pass.
- Create and publish a GitHub release whose tag matches the version, for
example
v0.2.0. - Approve the
pypienvironment deployment if an approval rule is enabled. Publishing the GitHub release triggers.github/workflows/release.yml.