Skip to content

Release process

To release a new version, either:

  • UI: go to Actions → Release Tag → Run workflow (on main) and enter the major, minor and patch numbers (vX.Y.Z must be greater than the latest released one) and, optionally, a message (release notes). This tags the latest main commit as vX.Y.Z.

  • CLI: push a signed tag of a main commit, its message being the release notes:

    git tag --sign vX.Y.Z --message "<release notes>"
    git push origin vX.Y.Z
    

    Repeat --message for more paragraphs, use --file <notes.md> or omit both to write the notes in your editor.

Important

Rulesets reject tags not shaped like vX.Y.Z.

Both trigger all necessary pipelines, which create a draft GitHub release ⧉ with all assets, upload the package to PyPI, and publish the release. Documentation is then pushed to gh-pages and deployed to GitHub Pages.

Tip

Pull requests changing the release run it (release-test.yml) without attesting or publishing anything.

Note

Changelog (release description) will be automatically created by the pipelines. The tag message (if any) is placed above it.

Caution

Do not create GitHub releases via Releases → Draft a new release. Drafts trigger no workflows, therefore the release will be incomplete.

Warning

Merging to main does not trigger package or documentation releases.

Versioning

This project uses a double versioning scheme based on Semantic Versioning ⧉:

  • Public version – The official release version (e.g., v1.2.0).
  • Python version – Automatically generated from commits and independent of the public version.

Rationale

Public versions are there to signify the release to the audience (mainly for marketing purposes), while the Python version ensures semantic consistency (needed by package users). This approach also enhances security by preventing automated tag pushes to main (no bot automerges).

Public version

Public releases follow Semantic Versioning ⧉ and trigger:

Python version

Managed automatically based on commit messages:

  • fix → Patch version update
  • feat → Minor version update
  • BREAKING (or feat!/fix!) → Major version update

Tip

Check out comver ⧉ for details about Python version calculations.

Artifacts

Releases include only attested artifacts:

  • Python package (packaging guide ⧉), its wheel contains a CycloneDX SBOM of itself (PEP 770 ⧉, created by python-sbom ⧉)

  • uv audit ⧉, Semgrep ⧉, zizmor ⧉, GuardDog ⧉ (core, extras and actions) and CodeQL ⧉ SARIFs, named security-<tool>-<commit SHA>.sarif (CodeQL not available without GitHub Code Security)

  • Software Bills of Materials (SBOMs) (CISA guide ⧉) and Trivy ⧉ scans (SARIF) of the Python ones (vulnerabilities, licenses of core and extras):

    1. Python package with its core, extras and dev dependencies per Python version and per OS (via CycloneDX ⧉)

    2. GitHub Actions of the project and of the reusable workflows (extracted from uses: references, see sbom-actions in pyproject.toml)

    3. REUSE SBOM (docs ⧉)

  • Trivy configuration of these scans (trivy-config-<commit SHA>.yaml and trivy-ignore-<commit SHA>.yaml, copies of .trivy.yaml and .trivyignore.yaml), so allowed licenses and ignored findings can be audited

  • <asset>.sigstore.jsonl for every asset above: attestation bundles (actions/attest ⧉) for offline verification

Attestations

Important

Public/internal repositories created from open-nudge/opentemplate (and private ones on GitHub Enterprise Cloud) satisfy SLSA L3 Build.

Warning

Private repositories without GitHub Enterprise Cloud (NO_GITHUB_ENTERPRISE_CLOUD variable set) do not have any SLSA attestations, therefore are L0.

Every signed release asset is produced by an open-nudge/opentemplate reusable workflow and attested within the same workflow by a separate job. Before attaching to the release each artifact is verified against the attestation of its producing workflow:

Asset Signer workflow
Wheel and source distribution _release-build.yml
Wheel and source distribution (VSA) _release-vsa.yml
SBOMs, their Trivy SARIFs and configuration _sbom.yml
uv audit, Semgrep, zizmor, GuardDog, CodeQL SARIFs _release-sarifs.yml

Note

Release notes (changelog) and documentation are not attested (their build runs project not open-nudge/opentemplate code), therefore not attached.

The release fails if it contains any unexpected asset.

Important

The package is uploaded to PyPI only when all previous steps succeed, and the release is published only afterwards, otherwise it stays a draft. Published releases are immutable ⧉ (enabled by harden.yml): their assets and tag cannot be changed.

The distributions carry SLSA Build Provenance ⧉ (SLSA Build L3 ⧉ for attested releases, see below).

Warning

You need to run harden.yml before releasing, otherwise it will fail!

Note

open-nudge/opentemplate is SLSA L2 itself as it relies on its own build.

Warning

Only commits of the default branch (merged via reviewed pull requests) are built. Follow default release approach of open-nudge/opentemplate

Warning

Private repositories without GitHub Enterprise Cloud must opt out by setting the NO_GITHUB_ENTERPRISE_CLOUD configuration variable to any value, e.g. true (at the organization or repository level ⧉), otherwise their release fails. No attestations are created and attached then. This escape hatch is ignored for public and internal repositories!

Verifications

To verify an artifact run the following:

gh attestation verify <asset> \
  --bundle <asset>.sigstore.jsonl \
  --repo <owner>/<repo> \
  --signer-workflow open-nudge/opentemplate/.github/workflows/<signer> \
  --signer-digest <sha> \
  --source-ref refs/tags/<tag> \
  --deny-self-hosted-runners

where <signer> comes from the table in previous section and <sha> is the template commit the project pins (@<sha> in its .github/workflows).

Note

Drop --bundle to fetch the attestations from GitHub instead.

The same command verifies files downloaded from PyPI (the provenance is bound to the digest). PyPI itself only shows its publish attestations, signed by the project's release.yml, as trusted publishing does not support reusable workflows (pypi/warehouse#11096 ⧉).

Ensure the commit belongs to the template (and not to a fork of it), the command below should output ahead or identical:

gh api repos/open-nudge/opentemplate/compare/<sha>...main --jq .status

The wheel's own SBOM is covered by the wheel's digest (it is inside it), every other SBOM is additionally attested against the wheel and source distribution (subject: distribution digest, predicate: the SBOM), only after their provenance is verified.

While the attestation of the SBOM file proves where the file came from, this one binds its content to the artifact you actually have: starting from the wheel's digest, verifiers (or policy engines) can verify:

  • its SBOMs without relying on file names
  • that the wheel was installed in the environment the SBOM describes.

The bundles of the distributions include these attestations.

Warning

SBOMs are created in an environment where dependencies' code may run (e.g. source distribution builds), therefore their content is only as trustworthy as the dependencies. The attestation proves which workflow produced them, not that their content is correct.

Verify them with --signer-workflow pointing to _sbom.yml and --predicate-type https://cyclonedx.org/bom (or https://spdx.dev/Document/v2.2 for the REUSE SBOM).

The distributions also carry a Verification Summary Attestation ⧉ (VSA), created after their build provenance is verified (policy: .github/actions/attestation-verify/action.yml at <sha>). Its inputAttestations are the verified provenance statements (digest of the signed in-toto statement, not of the bundle):

jq -r .dsseEnvelope.payload <asset>.sigstore.jsonl | base64 -d | sha256sum

Consumers can check the verified SLSA level instead of the provenance:

gh attestation verify <asset> \
  --bundle <asset>.sigstore.jsonl \
  --repo <owner>/<repo> \
  --predicate-type https://slsa.dev/verification_summary/v1 \
  --signer-workflow open-nudge/opentemplate/.github/workflows/_release-vsa.yml \
  --signer-digest <sha> \
  --source-ref refs/tags/<tag> \
  --deny-self-hosted-runners \
  --format json \
  | jq '.[].verificationResult.statement.predicate.verifiedLevels'

It outputs ["SLSA_BUILD_LEVEL_3"] (["SLSA_BUILD_LEVEL_2"] for open-nudge/opentemplate itself).

As published releases are immutable (see above), GitHub additionally creates a release attestation ⧉ of the tag, its commit and the release assets. Verify the release and a downloaded asset with:

gh release verify <tag> --repo <owner>/<repo>
gh release verify-asset <tag> <asset> --repo <owner>/<repo>

Note

These prove the asset belongs to the published release, not which workflow produced it, use them alongside gh attestation verify. Source code archives generated by GitHub cannot be verified this way (docs ⧉).

Changelog

Generated via git-cliff ⧉ (configured in pyproject.toml) and:

  • The latest version's changelog becomes the release description.
  • CHANGELOG.md inside the repository links to GitHub releases

The changelog includes:

  • Public version, date, and comparison link
  • Commit statistics (e.g., how many commits done by human compared to bots, types of commit like security, tests, legal etc.)
  • Python changes (Breaking, Features, Fixes, Bots)
  • Other changes (same structure as Python changes)
  • Each commit includes message, author, and metadata (if available)

Tip

Read more about changelogs in the FAQ

Customization

This process can be adjusted by editing:

  • .github/workflows/release.yml

  • pyproject.toml:

    1. [tool.git-cliff] – Changelog settings

    2. [dependency-groups] → dev-release – changing SBOM dependencies

Important

Reusable workflows run from the template commit pinned in .github/workflows (@<sha>), editing their local copies has no effect. Distributions are built with that commit's pyproject.toml as well, only [project] comes from the project (other build settings, e.g. [tool.hatch] or hatch.toml, are ignored). To change them, fork the template and point uses: to the fork (attestations are then signed by the fork's workflows).

Code sources

  • pyproject.toml
  • .github/workflows/release.yml
  • .github/workflows/_release.yml
  • .github/workflows/release-test.yml
  • .github/workflows/release-tag.yml
  • .github/workflows/_release-upload.yml
  • .github/workflows/_release-sarifs.yml
  • .github/workflows/_security-sarifs.yml
  • .github/workflows/_release-changelog.yml
  • .github/workflows/_release-docs.yml
  • .github/workflows/_release-build.yml
  • .github/workflows/_release-vsa.yml
  • .github/workflows/_release-sboms.yml
  • .github/workflows/_sbom.yml
  • .github/workflows/_security-upload.yml
  • .github/actions/dist-build/action.yml
  • .github/actions/attestation-verify/action.yml
  • .github/actions/digests-verify/action.yml
  • .github/actions/pages-update/action.yml
  • .github/actions/release-version/action.yml