Task: MIL-004#5
3.9 KiB
Release process
For the maintainers of this repository: how a change to the shared workflows is validated, versioned and announced, and how consumers pin a version. The decisions are in ADR-0006; this guide is the checklist. It is not published on the wiki.
Steps 5 and 6 are done by the Release workflow (.gitea/workflows/release.yml,
tools/release.py); the manual commands below are the fallback.
What a version is
| Item | Rule |
|---|---|
| Unit | The whole repository: the workflows, their scripts and the guides |
| Version tag | vMAJOR.MINOR.PATCH, for example v1.2.0; never deleted or moved |
| Major tag | vMAJOR, for example v1; points to the latest compatible release |
| First release | v1.0.0 |
| Breaking (new major) | A renamed or removed workflow, input, secret name or output; a raised default tool version or a changed default that can turn a green consumer red; a changed meaning of pass or fail |
| Minor | A new optional input, workflow or capability; nothing changes for existing callers |
| Patch | A fix, or documentation and tests, with no visible change for consumers |
Checklist for a release
-
Decide the version from the table above, looking at every merged change since the last tag.
-
Check the commit. The validation run (
validate-workflows) on the exact commit ofmainto be released is green; do not release from a red or unchecked commit. -
Write the changelog entry in
CHANGELOG.md: move the items of[Unreleased]under## [x.y.z] - datein the groups Breaking, Added, Changed and Fixed. A change that touches credentials, tokens or permissions says so. Check it withpython tools/changelog.py check --version x.y.z; a Breaking entry needs a new major version, and a new major version needs a Breaking entry. -
Get the approval of S01 for the release, in the pull request that adds the changelog entry.
-
Run the Release workflow in dry-run mode. In the Actions tab of this repository start Release on
mainwith the version anddry_runtrue. It checks that the commit is the tip ofmain, that its validation run is green, that the changelog has an entry for the version and that the tag does not exist, and writes nothing. -
Release. Start Release again with
dry_runfalse. It creates the tagvMAJOR.MINOR.PATCH, the release page with the text ofpython tools/changelog.py notes x.y.z, and movesvMAJORto the commit when this is the highest version of its major. The page on Gitea is the only destination (ADR-0007); nothing is attached to it. The workflow uses the token of its own run; if Gitea refuses it, storeTOKEN_FOR_GITEA_RELEASEas a secret with write access to this repository only.By hand, the same steps are:
git tag -a v1.2.0 -m "v1.2.0" <commit> git push origin v1.2.0 git tag -f v1 <commit> && git push -f origin v1and create the release page with the notes of the changelog entry.
-
Verify. One repository pinned to the previous exact tag still runs the same code; one repository on the major tag receives the release.
How consumers pin
| Pin | Receives | Use when |
|---|---|---|
@v1.2.0 |
nothing new, ever | a pipeline must not change |
@v1 |
compatible releases only | the default for a project |
@main |
everything, unreleased | never; only this repository's own tests |
Reusable workflows are pinned in the uses: line of the caller. The scoped
workflows (sync and publish wiki) are delivered from main by the instance
and cannot be pinned by a consumer; they fetch their scripts at the major tag
once v1 exists.
Undoing a faulty release
- Move the major tag back to the previous exact tag:
git tag -f v1 v1.1.0 && git push -f origin v1. - Fix forward on
mainand release a patch version. - Do not delete or move an exact tag; consumers may have pinned it.