Skip to content

Publishing to Pypi.org

Brian Ruf edited this page Jul 12, 2026 · 2 revisions

Releases are published automatically to PyPI by GitHub Actions when a GitHub Release is created. No manual upload steps are required.

Prerequisites (one-time setup)

  • A pypi environment configured in the GitHub repository settings
  • A Trusted Publisher configured on PyPI linking this repo's publish.yml workflow to the ruf-common project

Release steps

1. Update the version

In pyproject.toml, bump the version number following Semantic Versioning:

[project]
version = "X.Y.Z"

2. Commit and push

git add pyproject.toml
git commit -m "Bump version to vX.Y.Z"
git push

3. Merge with Main

https://github.com/brian-ruf/ruf-common-python/pulls

4. Tag the commit

git tag vX.Y.Z
git push origin vX.Y.Z

5. Create the GitHub Release

  1. Go to Releases → New release
  2. Select tag vX.Y.Z
  3. Set the title to Version X.Y.Z
  4. Add release notes summarizing the changes
  5. Click "Publish release"

Publishing the release triggers the publish.yml workflow, which builds the package and uploads it to PyPI automatically.

5. Verify

Version numbering guidelines

Change type Example When to use
Patch X.Y.Z+1 1.0.1 → 1.0.2 Bug fixes, no API changes
Minor X.Y+1.0 1.0.2 → 1.1.0 New features, backward-compatible
Major X+1.0.0 1.1.0 → 2.0.0 Breaking changes