[TOC]
The .github/workflows/release.yml workflow automates the entire release
flow. Trigger it from the GitHub Actions UI or via the GitHub CLI:
gh workflow run release.yml \
--repo Cosmian/kms \
--field old_version=5.19.0 \
--field new_version=5.20.0- Validates inputs (semver format,
old_versionmatchesCargo.toml, branch/tag do not already exist). - Creates
release/<new_version>fromdevelop. - Bumps all version references via
.github/scripts/release/release.sh --ci(sed-based substitutions across allCargo.tomlfiles and versioned docs) and regeneratesCargo.lock. Commits and pushes. - Updates Nix vendor hashes by running
nix_build_update_hash.shon a Linux runner (builds all derivations in order, auto-fixes hash mismatches). Commits and pushes the updatednix/expected-hashes/files. - Triggers a packaging CI run (
pr.ymlviaworkflow_dispatch) on the release branch, then polls until it completes. This run publishes packages and SBOMs topackage.cosmian.com. - Retrieves SBOMs from
package.cosmian.comand commits them. - Pushes the annotated Git tag
<new_version>. This triggerspr.yml(on:push:tags) which builds the final packages and creates the GitHub Release. - Git-flow finalisation: merges
release/<new_version>intomain(no-ff), mergesrelease/<new_version>back intodevelop(syncs the version bump), then deletes the release branch.
- Repository secret
PAT_TOKENmust haverepo+workflowscopes so that commits and tag pushes made by the workflow can re-trigger other workflows (pushes made withGITHUB_TOKENdo not trigger them).
Once the tag-triggered packaging pipeline completes, update the GitHub Release
notes at https://github.com/Cosmian/kms/releases/tag/<new_version> (copy
paste from CHANGELOG.md).
Follow these steps only if the automated workflow is unavailable or needs to be debugged.
- Install git-flow: https://skoch.github.io/Git-Workflow/\
- Install git-cliff:
cargo install git-cliff-
Create new release branch with git-flow:
git checkout main git pull git checkout develop git pull git flow init git flow release start X.Y.Z
-
Update the version X.Y.Z almost everywhere:
bash .github/scripts/release/release.sh <old_version> <new_version>
-
Commit the changes:
git commit -m "build: release X.Y.Z" git pushMake sure the CI pipeline is green.
-
Finish the release with git-flow:
git flow release finish X.Y.Z --push
-
Do not forget to update GitHub CHANGELOG at https://github.com/Cosmian/kms/releases/tag/X.Y.Z (copy paste from CHANGELOG.md)