Skip to content

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

  1. A PR is merged into protected main, with its required checks passed.
  2. The post-merge Python CI push workflow must succeed at the current tip of main.
  3. .github/workflows/auto-publish.yml runs 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 into main.
  4. 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.
  5. Allocate a Perth-calendar version strictly greater than the source project version, all existing Git release tags and all PyPI versions.
  6. First check for a skip-release PR 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.
  7. Otherwise allocate a tag and create a published stable GitHub Release. On successful workflow completion, pypi-publish.yml is triggered by workflow_run and independently verifies the current merged PR and tag. It builds, validates, stamps, and publishes the verified wheel using PyPI OIDC Trusted Publishing.
  8. 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.toml baseline 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 main branch. The reconciliation job requires contents: write for 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.