Releasing¶
Clifft uses setuptools-scm to derive the package version from git tags. The release workflow builds wheels for Linux (x86_64, aarch64), macOS (arm64), and Windows (amd64), then publishes to PyPI via trusted publishers.
Versioning¶
The version is determined automatically from git tags:
- Tagged commits (e.g.,
v0.2.0): version is0.2.0 - Development builds: version is
0.2.1.dev3+g1a2b3c4(tag + commit distance + hash)
There is no hardcoded version in pyproject.toml. The git tag is the single source of truth.
Release process¶
1. Test on TestPyPI (optional but recommended)¶
Verify that wheels build and install correctly by running the release workflow manually. Manual dispatch always publishes to TestPyPI only — it cannot publish to PyPI.
- Go to Actions > Release > Run workflow
- Select the branch (usually
main) -
Wait for builds to complete, then verify:
2. Update the changelog¶
Generate the new release section using git-cliff:
This prepends only the unreleased changes since the previous tag and preserves older hand-edited release sections. Do not use -o CHANGELOG.md for routine releases unless you intentionally want to regenerate the entire changelog.
Review, edit if needed (add the release summary, fix typos, clarify entries, remove noise), then commit:
3. Update the docs home page¶
Update the "What's New" section in docs/index.md with a short, editorial summary of the release. Keep this section user-facing and curated rather than generated directly from the changelog. Link to the most relevant new documentation or tutorial, and include a link to the full changelog.
4. Tag and push¶
5. CI runs automatically¶
The tag push triggers the release workflow:
- Build — sdist and wheels for all platforms
- Publish to TestPyPI — dry run on the test index
- Publish to PyPI — the real release (only on tag push)
- Create GitHub Release — extracts release notes from
CHANGELOG.md
If any step fails, subsequent steps are skipped.
6. Verify¶
Check that the GitHub Release was created.
Changelog maintenance¶
The changelog is generated from conventional commit messages using git-cliff with the config in cliff.toml.
Use conventional commit prefixes: feat:, fix:, docs:, perf:, refactor:, test:, build:, ci:. Commits with chore: and style: are excluded from the changelog.
Install git-cliff locally:
Prerequisites (one-time setup)¶
These steps are needed once when setting up the repository:
-
PyPI trusted publisher: On pypi.org, configure a trusted publisher for
clifft(owner:unitaryfoundation, repo:clifft, workflow:release.yml, environment:pypi). -
TestPyPI trusted publisher: Same on test.pypi.org with environment
testpypi. -
GitHub environments: Create two environments in repo settings:
pypi— optionally add required reviewers for production releasestestpypi— no restrictions needed
-
Initial version tag: After migrating to the new repo, push the first tag to establish the version baseline: