Releasing
Releases are cut by pushing a vX.Y.Z tag on main. The tag triggers .github/workflows/release.yml, which verifies, builds and publishes the GitHub Release. Nothing is uploaded to PyPI.
Versions follow SemVer. The single source of the version is __version__ in warpzone/__init__.py; pyproject.toml reads it. A pre-release uses the PEP 440 spelling in both the code and the tag (0.2.0rc1 and v0.2.0rc1, not 0.2.0-rc.1), so the tag can match the package version exactly; any version that is not plain X.Y.Z is published as a GitHub pre-release.
Checklist
Section titled “Checklist”-
Start from an up-to-date
mainand a new branch, for examplerelease/vX.Y.Z. -
In
CHANGELOG.md, rename the content of[Unreleased]into a new## [X.Y.Z] - YYYY-MM-DDsection and leave[Unreleased]empty above it. Write for users, not commit by commit. -
Update the link references at the bottom:
[Unreleased]comparesvX.Y.Z...HEAD, and add[X.Y.Z]comparing the previous tag withvX.Y.Z. -
Set
__version__inwarpzone/__init__.pytoX.Y.Z. -
Run the checks locally:
uvx ruff check .,uvx ruff format --check .,python3 -m unittest discover -s tests -v. One test fails ifCHANGELOG.mdhas no section for the current version. -
Open a pull request, wait for green CI (lint, tests, e2e, secrets) and merge it.
-
Tag the merge commit on
mainwith a signed tag (see Signing a tag; the workflow refuses any other), check it and push only that tag:Terminal window git switch main && git pull --ff-onlygit tag -s vX.Y.Z -m "warpzone X.Y.Z"python3 scripts/verify_tag_signature.py vX.Y.Z --signers warpzone/data/allowed_signersgit push origin vX.Y.Z -
Watch the
releaseworkflow in the Actions tab, then open the release and check its notes and assets. Devices with the updater timer (Updating a device) fetch every hour on thercchannel and every 12 hours onstable, and check out the new tag in that tick (or later, if the menu is open);warpzone self-update --nowon a device looks at once.
What the workflow does
Section titled “What the workflow does”verify: fails unless the tag isvplus the package version, the tagged commit is contained inmain,CHANGELOG.mdhas a non-empty section for that version, and the tag is an annotated tag with an SSH signature made by a key listed inwarpzone/data/allowed_signers(see “Signing a tag”). Then it runs lint and the unit tests (the e2e test is not repeated: the tagged commit already passed it in CI onmain).build: builds the sdist and wheel with a pinnedbuild, writesSHA256SUMS, creates a build provenance attestation for the wheel and sdist, and uploads everything as a workflow artifact. This job hasid-tokenandattestationswrite access but nocontents: write.release: the only job withcontents: write. It creates the GitHub Release for the tag with the changelog section as notes (scripts/changelog_section.py) and attaches the wheel, the sdist andSHA256SUMS.
Workflow runs are serialised by a concurrency group, so two tags pushed together release one after the other.
Users can verify a download with sha256sum -c SHA256SUMS and gh attestation verify <file> --repo dagonco/warpzone.
When a release fails
Section titled “When a release fails”-
verifyfails (tag and version differ, missing changelog section, tag not on main, signature that does not verify, lint or test failure): nothing was published. Delete the tag locally and on the remote, fix the problem through a normal pull request, then tag again.Terminal window git tag -d vX.Y.Zgit push origin :refs/tags/vX.Y.Z -
buildorreleasefails for a transient reason (network, runner): re-run the failed jobs from the Actions tab. Re-runningreleaseis safe only if no release exists for the tag yet. -
The release exists but is wrong (bad notes, wrong asset): edit the notes in the GitHub UI, or
gh release delete vX.Y.Z(keep the tag) and re-run the workflow. If the code itself is wrong, do not move the tag: publish a new patch version instead. -
Never reuse a version number that users may already have downloaded.
Signing a tag
Section titled “Signing a tag”Devices that update themselves accept only tags signed with the maintainer’s SSH key, once its public key is in warpzone/data/allowed_signers of the version they are running. Until a key is there they accept unsigned tags and say so in their log (the release workflow does not: it always requires a signature). This covers release and candidate tags, a pin and the retired/ tags below.
One-time setup, with a key used only for this (an ed25519 key is enough):
ssh-keygen -t ed25519 -f ~/.ssh/warpzone-release -C "warpzone release"git config gpg.format sshgit config user.signingkey ~/.ssh/warpzone-release.pubPut the public key in warpzone/data/allowed_signers through a normal pull request, one line per key (<principal> namespaces="git" <key type> <public key>; the namespace is the one git signs with). A device reads the keys from the version it runs, so a key must be added in a release before the first tag signed with it is needed: tags are signed from the release after that. The first release that carries keys is taken on trust, with no signature check, because nothing on the device says yet whom to trust: whoever can publish that release chooses the first key. After it, signatures stay required: even if a device later goes down to an old release without the file, it keeps the last keys it trusted. To rotate, add the new key in a release signed with the previous key (a release cannot change the keys that check itself, and one signed with the new key alone would be refused); devices that move to it trust both, and then you can sign with the new one. Tags must be signed with SSH: a tag signed with OpenPGP or X.509 is refused.
Sign the tag instead of just annotating it in step 7 of the checklist (-s replaces -a), and check it before pushing:
git tag -s vX.Y.Z -m "warpzone X.Y.Z"git -c gpg.ssh.allowedSignersFile=warpzone/data/allowed_signers verify-tag vX.Y.Zgit push origin vX.Y.ZAn unsigned or lightweight tag, or one signed by a key that is not in the file, is ignored by every device that checks signatures. The verify job runs scripts/verify_tag_signature.py with the same checks a device makes, so such a tag is refused before anything is built or published. It reads the keys from warpzone/data/allowed_signers of the tagged commit, and only after it has checked that the commit is on main, where the file got through a reviewed pull request. Unlike a device, the workflow never accepts a file without keys: a release is always signed, so the first key must be merged before the first tag that needs it.
Publishing a release candidate
Section titled “Publishing a release candidate”A release candidate is a normal release with a PEP 440 version. Set __version__ to X.Y.ZrcN (for example 0.3.0rc1), add a ## [0.3.0rc1] - YYYY-MM-DD section to the changelog (the workflow refuses a tag without one), follow the checklist and tag v0.3.0rc1 (signed, as above). The workflow publishes it as a GitHub pre-release. The final release v0.3.0 is the next version and orders after every rc; v0.3.0rc2 orders after v0.3.0rc1 and rc10 after rc2. Only devices with channel = "rc" follow candidates; those on stable ignore them until the release. Do not spell it v0.3.0-rc1: no device knows that tag.
Retiring a release
Section titled “Retiring a release”A tag cannot be edited, and a published release must never be moved or reused. If a release turns out to be harmful, withdraw it with a second tag, retired/vX.Y.Z (or retired/vX.Y.ZrcN), annotated and signed like a release, on the release it withdraws, with the reason as its message:
git tag -s retired/v0.3.0 v0.3.0 -m "settings apply overwrote a captured key"git push origin retired/v0.3.0The tag must be named retired/ plus the exact tag it withdraws and point at that release (its tag or its commit, which is the same to a device): a retirement made for another name or another release is ignored, and so is a signed object published under another name. There is no file to edit and no pull request: the tag is the retirement, and devices take it with their next fetch. The release workflow does not run for it (it only runs for v*.*.*). When the allowed signers hold a key, a retirement that is not signed by one of them (or is only a lightweight tag) is ignored, so nobody without the key can pull a good version. From then on:
- no device picks the tag as a target;
- a device that runs it moves to the best release that is not retired, even a lower one, after verifying it like any update;
- a device with
pinset to the tag stays on it (a pin wins) and records it in its state so thatdoctorcan warn.
A retirement cannot be undone on a device that has already fetched it, so publish a fixed version as a new patch release, so devices have something to move up to.