Releasing wagtail-unveil¶
This is the maintainer runbook for publishing package releases to PyPI via GitHub Actions.
Release Workflow¶
- Workflow file:
.github/workflows/release.yml - Trigger: GitHub Release event
published - Authentication: PyPI Trusted Publisher (OIDC), no API token secret
The release workflow:
- validates GitHub release tag (
vX.Y.Zor pre-release likevX.Y.Zrc1) matchesproject.versioninpyproject.toml - validates the tagged commit is contained in
origin/main - builds
sdist+wheelwithuv build - runs
twine checkon built artifacts - publishes artifacts to PyPI using
pypa/gh-action-pypi-publish
One-Time Setup (PyPI Trusted Publisher)¶
In the PyPI project settings for wagtail-unveil, add a Trusted Publisher with:
- Owner or organization:
nm-packages - Repository:
wagtail-unveil - Workflow:
release.yml - Environment: unset (unless intentionally adding GitHub Environments later)
The GitHub repository and workflow identity must match exactly, or publish will fail.
Maintainer Release Steps¶
- Keep
CHANGELOG.mdupdated under## Unreleasedfor every merged PR landing onmain. - Update
versioninpyproject.tomlto the intended release version. - Convert the current
## Unreleasednotes inCHANGELOG.mdinto the new release entry, then leave a fresh## Unreleasedplaceholder for future work. - Review user-facing docs and examples that intentionally describe the current release, and either:
- update them to the new version where exact release numbers are still useful, or
- remove brittle hardcoded release numbers when the docs work just as well without them.
- Merge the release-prep changes to
main. - Ensure normal CI on
mainis green (CIworkflow). - Create a GitHub Release with a tag that matches the package version with
vprefix. - Use the matching
.github/release-*.mdfile or theCHANGELOG.mdentry as the GitHub Release body. - Publish the GitHub Release.
- Confirm
.github/workflows/release.ymlsucceeds and the version appears on PyPI.
For local sandbox/test command workflows before a release, use:
- development.md for canonical developer workflow and quickstart commands
- AGENTS.md for canonical contributor command/reference guidance
Changelog Maintenance¶
- Add or update a
CHANGELOG.mdentry under## Unreleasedin every PR. - During release prep, move or rewrite the
Unreleasednotes into the new versioned release section. - After release prep, keep an empty
## Unreleasedsection in place for subsequent work. - During release prep, review any docs/examples that intentionally point at the current package release and avoid leaving stale version numbers in user-facing pages.
Examples:
pyproject.tomlversion0.3.0=> GitHub tagv0.3.0, release title0.3.0(orRelease 0.3.0)pyproject.tomlversion0.4.0rc1=> GitHub tagv0.4.0rc1, release title0.4.0rc1(orRelease 0.4.0rc1)
Local Preflight (Optional but Recommended)¶
Run these before creating the GitHub Release:
uv build --sdist --wheel --out-dir /tmp/wagtail-unveil-dist-check
uvx twine check /tmp/wagtail-unveil-dist-check/*
Failure Modes and Troubleshooting¶
- Tag/version mismatch:
- Symptom: workflow fails in "Validate release tag matches package version"
- Fix: align GitHub tag with
pyproject.tomlversion and republish release - Tag commit not on main:
- Symptom: workflow fails in "Validate release commit is on main"
- Fix: retag a commit that is on
main - Trusted Publisher identity mismatch:
- Symptom: PyPI publish step reports authorization/trust failure
- Fix: verify owner/repo/workflow values in PyPI Trusted Publisher settings
- Duplicate version:
- Symptom: publish step fails because version already exists on PyPI
- Fix: bump
pyproject.tomlversion and publish a new tag/release