Release Process¶
Branch convention¶
Release branches must follow:
release/vX.Y.Z
Example:
release/vX.Y.Z
Post-release master policy¶
After a release completes, master tracks the latest released version metadata until the next release branch is prepared. Unreleased work stays under the [Unreleased] changelog section, while pyproject.toml, slideflow/__init__.py, uv.lock, and the latest released changelog header all continue to agree on the last published version.
Release tags must remain ancestors of master after release completion. If a tag was created on a side branch, reconcile by merging the tag side back into master; do not move a published tag unless the package has not been published and the correction is explicitly approved.
Automated release flow¶
On push to a release/vX.Y.Z branch, the Release workflow:
- validates branch naming
- blocks publishing on workflow lint, full CI-style tests, optional connector tests, docs build, dependency audit, static security scan, and live Google validation evidence for the same commit
- validates project version consistency
- builds wheel and source distributions
- validates distribution metadata with
twine check - installs built wheel and runs package smoke validation:
pip check- CLI entrypoint import/help
- packaged built-in template discovery and render
- quickstart
validate+build --dry-run - creates and pushes Git tag
vX.Y.Z - publishes package to PyPI (OIDC trusted publishing)
- creates GitHub release with artifacts
The protected google-live-validation environment must define these variables with successful GitHub Actions run IDs for the current release commit:
SLIDEFLOW_LIVE_GOOGLE_SLIDES_RUN_IDSLIDEFLOW_LIVE_GOOGLE_DOCS_RUN_IDSLIDEFLOW_LIVE_GOOGLE_SHEETS_RUN_ID
The release workflow verifies each run through the GitHub API and requires the run to be completed, successful, from the matching live workflow file, and bound to the current GITHUB_SHA. Configure required reviewers on the environment so a human verifies the evidence before publishing can continue.
Idempotency behavior:
- If the same version is already published on PyPI, publish is skipped.
- If tag/release already exist on the same artifact-producing commit, those steps are skipped.
- If the PyPI version already exists but the matching tag is missing, or if the tag points at any commit other than the current workflow commit, the workflow fails. Follow-up commits on a release branch must not silently reuse an existing package version or tag.
Version consistency contract¶
These must match:
pyproject.toml->[project].versionslideflow/__init__.py->__version__- latest released
CHANGELOG.mdheader - release branch suffix ->
release/vX.Y.Z
PyPI package identity:
- distribution name:
slideflow-presentations - import namespace:
slideflow - CLI command:
slideflow
Pre-release checklist¶
- Ensure tests pass locally.
- Update docs + changelog in the same release prep PR:
- update user-facing docs for new behavior/flags/workflows
-
update
CHANGELOG.mdwith release notes and known issues -
Ensure docs build cleanly:
uv sync --extra docs --extra dev --extra ai --extra powerpoint --locked
source .venv/bin/activate
uv lock --check
uv pip check
uv run python scripts/ci/check_numpy_binary_compatibility.py
uvx --from black==26.3.1 black --check slideflow tests scripts
uv run python -m ruff check slideflow tests scripts
uv run python -m mypy slideflow
uv run pytest -q
uv run mkdocs build --strict
- Verify dependency constraints are still within policy:
- runtime dependencies have explicit upper bounds
- dbt adapters remain compatible with the supported
dbt-corerange - security-sensitive dependency minimums are preserved
-
uv.lockis current for the release branch -
Bump versions in
pyproject.tomlandslideflow/__init__.py. - Ensure
CHANGELOG.mdhas the matching released header. - Create release branch
release/vX.Y.Z. - Push and monitor the
Releaseworkflow plus any branch CI/Audit checks. TheReleaseworkflow runs its own strict docs build; the standaloneDocsworkflow builds docs on docs-related PRs and deploys only after pushes tomaster/main. - After release completion, merge the release result back to
masterand verifygit merge-base --is-ancestor vX.Y.Z master. - For release or hardening PRs that update vulnerable dependencies, record which Dependabot PRs are superseded or merged, then verify after the default-branch merge that the related Dependabot alerts are fixed.
gh api '/repos/OWNER/REPO/dependabot/alerts?state=open' --paginate
gh pr list --author app/dependabot --state open
PyPI trusted publishing setup¶
- Create PyPI project (or use existing).
- Add trusted publisher for this GitHub repo/workflow.
- Configure GitHub environment
pypiwith any required reviewers. - Keep
id-token: writeenabled in release workflow permissions.
Rollback guidance¶
If release publish fails after tag creation before PyPI publication:
- fix issue in a new commit on release branch
- re-run workflow (or push follow-up commit)
- if explicitly approved, delete the bad tag and recreate only when corrected artifacts are ready
If PyPI publication succeeded, do not move the tag. Publish a corrective release with a new version and document the incident.