Automatic PyPI release policy: new merges only¶
The release cutover marker .github/release-cutover.md establishes a strict
starting point. Do not create releases for commits before or including that
marker’s merge commit. Existing Git tags, GitHub Releases and PyPI versions
remain intact; they are considered only when allocating a newer version.
Normal publishing sequence¶
- A PR is merged into protected
main, with its required checks passed. - The post-merge
Python CIpush workflow must succeed at the current tip ofmain. .github/workflows/auto-publish.ymlruns using that verified commit. It checks that the cutover marker was introduced earlier on first-parent history, and that the commit is associated with a merged PR intomain.- Only the current verified tip is eligible. The reconciler does not publish old untagged commits, replay earlier release failures or walk a first-parent backlog. If newer merges supersede the CI run being processed, the older run is skipped, rather than assigning a later PyPI version to older source.
- Allocate a Perth-calendar version strictly greater than the source project version, all existing Git release tags and all PyPI versions.
- First check for a
skip-releasePR label or[skip release]in the final merge commit message. An opt-out skips both tag and GitHub Release creation. The regular CI and Pages workflows still complete. - Otherwise allocate a tag and create a published stable GitHub Release.
On successful workflow completion,
pypi-publish.ymlis triggered byworkflow_runand independently verifies the current merged PR and tag. It builds, validates, stamps, and publishes the verified wheel using PyPI OIDC Trusted Publishing. - The successful PyPI workflow triggers checksum-verified asset attachment for that exact release. It does not scan other versions.
A burst of merges may produce fewer releases than commits: a merge that is superseded before its release attempt is skipped, but its code is included in the next released main revision.
Cutover and recovery¶
- The marker's first addition to main history defines the cutover. The marker merge itself is deliberately not a release.
- There are no hourly, daily, scheduled, manual or release-published
triggers for GitHub Release creation or PyPI publication. The only
initiating event is successful CI for an actual merged PR on
main. - A direct push, a failed PR CI run, and an outdated merge cannot publish. An already published version cannot be uploaded twice. A failed release is addressed by another PR merge rather than a separate manual trigger.
- An old unpublished tag from before this cutover is not backfilled. Do not delete or move historical release tags, or attempt to reuse a version.
- Source archives generated by GitHub contain the original committed
pyproject.tomlbaseline version, which can differ from the release version stamped at build time. The verified PyPI wheel is the installable versioned artifact. - The PyPI workflow must be allowed to deploy from the
mainbranch. The reconciliation job requirescontents: writefor tag and GitHub Release creation. Required CI checks on main remain intact.
This policy deliberately prioritises releasing current code going forward, rather than creating a GitHub Release for every historical merge.