chant release cut
Cuts a release of the member in the current directory from the checkout’s HEAD. A release is only ever cut by this command; chant ci tick never cuts one (ws-105, proposed). See Cutting on green for a pipeline that cuts every green commit, and Release from your workstation for a cut made on a laptop and published from CI.
git fetch origin --tagsgit checkout "$(chant ci last-green)"chant release cut v1.4.0 --build "npm run build" # a dry run: prints the planchant release cut v1.4.0 --build "npm run build" --yes # cuts, records and tagsWithout --yes the cut is a dry run (#4027). It makes every check below and compiles every environment, then prints what the cut would record and tag, and what will be published where. Nothing is built or signed, and nothing is written to chant/lifecycle or tagged. Run the same command again with --yes to cut; the dry run prints that command. The same command runs unchanged in CI, where it needs --yes as well.
--dry-run asks for the dry run by name. It is what a cut without --yes does already, and it keeps a cut with --yes a dry run, so --dry-run --yes cuts nothing. The command the dry run prints to run next leaves --dry-run out.
The cut refuses before it writes anything when:
| Code | When |
|---|---|
release-worktree-dirty | A tracked file has uncommitted changes, or a file git does not ignore is untracked, so the compile would not be the commit’s. A new *.component.ts left untracked would otherwise be compiled into the release. |
release-commit-not-on-trunk | HEAD is not reachable from origin/<trunk> or from any further branch listed in ci.green.branch (#4325), and is not a first-parent commit of a pushed chant/compose/<name> branch (see Cutting a composed commit). Trunk is the branch ci.green.branch names in the declaration at base, else the branch origin/HEAD names, else main. |
release-commit-not-pushed | HEAD is on the local trunk branch but not on origin/<trunk>, or this clone has no origin/<trunk>. The check reads the remote-tracking branch as this clone last fetched it and fetches nothing, so a commit pushed from elsewhere needs a git fetch origin <trunk> first. |
release-commit-not-green | The green gate does not pass. Under chant, HEAD has no ci/green/<sha> tag, or with a lane no ci/green-<lane>/<sha> tag (see Cutting from a lane). chant ci makes the tags; only local tags are read, so fetch them first. With signed tags, a tag without a valid statement doesn’t count, and the message names it. Under forge-checks, a check on the forge failed or has not finished, a check the branch requires is missing, or there is no check at all, and the message names them. With --wait-checks, checks still running when the wait’s time is up. With --override-green, an override can let it through (see Cutting a commit that is not green). |
release-forge-checks-unavailable | release.green is forge-checks, and the forge can’t be asked: the origin remote names no GitHub, GitLab or Forgejo repository, no token is set, or the forge answered with an error. |
release-green-none-refused | release.green is none, and the declaration at base turns on the supply-chain or verified-releases security group, or names a release gate in identity.gates. |
release-commit-revoked | HEAD has a ci/revoked/<sha> tag, or with a lane a ci/revoked-<lane>/<sha> tag. |
release-tag-taken | The tag the release would get (see The release’s tag) already names another commit. |
release-tag-invalid | The label makes a tag name git refuses. |
release-tag-template-invalid | release.tag is not a template: it names no {version} or {label}, names one twice, names a placeholder there is none of, holds a character a tag can’t, or names {member} or {path} where there is no member or the project is at the repository root. |
release-tag-collision | release.tag can make a tag another chant member of the workspace can make, so one member’s release could take the other’s tag. |
release-no-environments | The member’s chant.config.ts declares no environments and no release.publish target or release.images, so there is nothing to release. With targets and no environments the cut is an artifact release. |
release-no-components | The member declares environments and components, none is enabled in any environment, and nothing was compiled. A project that declares no component is released from its build output instead, see a project with no components. A project that only publishes packages or files declares no environments. |
release-unsigned | The declaration at base names a release gate in identity.gates, and the cut is not signed. See Who may cut. |
release-signer-refused | The cut’s signature does not verify for the actor against the signers file at base, or the actor is not in the release gate’s class. Nothing is written. |
declaration-invalid | The cut names a lane, and the declaration at base has no ci.green or declares no such lane, or release.green is not chant, which is the only gate with lanes. The message lists the lanes it declares. |
release-build-inputs-differ | A component’s build steps differ between environments, for example a docker-build whose buildArgs read a parameter that is set per environment. Its artifact can’t be built once for every environment. |
publish-npm-carries-image | An npm target in release.publish would pack an image archive the cut just built (#4941). The cut runs the npm target’s own check (see Images the package pins) once the images are built, so the label is not spent on a release the publish would refuse. publish-npm-pack-failed when npm pack --dry-run can’t list the package. |
publish-sbom-missing | An npm target in release.publish names a package that carries no SBOM at its root, under the supply-chain group, or when the target’s sbom names a file the package does not hold (#5518). The cut runs the npm target’s own check once the build has run, so the label is not spent on a release the publish would refuse. A lockfile is no source for a package’s SBOM: write one into the package in the build, such as npm sbom --omit dev --sbom-format spdx > sbom.spdx.json. A member with environments and a build command is left to the publish, since the cut does not run its build. publish-sbom-invalid when the file is not SPDX or CycloneDX JSON. |
release-check-failed | A line of release.check exited non-zero. The message names the line and its exit code. |
publish-scan-failed | The release would be scanned (release.scan, or the supply-chain group), and the scan the cut runs on what the publish would put out found a finding vulnPolicy blocks. The message lists each one. See The scan before the tag. publish-scan-db-stale when the scanner’s database is older than the bound a security profile or release.scan.dbMaxAgeHours sets, and publish-scan-tool-failed when the scanner or syft fails. |
publish-scan-tool-missing | The release would be scanned, and grype (or trivy) or syft can’t be run here. Checked before anything is built, in a dry run too. publish-scan-vex-missing when a file vulnPolicy.vexSources names is not there. |
publish-npm-never-published | An npm target in release.publish names a public package that the registry (the target’s registry, else npm’s configured one) has never published. npm trusted publishing can’t create a package, so its first publish would fail after the label is spent and other packages were staged. The message names the package. Publish one placeholder version of it by hand (npm login, then npm publish), add the trusted publisher on npmjs.com under the package’s Settings, and cut again. chant release doctor reports it before a cut, and chant workspace train cut refuses it before cutting any member. publish-npm-registry-unreadable when the registry can’t say, which refuses the cut as well. |
The code is printed in square brackets at the end of the message. The dry run refuses with the same codes, and also with release-label-taken when the label already names a release of another commit.
auto in place of the label cuts the label release next computes for the commit being cut, and refuses with its codes. --pre <id> and --first <version>, the label of a member’s first release when it has no previous one, go with auto only. Every cut with a label, auto or typed, consumes the intent files at the commit that name the member: its cut line lists them, and the dry run prints them.
Checks before the cut
Section titled “Checks before the cut”release.check lists shell lines the cut runs before it records anything (#5261), for checks that decide whether this commit may be released at this label. Each line runs with sh -c in the member’s directory, in order:
{ "release": { "version": { "packages": ["packages/conformance", "packages/reference"] }, "check": [ "bash scripts/release-spec-version.sh", "npm test", "npm run smoke:published" ] }}The lines run once the label is known and stamped into the files release.version names, and after the images, the files release.artifacts builds and, for a release with no environments, --build. They run before any environment is compiled and before anything is recorded or tagged. CHANT_RELEASE_LABEL holds the label (unset for a cut with no label), CHANT_RELEASE_COMMIT the commit being cut, and CHANT_RELEASE_DIGESTS the digests file when release.images built images. The first line that exits non-zero refuses the cut with release-check-failed, and the stamped files are put back. What a line prints goes to stderr, so the stdout of --json holds the cut’s document alone.
The dry run runs the lines too, so chant release cut <label> refuses a label the checks refuse before anyone types --yes, and a cut from a workstation runs them as the release workflow’s cut job does. A line that needs a build of its own, when the cut has no --build, runs it itself. A train runs each member’s release.check in that member’s cut, after its own release.train.check. RELEASE_CHECK_FLOOR in @intentius/chant/lifecycle/release-cut is the first chant with the setting.
release.verify is a different hook: release publish runs it after every target has staged, when a version is already on the registry under a staging tag.
The scan before the tag
Section titled “The scan before the tag”When the publish would scan for known vulnerabilities (release.scan in chant.config.ts, or the supply-chain security group), the cut runs the same scan first. It runs once the images, the files and the component artifacts are built and the release is made, and before the cut is signed, written to chant/lifecycle, pushed or tagged. A finding the policy blocks refuses the cut with publish-scan-failed, so the label is not spent on a release the publish would refuse, and the stamped files are put back as on any other refusal.
The cut scans what the publish would put out: each oci target’s archive, the one release.images just built, through an SBOM syft makes from its layers; the SBOM each forge target attaches; and the SBOM each npm package carries, or one written from the lockfile. It uses the publish’s vulnPolicy, VEX files, scanner (the Wiz image scanner when release.scan.imageScanner is wiz) and database age bound. A target that can’t name what it would put out at the cut, for a reason other than the scan, such as a file only the publish job builds, is left to the publish’s scan, and the cut prints a line naming it.
The publish scans again before it stages anything. Its scan may read a newer database, and it gates a release however it was cut. release.scan: false turns off both scans; nothing turns off one of them alone.
The release workflow’s cut job installs the same pinned grype and syft as its publish job, on GitHub, GitLab and Forgejo and for a train, and a chant ci serve --release host hands its own to the cut it runs. A cut from a workstation needs them on PATH, or named by CHANT_GRYPE and CHANT_SYFT; chant release doctor reports a missing one. In a train each member’s cut scans, and a member the scan refuses stops the train before any tag is pushed. RELEASE_CUT_SCAN_FLOOR in @intentius/chant/lifecycle/release-cut is the first chant whose cut scans.
Cutting a chosen commit
Section titled “Cutting a chosen commit”--at <sha> cuts that commit instead of HEAD (#4168). The cut checks the commit out in a temporary detached worktree, runs the compile and the artifact builds there, and removes the worktree when it ends. The checkout you run it from can be at any commit and can have uncommitted changes, so release-worktree-dirty does not apply. Every other check in the table above does: the commit must be on origin/<trunk>, carry a ci/green tag that counts and no ci/revoked tag. --at takes anything git resolves to a commit, and refuses a name this clone does not know with release-at-unknown.
git fetch origin --tagschant release candidateschant release cut v1.4.0 --at 3f2a9c1e0b7d --build "npm run build" --yesThe worktree shares the repository’s refs, so the release and the cut go to the repository’s chant/lifecycle and the release/<label> tag names the commit. The checkout’s node_modules are linked into the worktree at the top and in each directory down to the member, so the compile resolves the packages already installed. A commit whose lockfile differs from the checkout’s needs its own install.
Cutting a composed commit
Section titled “Cutting a composed commit”A commit of a pushed chant/compose/<name> branch, as release compose makes it, is cut like a trunk commit (#4168). The branch is read as this clone last fetched it from origin. Green and revoked tags decide as they do on trunk. With signed tags the tag’s statement names the compose branch the tick walked.
The cut line’s composed field names the branch and the base it was composed on. It also lists the trunk commits its Chant-Composed-From trailers name, oldest first. The walk goes back along first parents to the first commit on trunk, past any commit made on the branch by hand. --channel <tag> records channel on the cut line, and release publish then moves that tag in place of latest. The dry run and --json print both as composed and channel, and print prerelease too: true when the label is a semver prerelease such as 1.4.0-rc.1, which a publish treats as one without a channel.
git fetch origin --tagschant release cut v1.4.1 --at "$(git rev-parse origin/chant/compose/hotfix-1-4)" --channel hotfix --yesCutting from a lane
Section titled “Cutting from a lane”A workspace whose ci.green declares lanes tags a commit ci/green-<lane>/<sha> once that lane’s phases pass, without waiting for the rest. --lane <name> cuts from that tag (#4692): the commit must carry ci/green-<lane>/<sha> that counts and no ci/revoked-<lane>/<sha>, and ci/green/<sha> is not needed. A member that is always released from one lane sets it in its config, and --lane on the command line wins over it:
export default { environments: ["staging", "prod"], release: { lane: "server" },};git fetch origin --tagschant release cut v2.3.0 --at "$(chant ci last-green --lane server)" --lane server --yesThe lane must be one the declaration at base declares under ci.green.lanes, and with signed tags the tag’s statement must name that lane. The cut line records lane, and the dry run and --json print it, as does release list. Without a lane, nothing changes.
A release cut from a lane is revoked as any other is, by a ci/revoked/<sha> tag on its commit. A ci/revoked-<lane>/<sha> tag made after the cut does not revoke it yet: it refuses the next cut of that commit in that lane.
Cutting a commit that is not green
Section titled “Cutting a commit that is not green”Sometimes a release has to go out from a commit that is not green: a red phase that is known to be unrelated, or CI that is down. --override-green cuts such a commit under a person’s override (#4693). The override is the one the override gate records for a denied plan, on _gates/policy-override.jsonl on chant/lifecycle, so the same people may write it, it needs a reason, and it is spent once used. It takes three steps:
# 1. The cut is refused, and records the request for an override of release-3f2a9c1e0b7d.chant release cut v1.4.1 --at 3f2a9c1e0b7d --override-green --yes# 2. A person the overriders file lists overrides it, with the reason.git fetch origin chant/lifecycle:chant/lifecyclechant approve policy-override release-3f2a9c1e0b7d --rule ci-green --reason "windows runners are down; server phases passed" --actor github:alice# 3. The same cut, now under the override.chant release cut v1.4.1 --at 3f2a9c1e0b7d --override-green --yesThe subject is release-<sha12>, the plan the commit’s full sha, and the rule ci-green, or ci-green-<lane> for a cut from a lane. The refusal prints the exact chant approve line. An override counts when:
- a person wrote it: a line an agent, an MCP or ACP session, a job (
via) or a forge review wrote does not count; .chant/overridersat base lists that person, one principal per line, and without the file nobody may override;- it gives a reason;
- under a
releasegate inidentity.gates, it is sealed (chant approve ... --sign) by a key the signers file at base lists for that person; - no earlier cut spent it.
The cut that counts it writes the applied record to _gates/policy-override/applied.jsonl before its cut line, so one override lets one cut through. Another label, or the same commit cut again, needs its own. The cut line records the override, and says the commit was not green:
"override": { "green": false, "tag": "ci/green/3f2a9c1e0b7d...", "by": "github:alice", "at": "2026-11-01T09:12:00.000Z", "reason": "windows runners are down; server phases passed", "digest": "sha256:...", "sealed": false }Only a cut with --yes records the request, and it pushes chant/lifecycle so the person who answers it can fetch it. A dry run with --override-green decides the same way and writes nothing: it prints the override it would spend, or refuses with the command to run. The request stands for 48 hours. An override written after it lapses still counts for the same commit. --reason on the cut is refused, since the reason is the overrider’s. A commit with a revoked tag is never cut, with or without an override. Without --override-green a standing override is not used.
The dry run prints not green: no ci/green tag where it would print green, and the override it would spend. release list marks such a release not green, and prints who overrode it and why on stderr. The releases document carries override on the cut. The request, the override and its applied record are ordinary override gate lines, so chant approve and the gate audit reader (lifecycle/gate-audit.ts) read them as they read any override.
The green gate
Section titled “The green gate”What says a commit may be released is release.green in the member’s chant.config.ts:
release: { green: "forge-checks", publish: [{ type: "npm", packages: ["."] }],},| Value | The commit may be released when |
|---|---|
chant | It carries a ci/green/<sha> tag that counts and no ci/revoked/<sha> tag, as chant ci writes them from ci.green. The default when chant.workspace.json declares ci.green, or when the repository holds any ci/green/ tag. |
forge-checks | Its checks on the forge passed. The default otherwise. |
none | Always. The cut prints a warning and records that it had no gate. |
Under forge-checks the cut asks the forge the CI job runs on, or, outside CI, the one the origin remote names, with the token from CHANT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN on GitHub, CHANT_FORGEJO_TOKEN, FORGEJO_TOKEN, GH_TOKEN or GITHUB_TOKEN on Forgejo, and CHANT_GITLAB_TOKEN, GITLAB_TOKEN or CI_JOB_TOKEN on GitLab. On a workstation, GH_TOKEN=$(gh auth token) chant release cut 1.4.0 is enough for GitHub. What counts as a check:
| Forge | Checks | Required |
|---|---|---|
| GitHub | Every check run and commit status on the commit, by name. A check with several runs (a rerun, or a merge_group run and a later push run) is judged by its newest run per name and app, and a status by its newest per context. A run that passed, was skipped or was neutral counts as passed. | The checks a branch rule (ruleset) of trunk requires. A required check that is not reported refuses the cut. |
| Forgejo | Every commit status on the commit, the newest of each context. | The status contexts trunk’s branch protection requires, when the token can read it. |
| GitLab | The newest pipeline of each source (push, merge_request_event, schedule, …) on the commit. |
A check that failed or has not finished refuses the cut, and so does a commit with no check at all. The release workflow’s own runs are left out: on GitHub every run of the workflow file the cut runs in (GITHUB_WORKFLOW_REF), on Forgejo the cut’s own run, and on GitLab the pipelines started the way the cut’s was, from the web or the API. The token needs read access to checks and statuses (checks: read and statuses: read on GitHub), and on GitHub actions: read to list the workflow file’s runs, which a private repository refuses without it, so an earlier failed run’s checks would count against the commit. A dispatched release workflow grants its cut job all three. When the release workflow’s own run holds every check on the commit, the refusal says so and names how many it left out.
--wait-checks reads the commit’s checks again while any is still running, in the same loop as chant ci verdict --wait: every 30 seconds, looking past forge answers of 5xx or 429 and dropped connections with a backoff, and giving up at the eighth in a row. Once every check has finished the cut judges them as above. The wait lasts up to 60 minutes, or the minutes --timeout-minutes <n> gives; past that the cut refuses with release-commit-not-green and names the checks still running. The chant and none gates read nothing from the forge and cut the same with the flag. A pipeline’s merge cut passes it, so the cut on the merge commit waits for the other push workflows on that commit.
chant release cut auto --yes --wait-checks --timeout-minutes 30--own-run-jobs <name,...> counts the named jobs of the cut’s own run beside the checks of the other workflows. Each named job the forge reports must have passed, and with --wait-checks the cut waits for one still running. The rest of the run, such as the cut’s own job and the jobs queued behind it, stays out of the judgement. When the forge reports none of the named jobs, the cut refuses with release-commit-not-green. A job is matched by the name the forge reports for it:
| Forge | Name |
|---|---|
| GitHub | The check run’s name, which is the job’s name: or else its id. |
| Forgejo | The job in the status context <workflow> / <job> (<event>). |
| GitLab | The job’s name in the cut’s pipeline. |
A pipeline’s merge cut passes the jobs its wave depended on, so a merge commit that only the pipeline’s own run checks is judged by the jobs that ran before the apply. The chant and none gates read nothing from the forge and cut the same with the flag.
chant release cut auto --yes --wait-checks --own-run-jobs check,wave-1-devnone is refused with release-green-none-refused when the declaration at base turns on the supply-chain or verified-releases security group, or names a release gate in identity.gates: those ask for releases a green gate passed.
The cut line records the gate the commit passed as green: { "source": "chant", "tag": "ci/green/<sha>" }, { "source": "forge-checks", "forge": "github", "checks": ["build", "test"] } (with "ownRun": ["check", "wave-1-dev"] for the jobs of the cut’s own run that counted), or { "source": "none" }. A cut under an override records the override instead. The dry run and the cut print it, release verify shows it for each cut, and the publish’s provenance statement carries it. --override-green works under forge-checks as under chant: the override’s tag is then forge-checks/<sha>.
The label in the build
Section titled “The label in the build”When the cut has a label, every compile and artifact build runs with CHANT_RELEASE_LABEL set to it. The version reaches the build without a commit that bumps it (#4168, decision 5). A build-time parameter reads it by declaring the variable:
export default { environments: ["staging", "prod"], buildParams: { version: { type: "string", env: "CHANT_RELEASE_LABEL", required: false } },};A build step’s own tool reads the variable directly. A Cargo crate takes it at compile time with option_env!("CHANT_RELEASE_LABEL"), which is None for a build outside a cut, or a build.rs passes it on with println!("cargo:rustc-env=APP_VERSION={}", std::env::var("CHANT_RELEASE_LABEL").unwrap_or_default()) and println!("cargo:rerun-if-env-changed=CHANT_RELEASE_LABEL"). An npm build reads process.env.CHANT_RELEASE_LABEL in its bundler config. A label in the caller’s shell is never passed through: only the cut sets the variable, and a cut with no label leaves it unset. A parameter that reads the label is recorded on each target like any other, so two labels of one commit are two releases.
The label as the package version
Section titled “The label as the package version”A package published by an npm target carries the version in its package.json, and a bundle that imports version from that file carries it too. Without release.version the label must already be that version, so a release needs a commit that bumps it first. release.version names the package directories whose package.json the release stamps with the label instead (#4840):
release: { version: { packages: ["packages/cli"] }, images: [/* ... */], publish: [{ type: "npm", packages: ["packages/cli"], pins: "dist/image-digests.json" }],},| Field | Meaning |
|---|---|
packages | Package directories relative to the member, "." for the member’s own. A path may leave the member with .. as long as it stays inside the repository, so a release member at release/core can stamp ../../packages/core; a path outside the repository is refused with release-version-invalid. Each package.json gets the label as its version. With the default ranges, no other field changes |
files | Other manifests the label goes into, such as Cargo.toml, pyproject.toml or Chart.yaml. See Other manifests. A member names packages, files or both |
lockfile | The lockfile whose entries for those packages follow, with the root entry and the top-level version for ".". Default package-lock.json when the member has one; false for none |
ranges | What happens to the ranges of workspace dependencies: keep (the default), exact, caret or train. See Workspace dependency ranges |
The cut stamps the files once it has found the tree clean, before it builds the images and before any compile or --build, and puts them back byte for byte when it is done, whether it cut or failed. Every image build, prepare and build then reads the label as the package’s version, so releaseImagePins accepts the label and the bundle carries it. A Dockerfile entry in release.images also gets the label as the build argument CHANT_RELEASE_LABEL. The publish job runs chant release stamp <label> before its images and its build, and chant release publish takes those files as the commit’s when each is exactly the commit’s file stamped with the release’s label. Any other change still makes the tree dirty. A label that is not a version npm takes (1.4.0, 1.4.0-rc.1, not v1.4.0) is refused with release-version-label-invalid, a cut with no label with release-version-no-label, and a directory with no package.json with release-version-no-package. RELEASE_VERSION_FLOOR in @intentius/chant/lifecycle/release-version is the first chant with the setting.
Workspace dependency ranges
Section titled “Workspace dependency ranges”A package that depends on another package of the same workspace carries a range for it, and that range names a version the release may not publish. ranges rewrites it to the label the release gives that package. It applies to dependencies, peerDependencies and optionalDependencies in each stamped package.json and in the lockfile’s entry for it; devDependencies and a range of * stay as committed, and so does a dependency on a package the release has no label for.
ranges | A dependency on a package the release stamps becomes | A dependency on another member’s package |
|---|---|---|
keep | its committed range | its committed range |
exact | the label, 1.4.0 | its committed range |
caret | ^1.4.0 | its committed range |
train | ^1.4.0 | ^ and the label the release train pins for the member that owns the package |
release: { version: { packages: ["packages/conformance", "packages/reference"], ranges: "exact" } },With two packages released in lockstep, reference then publishes depending on exactly the conformance published beside it. With train, members release at their own labels and each package’s ranges name the labels of the train it ships in. The cut runs before any train is recorded, so it stamps only the packages of its own release, and the pack step stamps the rest from the train:
chant release stamp 0.125.3 --train train-2f6c # in the member's directorychant workspace train prepare stamps every member a train cut from the commit this way at once. --train takes a train’s id or digest, found in the environments the member’s chant.config.ts declares and the one its workspace root’s release.train names. A member owns the packages its release.version.packages names; a member with no release.version owns none, so dependencies on it keep their ranges. chant release publish takes a tree stamped from a train that pins the release’s label as the commit’s. A package of a member the train pins with no label is refused with release-ranges-unpinned, a train that pins none of the member’s packages at the release’s label with release-train-not-pinned, an unknown train with release-train-unknown, and --train under any other ranges with release-ranges-not-train.
Other manifests
Section titled “Other manifests”files stamps the label into manifests that are not package.json, so a Rust crate, a Python package, a Helm chart or a plugin listing needs no version commit either:
release: { version: { files: [ "Cargo.toml", "Cargo.lock", { path: "charts/acme/Chart.yaml", appVersion: true }, "server.json", { path: "krew/acme.yaml", format: "krew" }, { path: "artifacthub-pkg.yml" }, { path: "internal/version/version.go", pattern: 'Version = "v([^"]+)"' }, ], },},Each file is edited in place. chant finds the version’s text and replaces it, so comments, key order, quoting and blank lines stay as committed, and the stamped file differs from the commit’s in the version alone. An entry is a path whose file name gives its format, or an object with path and one of format, field or pattern:
| Format | Found by name | What takes the label |
|---|---|---|
cargo | Cargo.toml | [package] version and [workspace.package] version, and the version of each path dependency whose path is inside the member, in dependencies, dev-dependencies, build-dependencies, workspace.dependencies and target.* tables. The operator stays: =0.1.0 becomes =1.4.0. A crate with version.workspace = true is left; name the workspace’s Cargo.toml |
cargo-lock | Cargo.lock | The version of each crate of the Cargo workspace, an entry with no source. crates: ["acme-cli"] names the crates instead |
pyproject | pyproject.toml | [project] version and [tool.poetry] version |
helm | Chart.yaml | version, and appVersion with appVersion: true |
mcp-server | server.json | version and the version of each entry in packages that has one |
krew | (name it) | spec.version, written v1.4.0 as krew wants, and the committed version wherever it appears in each platform’s uri. sha256 is left |
artifacthub | artifacthub-pkg.yml, artifacthub-pkg.yaml | version, and appVersion with appVersion: true |
For anything else:
| Entry | What takes the label |
|---|---|
{ path, field: "spec.version" } | Each string at that dotted path in a .json, .yaml, .yml or .toml file. [] reaches every item of a list: packages[].version |
{ path, pattern: 'Version = "v([^"]+)"' } | Each capture group of every match of a JavaScript regular expression, read with the m flag so ^ and $ match at each line |
field and pattern take a prefix, such as v, written before the label. A field of YAML is found in block style; a version inside a flow collection ({ version: 1.0.0 }) is reached with a pattern.
chant release stamp stamps these files with the package files, and chant release publish takes each as the commit’s when it is exactly the commit’s file stamped with the release’s label. A file that does not exist is refused with release-version-no-file, a file name chant can’t read a format from with release-version-format-unknown, a file with no version where its format looks (a pattern that matches nothing, a pyproject.toml whose version is dynamic) with release-version-no-field, and a file named twice, a pattern with no capture group or a field that is not a string with release-version-invalid. A Cargo path dependency outside the member keeps its requirement, since a member released at its own label stamps its own versions, and a Chart.yaml’s dependencies keep theirs.
Files that embed the version
Section titled “Files that embed the version”A project on release.version follows one rule: the committed tree never holds the version being released. Only the release’s build writes that version, from the stamped files or from CHANT_RELEASE_LABEL. In practice:
- The version in each stamped file stays where it is on the default branch and no longer moves. chant’s own packages do the same: their versions are older than the releases on npm.
- A committed file rendered from the package version, such as a golden, an example pipeline or a generated Dockerfile, is rendered from that committed version. It no longer changes when a release is made, so no release needs a commit to regenerate it.
- A Dockerfile reads the version from a build argument, never from text rendered into it:
ARG CHANT_RELEASE_LABELwithLABEL org.opencontainers.image.version="${CHANT_RELEASE_LABEL}", and the same argument for a file name that carries the version, such as the tarballnpm packwrites. A command entry passes--build-arg CHANT_RELEASE_LABEL="$CHANT_RELEASE_LABEL"itself, and a Dockerfile entry gets the argument from chant. A build outside a release passes the committed version. - A committed file that must name a published release, such as an example that runs the newest image, pins that release as it would pin a dependency, in a change of its own, not as part of a release.
The version-bump script and its recipe can then go, and a release is one dispatched run with the new label.
What the dry run prints
Section titled “What the dry run prints”Dry run: cut v1.4.0 from commit 3f2a9c1d0b7e (on origin/main, green) actor alice@example.com (from git user.email) run minted on this machine at the cut (local) not signed tag release/v1.4.0, made here and not pushed dev: 1 template(s) prod: 1 template(s) api: artifacts built in dev digest decided when the artifacts are builtWhat will be published where: api: publish-image to $env.registry in dev, prod, by that environment's deploy (chant components promote --release v1.4.0) chant release publish v1.4.0: npm (2 packages) to npm the registry npm's config names a publish from here would carry no OIDC provenance: this run is not in CI, and a workstation has no OIDC tokenThe digest is printed when no artifact needs building, since it is then known without a build. --json prints the same as a document with dryRun: true: the commit, label, releaseDigest (or null), alreadyCut, targets, build, reused, handed, publishSteps, signatureRequired, actor and actorSource, run, trunk, sign, tag, publish and next.
What —yes records
Section titled “What —yes records”With --yes the cut builds the artifacts and stores the release. It then appends the cut line, signed when --sign is given. The line names who cut and the run it ran in:
| Field | On a workstation | In CI |
|---|---|---|
actor | --actor, else the principal the signers file at base lists for the --sign key, else git’s user.email, else USER | --actor, else the signer, else GITHUB_ACTOR or GITLAB_USER_LOGIN |
runId | local-<epoch ms>, minted from the cut’s time | GITHUB_RUN_ID or CI_PIPELINE_ID |
runOrigin | { "forge": "local" } | github or gitlab, with the repository and a link to the run |
The line also records the green gate the commit passed, as green. A signed cut signs that record too, and its line carries sealVersion: 2 (see Who may cut).
Everything else in the line, and the whole release, is the same wherever the cut runs. A cut of one commit on a workstation and in CI stores byte-identical release files, and cut lines that differ only in runId, runOrigin, actor and timestamp, and in signature when two keys signed.
The cut then tags the commit with the release’s tag, release/<label> (or release/<member>/<label> in a workspace member) unless release.tag names another, as an annotated tag whose message names the release digest. The tag is made in this clone only. chant pushes chant/lifecycle when there is a remote and never pushes the tag, so pushing it is a step you take, and a CI workflow can publish on it. A release cut without a label gets no tag.
The record is pushed before the tag is made (#4965). A push the remote refuses is tried again, up to three pushes, after a fetch and a replay onto the remote’s tip when another writer pushed first. When none lands, the cut makes no tag and exits 1 with release-record-not-pushed, naming what git said. The release workflow pushes the tag only after the cut succeeds, so a tag never names a release the publish job can’t find, and the label is not spent: run the cut, or the workflow, again. RELEASE_CUT_RECORD_FLOOR is the first chant that does this; before it, the cut printed a warning and tagged. Cutting a release that is already cut is a no-op, and makes the tag if it is missing.
The last lines name the next command. In CI that is chant release publish <label>. On a workstation it is git push origin <tag>, so that CI publishes. After that it names the publish command and the deploy of the first environment as other choices.
The release’s tag
Section titled “The release’s tag”release.tag in the member’s chant.config.ts names the tag a cut makes, as a template (#5150):
release: { tag: "v{version}", // v1.4.0 // tag: "cli-v{version}", // a prefix of the member's own // tag: "{path}/v{version}", // a Go module in a subdirectory: tools/v1.4.0 // tag: { name: "v{version}", floating: "v{major}" }, // and v1, moved at each release},| Placeholder | Value |
|---|---|
{version} | The label, with one leading v dropped when a digit follows it: v{version} gives v1.4.0 for the label 1.4.0 and for v1.4.0 |
{label} | The label as given |
{member} | The workspace member’s ledger name, outer names first and joined by /, such as npm/core |
{path} | The member’s directory from the repository root |
{major} | In floating only: the major version of a MAJOR.MINOR.PATCH label |
A template names {version} or {label} once, and holds letters, digits and . _ + - / around its placeholders. A member that sets no release.tag gets release/<label>, or release/<member>/<label> in a workspace member, as it always has, so an existing release workflow, script or trusted publisher that reads those tags is unchanged. Setting release.tag: "release/{label}" names the same tag in a project with no members.
The cut refuses a template another chant member of the workspace could render to the same tag (release-tag-collision), reading each member’s own chant.config.ts. v{version} in two members collides, and so do v{version} and v{version}-cli; {member}-v{version}, {path}/v{version}, or a prefix per member keeps them apart. A member that sets no release.tag never collides with another that sets none, since its tag holds its name.
The ledger names a release by its record, not by its tag. A tag is the template’s rendering of the label, and chant reads a release back from its tag by rendering the template for each label the member’s ledger holds, with release tag. Changing release.tag changes the tags of later cuts; a release cut before keeps the tag it got, and release tag and the publish job then render the new template for it.
floating names a tag that release publish moves to the release’s commit, here and on origin, once every target has revealed: v1 for an action or a Go major version that consumers pin. The cut never makes it. It moves only for a MAJOR.MINOR.PATCH label cut with no --channel, never for a prerelease label such as 1.5.0-rc.1 (the publish says it left the tag where it was), and only when no cut of the member has a later version of the same major, so a fix to 1.3 after 1.4 leaves v1 on 1.4. A publish that can’t move or push it publishes anyway, and warns with the commands to run.
What the cut compiles
Section titled “What the cut compiles”The environments are the entries of the member’s environments array, in order. A pattern entry such as pr-* is not compiled. Each environment is compiled in a child process with CHANT_ENV set to it, since a template is synthesized for one environment per process. In each one the cut:
- runs
--build <command>in the member’s directory, when given, withCHANT_ENVset; - resolves the build parameters the way
chant build --env <env>does, with{env}in a--params-filepath replaced by the environment’s name; - discovers the components enabled under those parameters;
- reads each template their deploys name.
A template is a file named by a literal path in a deploy step’s template, manifest or values field, such as cfn-deploy’s template: "dist/api.template.json". A path with the archive: prefix names the file after the prefix. Build and publish steps are not read. A template that does not exist after the build stops the cut.
Since #4155 the cut also records the other local paths a deploy step names, from the fields Plan previews lists: a helm-upgrade chart, a kustomize-apply directory, an s3-sync source. A directory is recorded file by file. Each file is a template at its path under the directory, and the target names the directory in trees. A directory git ignores, such as a build’s dist, is recorded whole, since the release is what the build wrote. A file that is not UTF-8, such as a packaged subchart, is recorded as base64 with encoding: "base64". A chart named from a repository is not a local path. Such a path is not recorded and does not stop the cut.
A promote under the release points each recorded path at its copy. A directory is written under .chant/release-templates/<digest>/<name>/, where the digest is taken over its files. The deploy reads the tree the cut recorded and not the checkout’s. A target cut before #4155 has no trees, and a promote of it reads charts and the other directories from the checkout, as it did.
A step that names its files through a key gets them from its capability (#4542). A terraform-apply step names its root by key, and the terraform lexicon answers with the files a pull request’s plan counts as the root’s change. Those are the root’s directory and each local module it reaches through a ./ or ../ source. Its var files and backend-config files are recorded with them. The cut records each of them for the component, directories in trees. A root whose state is a file in its own directory (the local backend) is left out, and the cut prints why, since a plan of a copy would read no state; such a root rolls back with chant lifecycle rollback --to. A path outside the member’s directory leaves its step out the same way. The dry run lists each recorded directory under its environment, and release list --json shows them in each target’s trees.
Under the release, a promote or rollback writes every file the target records for the component under .chant/release-templates/<digest>/, each at its path from the member’s directory, so a root’s ../modules/vpc still resolves. The step’s dir is set to the copy of the root. terraform-apply plans that copy against the environment’s state, keeping the rest of the root’s entry in terraform.roots. The release gate binds that plan, so rolling a root back is a new plan of the old configuration under its own approval. With terraform.compose.enabled, a root deployed from a copy plans on its own and never in a composed group.
A pulumi-up step records the stack’s directory. When main points outside it, the program’s entry file is recorded too. A stack whose backend is a file:// path relative to its directory is left out. The cut records tracked files only, so a Node program’s copy has no node_modules. Before the copy’s first preview, pulumi-up runs pulumi install in the copy (plunge install on plunge). That installs the dependencies the recorded lockfile pins and the plugins the program uses. It does the same for a Python program whose virtualenv or poetry or uv toolchain needs building. A Node copy with no lockfile is refused by name, since an install there would take today’s versions rather than the release’s. Programs in the other runtimes fetch what they need on the run.
The artifacts are built once. Each component’s docker-build, zip-package and jvm-build steps run, and nothing else, in the first environment the component is enabled in. docker-build gives an image entry and the other two an asset entry, each with the archive path and the digest. When a component’s source did not change since the release cut from the nearest earlier commit, its entries are carried from that release and nothing is built. Unchanged means git sees no change between the two commits in the component’s file, the member’s chant.config.ts, and the paths the build steps read (context and the Dockerfile, source, path). A commit that only changes a flag or a parameter then gets a release of its own with the same artifact digests.
An image built elsewhere
Section titled “An image built elsewhere”Some images can’t be built where the cut runs, such as static binaries a CI job builds with a toolchain the cut’s machine lacks. The job that built and pushed the image hands it to the cut by digest with --image <component>=<repository>@sha256:<hex>, once per component (#4694):
digest=$(crane digest registry.fly.io/illogical-control:ci-$GITHUB_SHA)chant release cut v1.4.0 --image control=registry.fly.io/illogical-control@$digest --yesThe release records the image as the component’s image entry, with its reference in ref and an empty path, since no build step wrote an archive. The cut builds nothing for that component, and carries nothing for it from an earlier release. The reference must name the repository and the digest, and no tag, since a tag can move after the cut. A reference that does not is refused with release-image-invalid, and a component that is not enabled in any environment with release-image-unknown-component. The dry run lists each handed image, and --json lists them in handed.
A deploy under the release runs that image. The component’s composition says where it goes with a release-image step, which stands where a publish step would (Running a release):
export const control: Component = { name: "control", dependsOn: [], deploy: [ phase("Approve", [gate("prod-release")]), phase("Image", [{ kind: "release-image" }]), phase("Release", [{ kind: "fly-release", plan: "dist/fly.json", machine: "controlMachine", image: "@Image.uri", digest: "@Image.digest" }]), ],};fly-release’s image is the serving Machine’s, and its images names the plan’s other Machines, such as a scheduled one. A Machine built from the same image takes it the same way, images: { controlCron: "@Image.uri" }. A release records one image per component, so a Machine that runs another image belongs to the component that image is handed for, or takes it by a literal reference.
The ref is in the release digest, so a release that records one is read by chant 0.124.65 and newer. An older chant reads it as a release that does not match its digest.
Images the package pins
Section titled “Images the package pins”A package that pins container images by digest needs the digests when it is packed. release.images in chant.config.ts names images the cut builds before anything else (#4657):
release: { images: [ { name: "tofu", build: "docker buildx build --provenance=false --sbom=false --output type=oci,dest=dist/tofu.tar,rewrite-timestamp=true -f images/Dockerfile.tofu .", archive: "dist/tofu.tar" }, ], publish: [ { type: "oci", image: "dist/tofu.tar", repository: "ghcr.io/acme/tofu" }, { type: "npm", packages: ["packages/cli"], pins: "dist/image-digests.json" }, ],},Each build runs in the member’s directory with SOURCE_DATE_EPOCH set to the commit’s time and CHANT_RELEASE_LABEL to the label, and writes the OCI archive at archive, a layout directory or a tar file of one. The cut records the archive’s top manifest digest, which is the digest a registry serves once the oci target pushes it, as an image artifact named after the image. It writes { "<name>": "sha256:..." } to a file and runs --build with CHANT_RELEASE_DIGESTS naming that file, so the build that packs the package can copy the digests into it. A name that is also a component’s is refused (release-image-name-taken). The dry run builds the images too, since its compile runs the build command.
An entry may name a Dockerfile instead of a command, and chant runs the reproducible build itself (#4819):
images: [ { name: "pulumi", dockerfile: "images/plywood-pulumi/Dockerfile", prepare: "npm run build && npm pack -w @intentius/plywood --pack-destination images/pack" },],chant creates a docker-container buildx builder named chant-release when there is none. It runs docker buildx build --no-cache --provenance=false --sbom=false --build-arg SOURCE_DATE_EPOCH=... for every platform in platforms (default linux/amd64 and linux/arm64, one image index) and writes type=oci,dest=<archive>,rewrite-timestamp=true. context defaults to ., and archive to dist/images/<name>.tar. The Dockerfile and the context may leave the member with .., so a member at release/<name> can build the repository root’s Dockerfile (dockerfile: "../../Dockerfile", context: "../.."); the archive stays inside the member (release-image-archive-outside). prepare runs once, before any build and with CHANT_RELEASE_DIGESTS unset, so whatever the image copies in, such as a bundle or a packed package, is the same in the cut and the publish job. Building arm64 on amd64 needs QEMU’s binfmt handlers, which the jobs chant release workflow writes set up (see release workflow). A build entry may name platforms too: chant does not pass them to the command, and the workflow sets up QEMU from them (#4876). An entry with both build and dockerfile is refused (release-image-invalid). args gives more build arguments, { NAME: "value" }, passed as --build-arg NAME=value after the two chant passes, which it cannot set (#4908, RELEASE_IMAGE_ARGS_FLOOR). The config computes the values, such as the file npm pack writes into the context and the chant packages the lockfile holds, so a product whose image takes them needs no build script of its own. A value may hold {label}, the release’s label, and {version}, the label from its first digit, read from CHANT_RELEASE_LABEL and CHANT_RELEASE_VERSION when the image builds: args: { VERSION: "{version}" } puts the version in the image’s binary without release.version. labels sets OCI labels the same way, passed as --label, such as { "org.opencontainers.image.version": "{version}", "org.opencontainers.image.licenses": "MIT" } (RELEASE_IMAGE_LABELS_FLOOR).
When release.artifacts has a goreleaser entry, a Dockerfile entry that names no archive writes build/images/<name>.tar, since goreleaser empties its dist (--clean) when it builds the release’s files, after the images. An archive named inside a goreleaser entry’s dist is refused before the build (release-image-archive-in-dist).
Under the supply-chain security group, a Dockerfile entry whose FROM is not pinned by digest is refused before anything is built (release-image-base-unpinned), and chant release images refuses it the same way. See Pin image bases by digest.
The build that packs the package turns the digests into the table it bakes in with releaseImagePins from @intentius/chant/lifecycle/release-images. That module loads under plain Node, so a .mjs build script can import it. Pass each image’s name and its reference at this version, and the package’s version:
const table = releaseImagePins({ images: { pulumi: `ghcr.io/intentius/plywood-pulumi:${version}-pulumi3.272.0` }, version });// ... bundle with the table baked in ...writeReleaseImagePins(table, { out: "dist/image-digests.json", bundles: ["dist/plywood.mjs"] });Outside a release build the table is undefined and writeReleaseImagePins removes the pins file. A CHANT_RELEASE_LABEL that is not the version is refused (release-label-not-version). Under release.version the cut and the publish job have stamped the label into package.json by then, so a build that reads the version from that file passes it. A name the digests file has no digest for is refused too (release-image-digest-missing), and so is a bundle that does not carry every digest (release-pin-not-bundled). RELEASE_IMAGE_DOCKERFILE_FLOOR is the first chant with them.
The publish job checks out the release’s commit and runs chant release images <label> before the build that packs the package. It builds each image again, refuses one whose digest is not the recorded one (release-image-digest-mismatch), and writes the recorded digests to .chant/release-digests.json (or -o <file>), printing CHANT_RELEASE_DIGESTS=<file> for the job to export. The publish job chant release workflow writes passes -o a file in the runner’s temp directory ($RUNNER_TEMP on GitHub and Forgejo, /tmp on GitLab), so chant release publish finds the checkout as the cut left it, and a repository that commits files under .chant/ doesn’t need to ignore the digests. The oci target then refuses an archive that is not the recorded one, so the image pushed is the one the package pins. This needs a build that writes the same archive from the same commit: timestamps rewritten from SOURCE_DATE_EPOCH, no logs or caches in the layers, and no attestations built into the archive. #4657’s thread has the check against terragucci’s Dockerfiles.
An npm target’s pins names the file in the package that carries the digests. The publish plan refuses a package whose file holds a sha256: digest the release does not record as an image (publish-npm-pin-unknown), and a target none of whose packages has the file (publish-npm-pins-missing). chant release verify makes the same check on a package built in the checkout (release-pin-unknown).
The archives sit in the checkout when the publish runs: the cut or chant release images wrote them there, or the dispatched publish job took the cut’s into the same paths. A package directory that an archive the release records lies inside is listed with npm pack --dry-run --json --ignore-scripts at the plan, and one that would carry the archive is refused before any target publishes (publish-npm-carries-image, #4934). The message names the file, and the fix names the files entry that leaves it out, such as "!dist/images/app.tar" for a package whose files lists dist. NPM_CARRIES_IMAGE_FLOOR is the first chant with the check. The cut runs the same check once it has built the images, before it records the release or tags it, and refuses with the same code (#4941, RELEASE_CUT_CARRIES_IMAGE_FLOOR), so the label is not spent on a release the publish would refuse.
Files the release builds
Section titled “Files the release builds”release.artifacts lists files the cut builds once and records: binaries, archives of them, a checksums file, what goreleaser writes, a Helm chart, Linux packages, or files a job on another runner built before the cut. Each entry has a name and one of outputs (with or without build), goreleaser, helm, nfpm and checksums, and the cut builds them in order, after the images and before --build.
export default { release: { artifacts: [ { name: "tool", build: 'go build -trimpath -ldflags "-X main.version=$CHANT_RELEASE_LABEL" -o "dist/${CHANT_RELEASE_OS}_${CHANT_RELEASE_ARCH}/tool${CHANT_RELEASE_EXT}" ./cmd/tool', outputs: ["dist/{os}_{arch}/tool{ext}"], platforms: ["linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"], archive: { files: ["README.md", "LICENSE"] }, }, { name: "sums", checksums: "dist/SHA256SUMS" }, ], publish: [{ type: "forge", forge: "github", repo: "acme/tool", assets: ["artifact:tool", "artifact:sums"] }], },};A build entry runs its command in the member’s directory with SOURCE_DATE_EPOCH set to the commit’s time and CHANT_RELEASE_LABEL to the label. With platforms, it runs once per platform with CHANT_RELEASE_OS, CHANT_RELEASE_ARCH and CHANT_RELEASE_EXT (.exe on Windows, empty otherwise) set; the command passes them to its compiler, as GOOS=$CHANT_RELEASE_OS GOARCH=$CHANT_RELEASE_ARCH does for Go. outputs names the files it writes, relative to the member. An output may hold {os}, {arch}, {ext}, {label} and {version} (the label from its first digit), and * or ? within a path segment. An output the build did not write stops the cut (release-artifact-no-output), and so does a command that fails (release-artifact-build-failed).
An entry with outputs and no build records files something else built before the cut, such as a build job on another runner: the cut runs nothing for it and records the files at outputs as it finds them, per platform when the entry has platforms. builtBy names the release.workflow.builds jobs that write them, and outputs then defaults to those jobs’ outputs; an entry with platforms names its outputs itself. A builtBy that names no job of release.workflow.builds is refused (release-artifact-invalid), by the cut and by chant release workflow. A declared output that is not there stops the cut (release-artifact-not-built). Under --at the cut reads these files from the checkout it runs in, which must be at the commit it cuts (release-artifact-wrong-commit), and packs and checksums them in the commit’s worktree like any other entry’s.
release: { workflow: { trigger: "dispatch", builds: [ { name: "linux-arm64", runner: "ubuntu-24.04-arm", build: "GOOS=linux GOARCH=arm64 go build -trimpath -o dist/linux_arm64/tool .", outputs: ["dist/linux_arm64/tool"] }, { name: "darwin-arm64", runner: "macos-15", build: "GOOS=darwin GOARCH=arm64 go build -trimpath -o dist/darwin_arm64/tool .", outputs: ["dist/darwin_arm64/tool"] }, ], }, artifacts: [ { name: "tool", builtBy: ["linux-arm64", "darwin-arm64"], outputs: ["dist/{os}_{arch}/tool"], platforms: ["linux/arm64", "darwin/arm64"], archive: true }, { name: "sums", checksums: "dist/SHA256SUMS" }, ],},With archive, each platform’s outputs are packed, beside the files archive.files names, into one archive per platform, and the release records the archives in place of the outputs. An archive is a tar.gz, or a zip for a Windows platform, unless archive.format names one. It is written to archive.dir (default dist) as archive.name (default {name}_{os}_{arch}, or {name} with no platforms) plus the extension. chant writes the archives itself: every entry is dated SOURCE_DATE_EPOCH, owned by root, and mode 0755 when executable, else 0644, so the same files pack to the same bytes. archive: true takes every default.
A checksums entry writes a file of <sha256> <file name> lines, sorted by name, as sha256sum writes them and sha256sum -c checks them. It covers the files of the entries of names, or of every entry before it. Two covered files with one name are refused (release-artifact-checksums-name-taken).
A goreleaser entry runs goreleaser release --snapshot --clean --skip=publish in the member’s directory, with --config when goreleaser.config names one, so goreleaser builds and publishes nothing. The run is CHANT_GORELEASER when set, else goreleaser on the PATH. The config’s snapshot version must be the label chant passes, so the binaries carry the release’s version:
snapshot: version_template: "{{ .Env.CHANT_RELEASE_LABEL }}"chant reads metadata.json in goreleaser’s dist (goreleaser.dist, default dist) and refuses a version that is neither the label nor the label from its first digit (release-artifact-version-mismatch). It records the files artifacts.json lists whose type is in goreleaser.types: by default Archive, Checksum, File, Linux Package, SBOM, Source, and a Binary at the top of dist, which are the files goreleaser’s own release would upload. chant’s targets publish them. A goreleaser entry needs a label (release-artifact-no-label), and so does an output or archive name that holds {label} or {version}.
Helm charts and Linux packages
Section titled “Helm charts and Linux packages”A helm entry packs the chart in the directory helm.chart into <helm.dir>/<chart name>-<version>.tgz (helm.dir defaults to dist), laid out as helm package lays it out: the chart’s files under a directory named for the chart, less what its .helmignore names and helm’s own default, hidden files under templates/. The packed Chart.yaml has version set to the label from its first digit, and with helm.appVersion: true, appVersion set to the label; the rest of the file is as written. chant packs the archive itself, every entry dated SOURCE_DATE_EPOCH, so the same chart packs to the same bytes and the cut needs no helm. A chart’s dependencies are packed as they sit in its charts/ directory, so run helm dependency build before the cut when the chart has some. A directory with no Chart.yaml stops the cut (release-artifact-no-output), and so does a .helmignore line with **, which helm does not read either (release-artifact-invalid).
An nfpm entry runs nfpm once per packager and platform: nfpm package --config <config> --packager <packager> --target <file>. nfpm.config defaults to nfpm.yaml, nfpm.packagers to ["deb", "rpm"] (also apk, archlinux and ipk), and nfpm.dir to dist. Each run has CHANT_RELEASE_VERSION (the label from its first digit), CHANT_RELEASE_LABEL and SOURCE_DATE_EPOCH set, and with nfpm.platforms, CHANT_RELEASE_OS and CHANT_RELEASE_ARCH too, for the config to read. The config’s version must name one of the two, or the cut stops (release-artifact-version-mismatch):
name: toolarch: "${CHANT_RELEASE_ARCH}"version: "${CHANT_RELEASE_VERSION}"contents: - src: dist/linux_${CHANT_RELEASE_ARCH}/tool dst: /usr/bin/toolEach package’s file name is nfpm.fileName plus the packager’s extension; fileName may hold {name} (the entry’s), {version}, {label}, {os}, {arch} and {packager}, and defaults to {name}_{version}_{arch}, or {name}_{version} with no platforms. The files nfpm packs come from earlier entries, so declare the build first. The run is CHANT_NFPM when set, else nfpm on the PATH. A forge target attaches the packages with assets: ["artifact:<name>"]:
release: { artifacts: [ { name: "tool", build: 'GOOS=linux GOARCH=$CHANT_RELEASE_ARCH go build -trimpath -o "dist/linux_${CHANT_RELEASE_ARCH}/tool" .', outputs: ["dist/linux_{arch}/tool"], platforms: ["linux/amd64", "linux/arm64"] }, { name: "tool-pkg", nfpm: { platforms: ["linux/amd64", "linux/arm64"] } }, { name: "chart", helm: { chart: "deploy/chart", appVersion: true } }, ], publish: [ { type: "forge", forge: "github", repo: "acme/tool", assets: ["artifact:tool-pkg", "artifact:chart"] }, { type: "helm", charts: ["artifact:chart"], oci: { repository: "ghcr.io/acme/charts" } }, ],},A helm entry’s chart may leave the member with .., such as ../../charts/api from a member at release/api; the archive directory stays inside it (release-artifact-outside).
RELEASE_ARTIFACTS_PACKAGES_FLOOR is the first chant with helm and nfpm entries.
What the release records
Section titled “What the release records”Each file is recorded in the release as an asset artifact whose component is the entry’s name. Two entries, or two platforms, writing one path are refused (release-artifact-output-taken), and so is a name that an image or a component also has (release-artifact-name-taken). A forge, homebrew or index target names an entry’s files with artifact:<name> in its assets; a name the release records no file for is refused at the publish (publish-artifact-not-recorded). Every target that reads a recorded file refuses one whose digest differs (publish-artifact-digest-mismatch), and the signing, provenance and SBOM checks of the security groups apply to these files as to any other. RELEASE_ARTIFACTS_FLOOR is the first chant with release.artifacts.
The files sit in the checkout when the publish runs, so their directory belongs in .gitignore: the publish refuses an untracked file (release-worktree-dirty). The publish job of a dispatched release gets them from the cut job (see release artifacts), and on a release tag it builds them again with chant release artifacts <label>, which needs builds that write the same bytes twice, such as go build -trimpath and archives dated from SOURCE_DATE_EPOCH. An entry with no build is not built again there: the files must be in the checkout by then, written by the workflow’s build step.
A project with no components
Section titled “A project with no components”A project with no *.component.ts file is cut from what chant build writes (#4046). For each environment the child process builds the project as chant build <src> --env <env> -o <output> would, with the environment’s build parameters, and every file that build writes becomes a template with component: null. The target’s params are the build’s resolved parameters, and artifactDigests is empty.
| Flag | Meaning |
|---|---|
--src <dir> | The build root, relative to the member’s directory. Defaults to chant.config.ts sourceDir, then the member’s directory, as chant lifecycle resolves it. A project that declares stacks must name one. |
-o <file> | The build’s output file, relative to the member’s directory. Defaults to dist/build.yaml. As with chant build -o, a .yaml or .yml name writes YAML and any other name JSON, a lexicon whose output is YAML (k8s, helm) writes YAML whatever the name, and the extra files a lexicon emits are written beside it. |
--lexicon <name> | Build only this lexicon. |
An Op’s IR is written under the build root, so a project with sourceDir: "src" and an Op records src/dist/ops/<op>/op.json as well. The files are kept in memory and nothing is written to the checkout, so a file an earlier build left there is never recorded.
A build is deterministic. Two cuts of one commit record the same bytes for each environment and get one digest, whichever clone or directory they run in.
A release with no environments
Section titled “A release with no environments”A project that only publishes packages, binaries or images needs no chant sources and no environments. Its chant.config.ts names what the release publishes, and nothing else:
export default { release: { version: { packages: ["."] }, publish: [{ type: "npm", packages: ["."] }], },};chant release init writes such a block from what it finds in the project.
With no environments, the cut compiles nothing. It records the release as the commit, the artifacts the cut built or was handed (release.images, release.artifacts, --image), and publishes: each release.publish target’s key, type and destination, in the declared order. targets is empty. The release digest covers publishes, so a release with them is read by chant RELEASE_PUBLISHES_FLOOR and newer. A --build command runs once the gate has passed and the images are built, with CHANT_RELEASE_LABEL set, and a build that fails cuts nothing. No sourceDir and no chant.workspace.json are needed; without ci.green, the green gate is the forge’s checks.
The publish is the same as for any release. Each target checks the files it uploads against the artifacts the release records at their paths, and the signature, provenance and SBOM checks of the security groups apply unchanged, see release publish.
The release digest and the label
Section titled “The release digest and the label”The release is stored on chant/lifecycle under its digest, and a cut is a line appended to the cut log:
| Path | Holds |
|---|---|
_releases/<releaseDigest>.json | The release, written once and never rewritten. : is written as _. |
_releases/cuts.jsonl | One line per cut: { version, releaseDigest, label, actor, timestamp, runId, runOrigin, signature }. |
_releases/templates/<digest>.txt | Each template’s bytes, by content digest, for a promote to deploy. |
_releases/templates/<digest>.b64 | The base64 of a template that is not UTF-8, by the digest of its bytes. |
A workspace member’s copies sit under _members/<member>/. The cut writes the local branch and pushes it when there is a remote.
releaseDigest is computePlanDigest("release", subject). The subject is what deploys:
| In the digest | Outside it |
|---|---|
member, commit and artifactDigests | each parameter’s source |
each target’s env, templates (with each one’s encoding) and trees | the cut line’s label, actor, timestamp, runId, runOrigin and signature |
each parameter’s name and value | the chant version |
So two cuts of one commit give the same digest.
The label is a human name such as v1.4.0. It starts with a letter or digit, and after that it may also hold ., _, + and -. Within a member, a label names one digest and a digest takes at most one label. Cutting the same digest again is a no-op that prints its label. Cutting it under another label is refused with release-already-labelled, and a label that already names another digest is refused with release-label-taken. A digest cut without a label can be given one by a later cut. signature holds the cut’s signature, or null for an unsigned cut. runId and runOrigin name the run, as What —yes records lists. A cut line written before 0.124.29 has no runId, which reads as null, and its runOrigin is null outside CI.
Who may cut
Section titled “Who may cut”Who may cut a release is an identity.gates entry for a gate named release (#4031), read from the declaration at base like every identity gate:
"identity": { "gates": { "release": { "class": "releaser" } }}With the entry, a cut must be signed with --sign, by a key .chant/allowed_signers at base lists for the actor. With class, the role grants in .chant/trust.json at base must also put the actor in that class. A class no pinned package supplies lets nothing through. Without the entry anyone may cut, and a signature is optional. A cut from a change that adds chant.workspace.json, whose base has none, is judged without the entry that change adds, and prints a warning with the code identity-gates-not-at-base saying the entry takes effect after the change merges.
--sign <key file> signs with that ssh key, and --sign alone uses git’s user.signingkey when gpg.format is ssh, as chant approve --sign does for a signed gate. When --actor is not given, the actor is the principal the signers file at base lists for that key, if it lists exactly one. --actor names the signer otherwise, as in the cut below.
chant release cut v1.4.0 --actor github:alice --sign ~/.ssh/id_ed25519 --yesUnder the gate the dry run reads the key’s public half and refuses with release-signer-refused when the signers file at base lists it for someone other than the actor. A key whose public half can’t be read without its passphrase is checked when it signs.
The signature is ssh-keygen -Y sign in the chant-release namespace over six lines. The first four hold the release digest and the label (empty for none), then the actor and the cut’s time. The fifth is seal:2, and the sixth is gate: followed by the cut line’s green-gate record: its green, override and lane, those it has, as JSON with sorted keys ({} when it has none). Changing any of them in the cut line stops it verifying, so the gate a signed cut claims is the gate it passed. The release digest leaves the gate out, so two cuts of one commit still share a digest, and each cut’s gate is under its own signature. The cut checks the signature and the class before it stores anything.
A cut signed by chant before RELEASE_GATE_SEAL_FLOOR signed only the first four lines, and its line has no sealVersion. Its signature still verifies, and readers report its gate as unsigned: the gate record could have been changed after it was signed. Removing sealVersion from a newer cut’s line does not turn it into an older one, since its signature is over the six lines and no longer verifies.
release list and workspace status check each cut’s signature again on every read, against the signers file and the role grants at base. A key removed from the signers file makes the cuts it signed read as unverified from then on.
| Flag | Meaning |
|---|---|
<label> or --label <label> | The release’s label, such as a version. Optional; a release with no label gets no tag. |
--yes | Cut. Without it the command is a dry run. |
--dry-run | A dry run, as without --yes. With --yes too, the run stays a dry run. |
--build <command> | A shell command run in the member’s directory before each environment’s templates are read, with CHANT_ENV set to the environment. |
--param <name=value> | A build parameter for every environment. Repeatable. |
--params-file <file> | A JSON file of build parameters. {env} in the path is replaced by each environment’s name, as in params.{env}.json. |
--image <component>=<repository>@sha256:<hex> | An image built elsewhere, handed to the cut by digest: the release records it for the component, and the cut builds nothing for it. Repeatable, one per component. See An image built elsewhere. |
--actor <name> | Who made the cut. Defaults to the signer of --sign’s key, then GITHUB_ACTOR or GITLAB_USER_LOGIN, then git’s user.email, then USER. |
--sign [<key file>] | Sign the cut with an ssh key, or with git’s user.signingkey when no file is given. See Who may cut. |
--json | With --yes, print the release, its label, the cut line written (null when the release was already cut), whether the release file was written now, the components whose artifacts were carried from an earlier release, and the images handed to the cut (handed), with dryRun: false, actor, actorSource, tag ({ name, created }, or null) and next. Without --yes, print the dry run’s document. |
Cutting on green
Section titled “Cutting on green”A project that wants a release for every green commit runs the cut in its own pipeline, after the tick. Cutting a digest that is already cut does nothing, so the step can run on every tick:
git fetch origin --tagsgit checkout "$(chant ci last-green)"chant release cut --build "npm run build" --yesThe checkout must have origin/<trunk> for the trunk check, so fetch the branch with the tags (fetch-depth: 0 with actions/checkout). The step needs only git, the tags and the member’s build, so it runs on any runner, including one whose tick reads chant runs. Under a release gate in identity.gates the cut must be signed by a signer in the gate’s class. The job then needs that signer’s key, so the declaration decides whether CI may cut.
Revoked releases
Section titled “Revoked releases”A release is revoked when the commit it was cut from gets a ci/revoked/<sha> tag that counts, after the cut (#4033). Nothing is written when that happens: every reader joins the release’s commit to the local tags, judged as the cut judges them, so with signed tags a revoked tag without a valid statement revokes nothing. Fetch the tags before reading.
| Command | With a revoked release |
|---|---|
release list | Marks it, see release list. |
chant components promote --release | Refuses it with release-revoked before anything runs. |
chant approve on its release gate | Refuses with release-revoked, so a gate pending for it never passes. chant approve release <gate> --expire clears the pending fact. |
chant workspace status | Flags each component of an environment that runs it, with the chant components rollback line, and reads its pending gate as superseded. |