@intentius/chant 0.124.100 → 0.124.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/action-pins.d.ts +2 -0
  2. package/dist/action-pins.js +3 -0
  3. package/dist/ci-detect.d.ts +13 -0
  4. package/dist/ci-detect.js +12 -0
  5. package/dist/ci-evidence-claims.d.ts +12 -0
  6. package/dist/ci-evidence-claims.js +12 -0
  7. package/dist/ci-system.d.ts +66 -0
  8. package/dist/ci-system.js +61 -0
  9. package/dist/cli/handlers/build.js +27 -0
  10. package/dist/cli/handlers/release-doctor.d.ts +12 -0
  11. package/dist/cli/handlers/release-doctor.js +118 -0
  12. package/dist/cli/handlers/release-init.d.ts +10 -0
  13. package/dist/cli/handlers/release-init.js +374 -0
  14. package/dist/cli/handlers/release.d.ts +43 -2
  15. package/dist/cli/handlers/release.js +667 -39
  16. package/dist/cli/handlers/run-generate.js +11 -0
  17. package/dist/cli/main.d.ts +2 -0
  18. package/dist/cli/main.js +44 -101
  19. package/dist/cli/parse-args.js +48 -0
  20. package/dist/cli/registry.d.ts +16 -0
  21. package/dist/cli/release-commands/artifacts.d.ts +3 -0
  22. package/dist/cli/release-commands/artifacts.js +14 -0
  23. package/dist/cli/release-commands/candidates.d.ts +3 -0
  24. package/dist/cli/release-commands/candidates.js +16 -0
  25. package/dist/cli/release-commands/changed.d.ts +3 -0
  26. package/dist/cli/release-commands/changed.js +14 -0
  27. package/dist/cli/release-commands/compose.d.ts +3 -0
  28. package/dist/cli/release-commands/compose.js +16 -0
  29. package/dist/cli/release-commands/cut.d.ts +3 -0
  30. package/dist/cli/release-commands/cut.js +50 -0
  31. package/dist/cli/release-commands/doctor.d.ts +3 -0
  32. package/dist/cli/release-commands/doctor.js +14 -0
  33. package/dist/cli/release-commands/export.d.ts +3 -0
  34. package/dist/cli/release-commands/export.js +12 -0
  35. package/dist/cli/release-commands/images.d.ts +3 -0
  36. package/dist/cli/release-commands/images.js +13 -0
  37. package/dist/cli/release-commands/index.d.ts +8 -0
  38. package/dist/cli/release-commands/index.js +52 -0
  39. package/dist/cli/release-commands/init.d.ts +3 -0
  40. package/dist/cli/release-commands/init.js +19 -0
  41. package/dist/cli/release-commands/list.d.ts +3 -0
  42. package/dist/cli/release-commands/list.js +10 -0
  43. package/dist/cli/release-commands/next.d.ts +3 -0
  44. package/dist/cli/release-commands/next.js +13 -0
  45. package/dist/cli/release-commands/publish.d.ts +3 -0
  46. package/dist/cli/release-commands/publish.js +22 -0
  47. package/dist/cli/release-commands/stamp.d.ts +3 -0
  48. package/dist/cli/release-commands/stamp.js +15 -0
  49. package/dist/cli/release-commands/status.d.ts +3 -0
  50. package/dist/cli/release-commands/status.js +17 -0
  51. package/dist/cli/release-commands/tag.d.ts +3 -0
  52. package/dist/cli/release-commands/tag.js +12 -0
  53. package/dist/cli/release-commands/types.d.ts +20 -0
  54. package/dist/cli/release-commands/types.js +1 -0
  55. package/dist/cli/release-commands/verify.d.ts +3 -0
  56. package/dist/cli/release-commands/verify.js +15 -0
  57. package/dist/cli/release-commands/workflow.d.ts +3 -0
  58. package/dist/cli/release-commands/workflow.js +15 -0
  59. package/dist/cloud-lister/index.d.ts +4 -1
  60. package/dist/cloud-lister/index.js +2 -1
  61. package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
  62. package/dist/cloud-lister/kubernetes-components.js +642 -0
  63. package/dist/cloud-lister/kubernetes.d.ts +18 -0
  64. package/dist/cloud-lister/kubernetes.js +26 -1
  65. package/dist/cloud-lister/mask.d.ts +5 -1
  66. package/dist/cloud-lister/mask.js +14 -5
  67. package/dist/components/cli-support.d.ts +1 -1
  68. package/dist/components/cli-support.js +1 -1
  69. package/dist/config-environments.d.ts +8 -1
  70. package/dist/config-environments.js +2 -0
  71. package/dist/config-import.d.ts +1 -1
  72. package/dist/config-import.js +6 -2
  73. package/dist/config-sandbox.d.ts +1 -1
  74. package/dist/config-sandbox.js +3 -3
  75. package/dist/config.d.ts +369 -10
  76. package/dist/config.js +127 -7
  77. package/dist/deep-observation.js +9 -3
  78. package/dist/floor-table.data.js +21 -1
  79. package/dist/forge-remote.d.ts +13 -0
  80. package/dist/forge-remote.js +15 -0
  81. package/dist/lexicon.d.ts +45 -4
  82. package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
  83. package/dist/lifecycle/__fixtures__/package-files.js +72 -0
  84. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
  85. package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
  86. package/dist/lifecycle/publish-attachments.d.ts +2 -1
  87. package/dist/lifecycle/publish-attachments.js +19 -2
  88. package/dist/lifecycle/publish-cargo.d.ts +99 -0
  89. package/dist/lifecycle/publish-cargo.js +412 -0
  90. package/dist/lifecycle/publish-credentials.d.ts +1 -1
  91. package/dist/lifecycle/publish-credentials.js +13 -0
  92. package/dist/lifecycle/publish-declaration.d.ts +322 -4
  93. package/dist/lifecycle/publish-declaration.js +340 -9
  94. package/dist/lifecycle/publish-forge.d.ts +45 -2
  95. package/dist/lifecycle/publish-forge.js +434 -34
  96. package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
  97. package/dist/lifecycle/publish-git-ssh.js +30 -4
  98. package/dist/lifecycle/publish-github.d.ts +40 -2
  99. package/dist/lifecycle/publish-github.js +100 -3
  100. package/dist/lifecycle/publish-helm.d.ts +83 -0
  101. package/dist/lifecycle/publish-helm.js +452 -0
  102. package/dist/lifecycle/publish-homebrew.d.ts +7 -9
  103. package/dist/lifecycle/publish-homebrew.js +34 -197
  104. package/dist/lifecycle/publish-index.d.ts +141 -0
  105. package/dist/lifecycle/publish-index.js +719 -0
  106. package/dist/lifecycle/publish-marketplace.js +77 -0
  107. package/dist/lifecycle/publish-maven.d.ts +79 -0
  108. package/dist/lifecycle/publish-maven.js +364 -0
  109. package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
  110. package/dist/lifecycle/publish-mcp-registry.js +305 -0
  111. package/dist/lifecycle/publish-npm.d.ts +27 -1
  112. package/dist/lifecycle/publish-npm.js +216 -3
  113. package/dist/lifecycle/publish-nuget.d.ts +93 -0
  114. package/dist/lifecycle/publish-nuget.js +377 -0
  115. package/dist/lifecycle/publish-oci.d.ts +91 -2
  116. package/dist/lifecycle/publish-oci.js +247 -8
  117. package/dist/lifecycle/publish-package-files.d.ts +16 -0
  118. package/dist/lifecycle/publish-package-files.js +39 -0
  119. package/dist/lifecycle/publish-pypi.d.ts +138 -0
  120. package/dist/lifecycle/publish-pypi.js +657 -0
  121. package/dist/lifecycle/publish-record.d.ts +6 -3
  122. package/dist/lifecycle/publish-record.js +6 -3
  123. package/dist/lifecycle/publish-rubygems.d.ts +84 -0
  124. package/dist/lifecycle/publish-rubygems.js +366 -0
  125. package/dist/lifecycle/publish-signing.d.ts +147 -0
  126. package/dist/lifecycle/publish-signing.js +257 -0
  127. package/dist/lifecycle/publish-targets.d.ts +37 -1
  128. package/dist/lifecycle/publish-targets.js +102 -0
  129. package/dist/lifecycle/publish-tauri.js +43 -0
  130. package/dist/lifecycle/publish-train-names.d.ts +57 -0
  131. package/dist/lifecycle/publish-train-names.js +123 -0
  132. package/dist/lifecycle/publish-verify.d.ts +121 -0
  133. package/dist/lifecycle/publish-verify.js +130 -0
  134. package/dist/lifecycle/query.js +8 -0
  135. package/dist/lifecycle/release-artifacts.d.ts +290 -0
  136. package/dist/lifecycle/release-artifacts.js +808 -0
  137. package/dist/lifecycle/release-changelog.d.ts +13 -1
  138. package/dist/lifecycle/release-changelog.js +35 -2
  139. package/dist/lifecycle/release-cut.d.ts +64 -4
  140. package/dist/lifecycle/release-cut.js +147 -34
  141. package/dist/lifecycle/release-doctor.d.ts +113 -0
  142. package/dist/lifecycle/release-doctor.js +1198 -0
  143. package/dist/lifecycle/release-green.d.ts +86 -0
  144. package/dist/lifecycle/release-green.js +286 -0
  145. package/dist/lifecycle/release-init-registries.d.ts +48 -0
  146. package/dist/lifecycle/release-init-registries.js +97 -0
  147. package/dist/lifecycle/release-init.d.ts +275 -0
  148. package/dist/lifecycle/release-init.js +984 -0
  149. package/dist/lifecycle/release-intents.d.ts +73 -0
  150. package/dist/lifecycle/release-intents.js +128 -0
  151. package/dist/lifecycle/release-next.d.ts +111 -0
  152. package/dist/lifecycle/release-next.js +251 -0
  153. package/dist/lifecycle/release-prerelease.d.ts +19 -0
  154. package/dist/lifecycle/release-prerelease.js +30 -0
  155. package/dist/lifecycle/release-publish.d.ts +256 -10
  156. package/dist/lifecycle/release-publish.js +247 -35
  157. package/dist/lifecycle/release-status-change.d.ts +226 -0
  158. package/dist/lifecycle/release-status-change.js +478 -0
  159. package/dist/lifecycle/release-status.d.ts +11 -0
  160. package/dist/lifecycle/release-status.js +1 -1
  161. package/dist/lifecycle/release-store.d.ts +73 -2
  162. package/dist/lifecycle/release-store.js +32 -1
  163. package/dist/lifecycle/release-tag.d.ts +142 -0
  164. package/dist/lifecycle/release-tag.js +322 -0
  165. package/dist/lifecycle/release-verify.d.ts +73 -1
  166. package/dist/lifecycle/release-verify.js +117 -2
  167. package/dist/lifecycle/release-version-formats.d.ts +73 -0
  168. package/dist/lifecycle/release-version-formats.js +570 -0
  169. package/dist/lifecycle/release-version.d.ts +58 -10
  170. package/dist/lifecycle/release-version.js +164 -36
  171. package/dist/lifecycle/release-workstation.d.ts +3 -2
  172. package/dist/lifecycle/release-workstation.js +3 -2
  173. package/dist/op/generate-pipeline.js +1 -1
  174. package/dist/op/local-executor.d.ts +1 -1
  175. package/dist/op/local-executor.js +2 -2
  176. package/dist/op/op-waves-evidence.js +9 -2
  177. package/dist/pr-forge-base.js +4 -2
  178. package/dist/pr-forge.d.ts +20 -2
  179. package/dist/pr-forge.js +46 -10
  180. package/dist/release-floors.d.ts +8 -1
  181. package/dist/release-floors.js +9 -2
  182. package/dist/sensitive-key.d.ts +12 -0
  183. package/dist/sensitive-key.js +52 -0
  184. package/dist/tool-pins.d.ts +40 -0
  185. package/dist/tool-pins.js +66 -0
  186. package/dist/ts-loader.d.ts +8 -0
  187. package/dist/ts-loader.js +19 -0
  188. package/dist/wave-runtime.mjs +345 -342
  189. package/dist/workspace/ci-forge.d.ts +17 -0
  190. package/dist/workspace/ci-forge.js +17 -0
  191. package/dist/workspace/ci-init.js +1 -1
  192. package/dist/workspace/composites.schema.json +1 -0
  193. package/dist/workspace/declaration.d.ts +8 -0
  194. package/dist/workspace/declaration.js +12 -0
  195. package/dist/workspace/declaration.schema.json +8 -0
  196. package/dist/workspace/environments.d.ts +2 -0
  197. package/dist/workspace/environments.js +1 -1
  198. package/dist/workspace/identity-gate-rule.d.ts +61 -5
  199. package/dist/workspace/identity-gate-rule.js +81 -12
  200. package/dist/workspace/lexicon-outputs.d.ts +1 -1
  201. package/dist/workspace/lexicon-outputs.js +1 -1
  202. package/dist/workspace/member-pipeline.d.ts +2 -1
  203. package/dist/workspace/member-pipeline.js +5 -2
  204. package/dist/workspace/reason-codes.d.ts +2 -0
  205. package/dist/workspace/reason-codes.js +3 -1
  206. package/dist/workspace/release-changed.d.ts +75 -4
  207. package/dist/workspace/release-changed.js +205 -34
  208. package/dist/workspace/release-changed.schema.json +20 -2
  209. package/dist/workspace/release-steps/artifacts.d.ts +7 -0
  210. package/dist/workspace/release-steps/artifacts.js +45 -0
  211. package/dist/workspace/release-steps/builds.d.ts +12 -0
  212. package/dist/workspace/release-steps/builds.js +38 -0
  213. package/dist/workspace/release-steps/doctor.d.ts +8 -0
  214. package/dist/workspace/release-steps/doctor.js +14 -0
  215. package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
  216. package/dist/workspace/release-steps/goreleaser.js +36 -0
  217. package/dist/workspace/release-steps/green.d.ts +3 -0
  218. package/dist/workspace/release-steps/green.js +6 -0
  219. package/dist/workspace/release-steps/images.d.ts +22 -0
  220. package/dist/workspace/release-steps/images.js +59 -0
  221. package/dist/workspace/release-steps/index.d.ts +9 -0
  222. package/dist/workspace/release-steps/index.js +50 -0
  223. package/dist/workspace/release-steps/nfpm.d.ts +13 -0
  224. package/dist/workspace/release-steps/nfpm.js +29 -0
  225. package/dist/workspace/release-steps/nuget.d.ts +14 -0
  226. package/dist/workspace/release-steps/nuget.js +16 -0
  227. package/dist/workspace/release-steps/pypi.d.ts +15 -0
  228. package/dist/workspace/release-steps/pypi.js +21 -0
  229. package/dist/workspace/release-steps/qemu.d.ts +21 -0
  230. package/dist/workspace/release-steps/qemu.js +35 -0
  231. package/dist/workspace/release-steps/signing.d.ts +18 -0
  232. package/dist/workspace/release-steps/signing.js +30 -0
  233. package/dist/workspace/release-steps/stamp.d.ts +3 -0
  234. package/dist/workspace/release-steps/stamp.js +4 -0
  235. package/dist/workspace/release-steps/targets.d.ts +31 -0
  236. package/dist/workspace/release-steps/targets.js +40 -0
  237. package/dist/workspace/release-steps/types.d.ts +104 -0
  238. package/dist/workspace/release-steps/types.js +2 -0
  239. package/dist/workspace/release-steps/verify.d.ts +3 -0
  240. package/dist/workspace/release-steps/verify.js +4 -0
  241. package/dist/workspace/release-toolchains.d.ts +59 -0
  242. package/dist/workspace/release-toolchains.js +133 -0
  243. package/dist/workspace/release-train-workflow.d.ts +36 -0
  244. package/dist/workspace/release-train-workflow.js +121 -0
  245. package/dist/workspace/release-train.d.ts +3 -1
  246. package/dist/workspace/release-train.js +20 -3
  247. package/dist/workspace/release-workflow.d.ts +183 -59
  248. package/dist/workspace/release-workflow.js +570 -201
  249. package/dist/workspace/releases.schema.json +70 -1
  250. package/dist/workspace/search-contract.d.ts +1 -1
  251. package/dist/workspace/security.js +9 -2
  252. package/dist/workspace/train-cut.d.ts +182 -0
  253. package/dist/workspace/train-cut.js +504 -0
  254. package/dist/workspace/train-prepare.d.ts +64 -0
  255. package/dist/workspace/train-prepare.js +313 -0
  256. package/dist/workspace/train-publish.d.ts +177 -0
  257. package/dist/workspace/train-publish.js +574 -0
  258. package/dist/workspace/train-range-labels.d.ts +33 -0
  259. package/dist/workspace/train-range-labels.js +109 -0
  260. package/dist/workspace/train-shell.d.ts +5 -0
  261. package/dist/workspace/train-shell.js +17 -0
  262. package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
  263. package/dist/workspace/trust/check-evidence-report.js +3 -7
  264. package/dist/workspace/trust/seal.d.ts +13 -3
  265. package/dist/workspace/trust/seal.js +14 -4
  266. package/dist/workspace/work-cli.d.ts +3 -2
  267. package/dist/workspace/work-cli.js +3 -2
  268. package/dist/workspace/workspace-ledger.d.ts +14 -1
  269. package/dist/workspace/workspace-ledger.js +33 -7
  270. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ /** `release.images` (#4657): the publish job builds the images again, or checks the archives the cut handed on, before its build. */
2
+ import { ACTION_PINS, usesRef } from "../../action-pins.js";
3
+ /** Where `chant release images` writes the digests the publish job's build reads (#4657), by default and at a workstation. */
4
+ export const RELEASE_DIGESTS_FILE = ".chant/release-digests.json";
5
+ /**
6
+ * Where a generated publish job writes the digests: the runner's temp
7
+ * directory, outside the checkout, so `chant release publish` finds the tree
8
+ * as the cut left it (#4853). A repository that commits files under `.chant/`
9
+ * can't ignore the directory, and a digests file there made the publish
10
+ * refuse with `release-worktree-dirty`.
11
+ */
12
+ export const RELEASE_DIGESTS_PATHS = {
13
+ github: "$RUNNER_TEMP/chant-release-digests.json",
14
+ forgejo: "$RUNNER_TEMP/chant-release-digests.json",
15
+ gitlab: "/tmp/chant-release-digests.json",
16
+ };
17
+ /** The workflow artifact the cut job hands its image archives on in. */
18
+ export const RELEASE_IMAGES_ARTIFACT = "chant-release-images";
19
+ /** The directory every path is under, which the artifact actions store the files relative to. */
20
+ function commonDir(paths) {
21
+ const dirs = paths.map((p) => p.split("/").slice(0, -1));
22
+ const first = dirs[0] ?? [];
23
+ let n = 0;
24
+ while (n < first.length && dirs.every((d) => d[n] === first[n]))
25
+ n++;
26
+ return first.slice(0, n).join("/") || ".";
27
+ }
28
+ /**
29
+ * In a dispatched release the cut job hands the archives to the publish job,
30
+ * which checks them against the recorded digests (`release images
31
+ * --no-build`) rather than building them again, so a moved package mirror
32
+ * between the two jobs cannot change what is published. On a tag the publish
33
+ * job builds them again from the release.
34
+ */
35
+ export const imagesFeature = {
36
+ name: "images",
37
+ steps: (c) => {
38
+ if (!c.images)
39
+ return [];
40
+ const gitlab = c.forge === "gitlab";
41
+ const handed = c.archives.length > 0;
42
+ if (c.job === "cut") {
43
+ if (!handed)
44
+ return [];
45
+ if (gitlab)
46
+ return [{ slot: "artifactPaths", order: 10, items: [{ lines: c.archives.map((a) => ` - ${JSON.stringify(a)}`) }] }];
47
+ const upload = usesRef(c.forge === "forgejo" ? ACTION_PINS.uploadArtifact3 : ACTION_PINS.uploadArtifact4);
48
+ const lines = [` - uses: ${upload}`, " with:", ` name: ${RELEASE_IMAGES_ARTIFACT}`, " path: |", ...c.archives.map((a) => ` ${a}`), " if-no-files-found: error", " retention-days: 1"];
49
+ return [{ slot: "afterCut", order: 20, items: [{ lines }] }];
50
+ }
51
+ const digests = RELEASE_DIGESTS_PATHS[c.forge];
52
+ const build = [`${c.chant} release images ${c.label}${handed ? " --no-build" : ""} -o "${digests}"`, gitlab ? `export CHANT_RELEASE_DIGESTS="${digests}"` : `echo "CHANT_RELEASE_DIGESTS=${digests}" >> "$GITHUB_ENV"`];
53
+ const download = usesRef(c.forge === "forgejo" ? ACTION_PINS.downloadArtifact3 : ACTION_PINS.downloadArtifact4);
54
+ return [
55
+ ...(handed && !gitlab ? [{ slot: "prepare", order: 24, items: [{ lines: [` - uses: ${download}`, " with:", ` name: ${RELEASE_IMAGES_ARTIFACT}`, ` path: ${commonDir(c.archives)}`] }] }] : []),
56
+ { slot: "beforeBuild", order: 10, items: build },
57
+ ];
58
+ },
59
+ };
@@ -0,0 +1,9 @@
1
+ import type { OpSetupStep } from "../../lexicon.js";
2
+ import type { ReleaseStepContext, ReleaseStepItem, ReleaseStepSlot, ReleaseWorkflowContext, ReleaseWorkflowFeature } from "./types.js";
3
+ export type * from "./types.js";
4
+ /** Every feature, alphabetically by file. */
5
+ export declare const RELEASE_WORKFLOW_FEATURES: readonly ReleaseWorkflowFeature[];
6
+ /** The setup steps of the cut and publish jobs: the features' and `release.workflow.setup` (order 20), lowest order first. */
7
+ export declare function releaseSetupSteps(c: ReleaseWorkflowContext, features?: readonly ReleaseWorkflowFeature[]): OpSetupStep[];
8
+ /** One job's steps by slot, each slot's in order (lowest first, ties in list order). */
9
+ export declare function releaseJobSteps(c: ReleaseStepContext, features?: readonly ReleaseWorkflowFeature[]): (slot: ReleaseStepSlot) => ReleaseStepItem[];
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The features of the release workflow (#5196), one file each. The frame in
3
+ * ../release-workflow.ts asks each for its setup steps and its steps in the
4
+ * cut and publish jobs; where they land is in the feature, so adding one adds
5
+ * a file here and a line to the list below, kept in alphabetical order.
6
+ */
7
+ import { artifactsFeature } from "./artifacts.js";
8
+ import { buildsFeature } from "./builds.js";
9
+ import { doctorFeature } from "./doctor.js";
10
+ import { goreleaserFeature } from "./goreleaser.js";
11
+ import { greenFeature } from "./green.js";
12
+ import { imagesFeature } from "./images.js";
13
+ import { nfpmFeature } from "./nfpm.js";
14
+ import { nugetFeature } from "./nuget.js";
15
+ import { pypiFeature } from "./pypi.js";
16
+ import { qemuFeature } from "./qemu.js";
17
+ import { signingFeature } from "./signing.js";
18
+ import { stampFeature } from "./stamp.js";
19
+ import { targetsFeature } from "./targets.js";
20
+ import { verifyFeature } from "./verify.js";
21
+ /** Every feature, alphabetically by file. */
22
+ export const RELEASE_WORKFLOW_FEATURES = [
23
+ artifactsFeature,
24
+ buildsFeature,
25
+ doctorFeature,
26
+ goreleaserFeature,
27
+ greenFeature,
28
+ imagesFeature,
29
+ nfpmFeature,
30
+ nugetFeature,
31
+ pypiFeature,
32
+ qemuFeature,
33
+ signingFeature,
34
+ stampFeature,
35
+ targetsFeature,
36
+ verifyFeature,
37
+ ];
38
+ /** The setup steps of the cut and publish jobs: the features' and `release.workflow.setup` (order 20), lowest order first. */
39
+ export function releaseSetupSteps(c, features = RELEASE_WORKFLOW_FEATURES) {
40
+ const parts = [{ order: 20, steps: c.pipeline.setup ?? [] }, ...features.flatMap((f) => f.setup?.(c) ?? [])];
41
+ return parts.sort((a, b) => a.order - b.order).flatMap((p) => p.steps);
42
+ }
43
+ /** One job's steps by slot, each slot's in order (lowest first, ties in list order). */
44
+ export function releaseJobSteps(c, features = RELEASE_WORKFLOW_FEATURES) {
45
+ const placed = features.flatMap((f) => f.steps?.(c) ?? []);
46
+ return (slot) => placed
47
+ .filter((p) => p.slot === slot)
48
+ .sort((a, b) => a.order - b.order)
49
+ .flatMap((p) => p.items);
50
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge } from "../release-workflow.js";
2
+ import { type ReleaseWorkflowFeature } from "./types.js";
3
+ /**
4
+ * What a job that packages nfpm entries runs first: the pinned nfpm,
5
+ * downloaded, checked by SHA-256 and named by `CHANT_NFPM`. A config that
6
+ * sets `CHANT_NFPM` in `release.workflow.env` gets no install.
7
+ */
8
+ export declare function nfpmSetup(forge: ReleaseWorkflowForge, p: ReleasePipelineConfig): {
9
+ github: string[];
10
+ gitlab: string[];
11
+ };
12
+ /** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
13
+ export declare const nfpmFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,29 @@
1
+ /** nfpm for the `release.artifacts` entries it packages (#5233). */
2
+ import { TOOL_PINS, toolInstallLine } from "../../tool-pins.js";
3
+ import { RELEASE_RUNNER_PLATFORM } from "./types.js";
4
+ /**
5
+ * What a job that packages nfpm entries runs first: the pinned nfpm,
6
+ * downloaded, checked by SHA-256 and named by `CHANT_NFPM`. A config that
7
+ * sets `CHANT_NFPM` in `release.workflow.env` gets no install.
8
+ */
9
+ export function nfpmSetup(forge, p) {
10
+ if (p.env?.CHANT_NFPM !== undefined)
11
+ return { github: [], gitlab: [] };
12
+ if (forge === "gitlab")
13
+ return { github: [], gitlab: [`${toolInstallLine(TOOL_PINS.nfpm, RELEASE_RUNNER_PLATFORM, "/tmp/nfpm")} && export CHANT_NFPM=/tmp/nfpm/nfpm`] };
14
+ const line = `${toolInstallLine(TOOL_PINS.nfpm, RELEASE_RUNNER_PLATFORM, "$RUNNER_TEMP/nfpm")} && echo "CHANT_NFPM=$RUNNER_TEMP/nfpm/nfpm" >> "$GITHUB_ENV"`;
15
+ return { github: [` - name: nfpm ${TOOL_PINS.nfpm.version}`, ` run: ${JSON.stringify(line)}`], gitlab: [] };
16
+ }
17
+ /** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
18
+ export const nfpmFeature = {
19
+ name: "nfpm",
20
+ steps: (c) => {
21
+ if (!c.artifacts || c.input.nfpm !== true)
22
+ return [];
23
+ if (c.job !== (c.shape === "dispatch" ? "cut" : "publish"))
24
+ return [];
25
+ const n = nfpmSetup(c.forge, c.pipeline);
26
+ const items = c.forge !== "gitlab" ? [{ lines: n.github }] : c.shape === "dispatch" ? n.gitlab : [{ lines: n.gitlab.map((l) => ` - ${JSON.stringify(l)}`) }];
27
+ return [{ slot: "prepare", order: 21, items }];
28
+ },
29
+ };
@@ -0,0 +1,14 @@
1
+ /** nuget.org trusted publishing on GitLab (#5232): the ID token the `nuget` target reads. */
2
+ import type { ReleaseWorkflowTarget } from "../release-workflow.js";
3
+ import type { ReleaseWorkflowFeature } from "./types.js";
4
+ /** The audience nuget.org takes an OIDC ID token for. */
5
+ export declare const NUGET_ID_TOKEN_AUDIENCE = "https://www.nuget.org";
6
+ /**
7
+ * True when a `nuget` target may use trusted publishing: it does not set
8
+ * `auth: "token"` and pushes to nuget.org. With `auth` unset the target uses
9
+ * trusted publishing when its key's variable is not set, which the generator
10
+ * can't see, so the job gets the token; declaring it costs nothing.
11
+ */
12
+ export declare function nugetIdTokenNeeded(targets: ReadonlyArray<ReleaseWorkflowTarget>): boolean;
13
+ /** `NUGET_ID_TOKEN` in the GitLab publish job's `id_tokens`. GitHub asks for the token at run time from `id-token: write`, which the job already has. */
14
+ export declare const nugetFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,16 @@
1
+ /** The audience nuget.org takes an OIDC ID token for. */
2
+ export const NUGET_ID_TOKEN_AUDIENCE = "https://www.nuget.org";
3
+ /**
4
+ * True when a `nuget` target may use trusted publishing: it does not set
5
+ * `auth: "token"` and pushes to nuget.org. With `auth` unset the target uses
6
+ * trusted publishing when its key's variable is not set, which the generator
7
+ * can't see, so the job gets the token; declaring it costs nothing.
8
+ */
9
+ export function nugetIdTokenNeeded(targets) {
10
+ return targets.some((x) => x.type === "nuget" && x.auth !== "token" && x.pushUrl === undefined);
11
+ }
12
+ /** `NUGET_ID_TOKEN` in the GitLab publish job's `id_tokens`. GitHub asks for the token at run time from `id-token: write`, which the job already has. */
13
+ export const nugetFeature = {
14
+ name: "nuget",
15
+ steps: (c) => (c.forge === "gitlab" && c.job === "publish" && nugetIdTokenNeeded(c.input.publish ?? []) ? [{ slot: "idTokens", order: 20, items: [{ lines: [" NUGET_ID_TOKEN:", ` aud: ${NUGET_ID_TOKEN_AUDIENCE}`] }] }] : []),
16
+ };
@@ -0,0 +1,15 @@
1
+ /** PyPI trusted publishing on GitLab: the ID token the `pypi` target reads. */
2
+ import type { ReleaseWorkflowTarget } from "../release-workflow.js";
3
+ import type { ReleaseWorkflowFeature } from "./types.js";
4
+ /**
5
+ * The audience of the `PYPI_ID_TOKEN` a GitLab publish job needs, or null
6
+ * when no `pypi` target uses trusted publishing: `pypi`, or `testpypi` for
7
+ * a target on TestPyPI. A target that sets `auth: "token"`, or another index
8
+ * with its own URLs, takes a token only. With `auth` unset the target uses
9
+ * trusted publishing when its token's variable is not set, which the
10
+ * generator can't see, so the job gets the token; declaring it costs nothing.
11
+ * The first such target names the audience.
12
+ */
13
+ export declare function pypiIdTokenAudience(targets: ReadonlyArray<ReleaseWorkflowTarget>): "pypi" | "testpypi" | null;
14
+ /** `PYPI_ID_TOKEN` in the GitLab publish job's `id_tokens`, beside `SIGSTORE_ID_TOKEN`. GitHub and Forgejo ask for the token at run time from `id-token: write`, which the job already has. */
15
+ export declare const pypiFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The audience of the `PYPI_ID_TOKEN` a GitLab publish job needs, or null
3
+ * when no `pypi` target uses trusted publishing: `pypi`, or `testpypi` for
4
+ * a target on TestPyPI. A target that sets `auth: "token"`, or another index
5
+ * with its own URLs, takes a token only. With `auth` unset the target uses
6
+ * trusted publishing when its token's variable is not set, which the
7
+ * generator can't see, so the job gets the token; declaring it costs nothing.
8
+ * The first such target names the audience.
9
+ */
10
+ export function pypiIdTokenAudience(targets) {
11
+ const t = targets.find((x) => x.type === "pypi" && x.auth !== "token" && x.uploadUrl === undefined);
12
+ return t ? (t.index === "testpypi" ? "testpypi" : "pypi") : null;
13
+ }
14
+ /** `PYPI_ID_TOKEN` in the GitLab publish job's `id_tokens`, beside `SIGSTORE_ID_TOKEN`. GitHub and Forgejo ask for the token at run time from `id-token: write`, which the job already has. */
15
+ export const pypiFeature = {
16
+ name: "pypi",
17
+ steps: (c) => {
18
+ const aud = c.forge === "gitlab" && c.job === "publish" ? pypiIdTokenAudience(c.input.publish ?? []) : null;
19
+ return aud ? [{ slot: "idTokens", order: 10, items: [{ lines: [" PYPI_ID_TOKEN:", ` aud: ${aud}`] }] }] : [];
20
+ },
21
+ };
@@ -0,0 +1,21 @@
1
+ import type { OpSetupStep } from "../../lexicon.js";
2
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge } from "../release-workflow.js";
3
+ import { type ReleaseWorkflowFeature } from "./types.js";
4
+ /** The binfmt image a GitLab job installs QEMU's handlers with (#4876): the repository, which a config's own setup line is recognised by. */
5
+ export declare const RELEASE_BINFMT_IMAGE: string;
6
+ /** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
7
+ export declare function qemuArchitectures(platforms: readonly string[]): string[];
8
+ /**
9
+ * QEMU's binfmt setup for the platforms `release.images` builds that the
10
+ * runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
11
+ * product names it in `release.workflow.setup`. GitHub and Forgejo get
12
+ * `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
13
+ * of {@link RELEASE_BINFMT_IMAGE} by the digest `IMAGE_PINS.binfmt` records
14
+ * (#4941, ../../image-pins.ts), which `chant release workflow` notes needs
15
+ * an executor that runs privileged containers. A config whose `setup` names
16
+ * the action or the binfmt image already gets nothing more, so its file
17
+ * renders as it did.
18
+ */
19
+ export declare function qemuSetup(forge: ReleaseWorkflowForge, platforms: readonly string[], p: ReleasePipelineConfig): OpSetupStep[];
20
+ /** Before the config's own setup, where the products named it. */
21
+ export declare const qemuFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,35 @@
1
+ /** QEMU for the platforms `release.images` builds that the runner can't (#4876). */
2
+ import { ACTION_PINS, usesRef } from "../../action-pins.js";
3
+ import { IMAGE_PINS, imageRef } from "../../image-pins.js";
4
+ import { RELEASE_RUNNER_PLATFORM } from "./types.js";
5
+ /** The binfmt image a GitLab job installs QEMU's handlers with (#4876): the repository, which a config's own setup line is recognised by. */
6
+ export const RELEASE_BINFMT_IMAGE = IMAGE_PINS.binfmt.repository;
7
+ /** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
8
+ export function qemuArchitectures(platforms) {
9
+ return [...new Set(platforms.filter((p) => p.split("/").slice(0, 2).join("/") !== RELEASE_RUNNER_PLATFORM).map((p) => p.split("/")[1] ?? p))].sort();
10
+ }
11
+ /**
12
+ * QEMU's binfmt setup for the platforms `release.images` builds that the
13
+ * runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
14
+ * product names it in `release.workflow.setup`. GitHub and Forgejo get
15
+ * `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
16
+ * of {@link RELEASE_BINFMT_IMAGE} by the digest `IMAGE_PINS.binfmt` records
17
+ * (#4941, ../../image-pins.ts), which `chant release workflow` notes needs
18
+ * an executor that runs privileged containers. A config whose `setup` names
19
+ * the action or the binfmt image already gets nothing more, so its file
20
+ * renders as it did.
21
+ */
22
+ export function qemuSetup(forge, platforms, p) {
23
+ const archs = qemuArchitectures(platforms);
24
+ if (archs.length === 0)
25
+ return [];
26
+ const named = (p.setup ?? []).some((s) => ("uses" in s ? /^docker\/setup-qemu-action@/.test(s.uses) : s.run.includes(RELEASE_BINFMT_IMAGE)));
27
+ if (named)
28
+ return [];
29
+ return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${imageRef(IMAGE_PINS.binfmt)} --install ${archs.join(",")}` }] : [{ uses: usesRef(ACTION_PINS.dockerSetupQemu4), with: { platforms: archs.join(",") } }];
30
+ }
31
+ /** Before the config's own setup, where the products named it. */
32
+ export const qemuFeature = {
33
+ name: "qemu",
34
+ setup: (c) => (c.images ? { order: 10, steps: qemuSetup(c.forge, c.input.imagePlatforms ?? [], c.pipeline) } : null),
35
+ };
@@ -0,0 +1,18 @@
1
+ import type { OpSetupStep } from "../../lexicon.js";
2
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge } from "../release-workflow.js";
3
+ import { type ReleaseWorkflowFeature } from "./types.js";
4
+ /**
5
+ * The step that installs cosign for Sigstore signing (#5164): the binary
6
+ * {@link TOOL_PINS} pins for the runner's platform, downloaded to the job's
7
+ * temp directory and checked against its SHA-256, and `CHANT_COSIGN` set to
8
+ * it. A config whose `setup` already sets `CHANT_COSIGN` gets nothing.
9
+ */
10
+ export declare function cosignSetup(forge: ReleaseWorkflowForge, p: ReleasePipelineConfig): OpSetupStep[];
11
+ /**
12
+ * cosign after the config's setup, so a config that installs its own is left
13
+ * alone. It goes in the jobs that run chant release (the cut, whose doctor
14
+ * checks it, and the publish, which signs), never in a per-platform build
15
+ * job. On GitLab the doctor in a dispatched cut gets the publish job's
16
+ * `SIGSTORE_ID_TOKEN`, so it can check that signing will work.
17
+ */
18
+ export declare const signingFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,30 @@
1
+ /** Sigstore signing (#5164): cosign in the jobs that run chant release, and the OIDC token the doctor checks. */
2
+ import { TOOL_PINS, toolInstallLine } from "../../tool-pins.js";
3
+ import { RELEASE_RUNNER_PLATFORM } from "./types.js";
4
+ /**
5
+ * The step that installs cosign for Sigstore signing (#5164): the binary
6
+ * {@link TOOL_PINS} pins for the runner's platform, downloaded to the job's
7
+ * temp directory and checked against its SHA-256, and `CHANT_COSIGN` set to
8
+ * it. A config whose `setup` already sets `CHANT_COSIGN` gets nothing.
9
+ */
10
+ export function cosignSetup(forge, p) {
11
+ if ((p.setup ?? []).some((s) => !("uses" in s) && s.run.includes("CHANT_COSIGN")) || p.env?.CHANT_COSIGN !== undefined)
12
+ return [];
13
+ if (forge === "gitlab")
14
+ return [{ run: `${toolInstallLine(TOOL_PINS.cosign, RELEASE_RUNNER_PLATFORM, "/tmp")} && export CHANT_COSIGN=/tmp/cosign` }];
15
+ return [{ name: `Install cosign ${TOOL_PINS.cosign.version}`, run: `${toolInstallLine(TOOL_PINS.cosign, RELEASE_RUNNER_PLATFORM, "$RUNNER_TEMP")} && echo "CHANT_COSIGN=$RUNNER_TEMP/cosign" >> "$GITHUB_ENV"` }];
16
+ }
17
+ /**
18
+ * cosign after the config's setup, so a config that installs its own is left
19
+ * alone. It goes in the jobs that run chant release (the cut, whose doctor
20
+ * checks it, and the publish, which signs), never in a per-platform build
21
+ * job. On GitLab the doctor in a dispatched cut gets the publish job's
22
+ * `SIGSTORE_ID_TOKEN`, so it can check that signing will work.
23
+ */
24
+ export const signingFeature = {
25
+ name: "signing",
26
+ setup: (c) => (c.signing ? { order: 40, steps: cosignSetup(c.forge, c.pipeline) } : null),
27
+ steps: (c) => c.signing && c.doctor && c.shape === "dispatch" && c.job === "cut" && c.forge === "gitlab"
28
+ ? [{ slot: "jobKeys", order: 20, items: [{ lines: [" id_tokens:", " SIGSTORE_ID_TOKEN:", " aud: sigstore"] }] }]
29
+ : [],
30
+ };
@@ -0,0 +1,3 @@
1
+ /** `release.version` (#4840): the publish job stamps the label before the images and the build. The cut stamps on its own. */
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ export declare const stampFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,4 @@
1
+ export const stampFeature = {
2
+ name: "stamp",
3
+ steps: (c) => (c.version && c.job === "publish" ? [{ slot: "prepare", order: 30, items: [`${c.chant} release stamp ${c.label}`] }] : []),
4
+ };
@@ -0,0 +1,31 @@
1
+ /** What the `release.publish` targets need of the jobs on GitHub (#4786). */
2
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge, ReleaseWorkflowTarget } from "../release-workflow.js";
3
+ import type { ReleaseWorkflowFeature } from "./types.js";
4
+ /** npm trusted publishing needs this npm or later (#4786). */
5
+ export declare const NPM_TRUSTED_PUBLISHING_MIN = "11.5.1";
6
+ /** The npm a publish job installs when the runner's Node bundles one older than {@link NPM_TRUSTED_PUBLISHING_MIN}. */
7
+ export declare const NPM_TRUSTED_PUBLISHING_VERSION = "11.19.0";
8
+ /**
9
+ * The shell line that installs {@link NPM_TRUSTED_PUBLISHING_VERSION} when the
10
+ * runner's npm is older than {@link NPM_TRUSTED_PUBLISHING_MIN}, and prints the
11
+ * npm in use.
12
+ */
13
+ export declare const NPM_TRUSTED_PUBLISHING_SETUP = "have=\"$(npm --version)\"; if [ \"$(printf '%s\\n' \"11.5.1\" \"$have\" | sort -V | head -n1)\" != \"11.5.1\" ]; then npm install -g npm@11.19.0; fi; npm --version";
14
+ /**
15
+ * What a GitHub release workflow needs for its targets, worked out from them
16
+ * (#4786), so no product wires it by hand:
17
+ *
18
+ * - an `oci` target, or a `helm` target's `oci` (#5233), on `ghcr.io` that
19
+ * names no credentials pushes with the job's token: `packages: write`, and `OCI_USERNAME` and `OCI_PASSWORD`
20
+ * from `github.actor` and `github.token`;
21
+ * - an `npm` target on npmjs publishes with trusted publishing, which needs
22
+ * npm {@link NPM_TRUSTED_PUBLISHING_MIN}: the jobs upgrade npm when the
23
+ * runner's is older.
24
+ *
25
+ * `release.workflow` wins: a scope, variable or the same setup line it names
26
+ * is not added again. Other forges, and configs without such targets, get
27
+ * nothing.
28
+ */
29
+ export declare function targetExtras(forge: ReleaseWorkflowForge, targets: ReadonlyArray<ReleaseWorkflowTarget>, p: ReleasePipelineConfig): Pick<ReleasePipelineConfig, "permissions" | "env" | "setup">;
30
+ /** The targets' setup after the config's own, so a config that set it by hand renders the same file without it. Their permissions and variables the frame merges. */
31
+ export declare const targetsFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,40 @@
1
+ /** npm trusted publishing needs this npm or later (#4786). */
2
+ export const NPM_TRUSTED_PUBLISHING_MIN = "11.5.1";
3
+ /** The npm a publish job installs when the runner's Node bundles one older than {@link NPM_TRUSTED_PUBLISHING_MIN}. */
4
+ export const NPM_TRUSTED_PUBLISHING_VERSION = "11.19.0";
5
+ /**
6
+ * The shell line that installs {@link NPM_TRUSTED_PUBLISHING_VERSION} when the
7
+ * runner's npm is older than {@link NPM_TRUSTED_PUBLISHING_MIN}, and prints the
8
+ * npm in use.
9
+ */
10
+ export const NPM_TRUSTED_PUBLISHING_SETUP = `have="$(npm --version)"; if [ "$(printf '%s\\n' "${NPM_TRUSTED_PUBLISHING_MIN}" "$have" | sort -V | head -n1)" != "${NPM_TRUSTED_PUBLISHING_MIN}" ]; then npm install -g npm@${NPM_TRUSTED_PUBLISHING_VERSION}; fi; npm --version`;
11
+ /**
12
+ * What a GitHub release workflow needs for its targets, worked out from them
13
+ * (#4786), so no product wires it by hand:
14
+ *
15
+ * - an `oci` target, or a `helm` target's `oci` (#5233), on `ghcr.io` that
16
+ * names no credentials pushes with the job's token: `packages: write`, and `OCI_USERNAME` and `OCI_PASSWORD`
17
+ * from `github.actor` and `github.token`;
18
+ * - an `npm` target on npmjs publishes with trusted publishing, which needs
19
+ * npm {@link NPM_TRUSTED_PUBLISHING_MIN}: the jobs upgrade npm when the
20
+ * runner's is older.
21
+ *
22
+ * `release.workflow` wins: a scope, variable or the same setup line it names
23
+ * is not added again. Other forges, and configs without such targets, get
24
+ * nothing.
25
+ */
26
+ export function targetExtras(forge, targets, p) {
27
+ if (forge !== "github")
28
+ return {};
29
+ const ghcr = targets.some((t) => (t.type === "oci" && /^ghcr\.io\//.test(t.repository ?? "") && !t.usernameEnv && !t.passwordEnv) || (t.type === "helm" && /^ghcr\.io\//.test(t.oci?.repository ?? "") && !t.oci?.usernameEnv && !t.oci?.passwordEnv));
30
+ const npm = targets.some((t) => t.type === "npm" && (t.registry === undefined || /^https:\/\/registry\.npmjs\.org\/?$/.test(t.registry)));
31
+ const permissions = ghcr && p.permissions?.packages === undefined ? { packages: "write" } : undefined;
32
+ const env = ghcr ? Object.fromEntries(["OCI_USERNAME", "OCI_PASSWORD"].filter((k) => p.env?.[k] === undefined).map((k) => [k, k === "OCI_USERNAME" ? "${{ github.actor }}" : "${{ github.token }}"])) : {};
33
+ const setup = npm && !(p.setup ?? []).some((s) => !("uses" in s) && s.run === NPM_TRUSTED_PUBLISHING_SETUP) ? [{ run: NPM_TRUSTED_PUBLISHING_SETUP }] : [];
34
+ return { ...(permissions ? { permissions } : {}), ...(Object.keys(env).length > 0 ? { env } : {}), ...(setup.length > 0 ? { setup } : {}) };
35
+ }
36
+ /** The targets' setup after the config's own, so a config that set it by hand renders the same file without it. Their permissions and variables the frame merges. */
37
+ export const targetsFeature = {
38
+ name: "targets",
39
+ setup: (c) => ({ order: 30, steps: targetExtras(c.forge, c.input.publish ?? [], c.pipeline).setup ?? [] }),
40
+ };
@@ -0,0 +1,104 @@
1
+ /**
2
+ * What a release feature adds to the jobs `chant release workflow` writes
3
+ * (#5196). The cut and publish jobs are a fixed frame (checkout, install, the
4
+ * cut, the publish) with named slots between its lines; each feature, in a
5
+ * file of its own in this directory, says which steps it puts in which slot
6
+ * of which job, and ./index.ts lists the features. A new feature adds a file
7
+ * and a line to that list rather than editing the frame.
8
+ */
9
+ import type { OpSetupStep } from "../../lexicon.js";
10
+ import type { MemberTags } from "../../lifecycle/release-tag.js";
11
+ import type { ReleaseGreenSource } from "../../lifecycle/release-green.js";
12
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge, ReleaseWorkflowInput } from "../release-workflow.js";
13
+ import type { ReleaseBuildConfig } from "../release-toolchains.js";
14
+ /** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
15
+ export declare const RELEASE_RUNNER_PLATFORM = "linux/amd64";
16
+ /**
17
+ * The three files the generator writes: `tag`, the publish job on a
18
+ * `release/**` tag; `templated`, the same on the tags a `release.tag`
19
+ * template makes (#5150); `dispatch`, the release started by hand (#4656).
20
+ */
21
+ export type ReleaseWorkflowShape = "tag" | "templated" | "dispatch";
22
+ /** The settings every feature reads, resolved once per render. */
23
+ export interface ReleaseWorkflowContext {
24
+ forge: ReleaseWorkflowForge;
25
+ shape: ReleaseWorkflowShape;
26
+ input: ReleaseWorkflowInput;
27
+ /** `release.workflow`, or an empty one. */
28
+ pipeline: ReleasePipelineConfig;
29
+ /** What runs chant. */
30
+ chant: string;
31
+ /** The workspace root from the repository root, or null at the top. */
32
+ root: string | null;
33
+ /** Under `verified-releases`. */
34
+ verify: boolean;
35
+ /** `release.images` is declared (#4657). */
36
+ images: boolean;
37
+ /** The image archives the cut hands the publish job, from the repository root (dispatch only; empty otherwise). */
38
+ archives: string[];
39
+ /** `release.artifacts` is declared (#5151). */
40
+ artifacts: boolean;
41
+ /** `release.version` is declared (#4840). */
42
+ version: boolean;
43
+ /** `chant release doctor` runs (#5161): on by default in a dispatched release, opt-in on a tag. */
44
+ doctor: boolean;
45
+ /** The publish signs with Sigstore (#5164). */
46
+ signing: boolean;
47
+ /** The green gate the cut checks (#5149). */
48
+ green: ReleaseGreenSource;
49
+ /** `release.workflow.builds` (#5152). */
50
+ builds: ReleaseBuildConfig[];
51
+ /** `release.tag` (#5150), when the shape is `templated`. */
52
+ tags?: MemberTags;
53
+ }
54
+ /** The two jobs features add steps to. A tag-triggered file has only `publish`. */
55
+ export type ReleaseStepJob = "cut" | "publish";
56
+ /**
57
+ * The slots of the cut and publish jobs, in the order they run:
58
+ *
59
+ * - `afterCheckout`: GitLab dispatch publish only, before the `cd` into the root.
60
+ * - `prepare`: after the install, the config's setup steps and (on a
61
+ * templated tag) the label, before the ledger fetch in a cut.
62
+ * - `beforeCut`: a cut, after the fetches, right before `chant release cut`.
63
+ * - `afterCut`: a cut, after the tag is pushed.
64
+ * - `beforeBuild`: a publish, right before its build. On a tag the fetches of
65
+ * the ci tags and `chant/lifecycle` come before this slot when it holds
66
+ * anything, since those steps read the release, and after the build when
67
+ * it is empty.
68
+ * - `afterBuild`: a publish, after its build.
69
+ * - `beforePublish`: a publish, right before `chant release publish`.
70
+ * - `artifactPaths`: GitLab dispatch cut only, lines under its `artifacts: paths:`.
71
+ * - `jobKeys`: GitLab dispatch cut only, lines added to the job's keys.
72
+ * - `idTokens`: GitLab publish job only, entries under its `id_tokens:`
73
+ * beside `SIGSTORE_ID_TOKEN`, as lines indented four spaces for the name
74
+ * and six for `aud`.
75
+ */
76
+ export type ReleaseStepSlot = "afterCheckout" | "prepare" | "beforeCut" | "afterCut" | "beforeBuild" | "afterBuild" | "beforePublish" | "artifactPaths" | "jobKeys" | "idTokens";
77
+ /** A step: a shell line, which the job writes as its forge writes one (`- run: ...`, a script entry), or `lines` placed as they are. */
78
+ export type ReleaseStepItem = string | {
79
+ lines: string[];
80
+ };
81
+ /** Where a feature's steps go, and their order within the slot (lowest first). */
82
+ export interface ReleaseStepPlacement {
83
+ slot: ReleaseStepSlot;
84
+ order: number;
85
+ items: ReleaseStepItem[];
86
+ }
87
+ /** One job of one file, as a feature sees it. */
88
+ export interface ReleaseStepContext extends ReleaseWorkflowContext {
89
+ job: ReleaseStepJob;
90
+ /** The release's label as a shell word in this job. */
91
+ label: string;
92
+ }
93
+ /** A feature of the release workflow. */
94
+ export interface ReleaseWorkflowFeature {
95
+ /** The feature's name, for a reader. */
96
+ name: string;
97
+ /** Setup steps of the cut and publish jobs, merged with `release.workflow.setup` (order 20), lowest first. */
98
+ setup?: (c: ReleaseWorkflowContext) => {
99
+ order: number;
100
+ steps: OpSetupStep[];
101
+ } | null;
102
+ /** The feature's steps in one job. */
103
+ steps?: (c: ReleaseStepContext) => ReleaseStepPlacement[];
104
+ }
@@ -0,0 +1,2 @@
1
+ /** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
2
+ export const RELEASE_RUNNER_PLATFORM = "linux/amd64";
@@ -0,0 +1,3 @@
1
+ /** `verified-releases`: `chant release verify` right before the publish. */
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ export declare const verifyFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,4 @@
1
+ export const verifyFeature = {
2
+ name: "verify",
3
+ steps: (c) => (c.verify && c.job === "publish" ? [{ slot: "beforePublish", order: 10, items: [`${c.chant} release verify ${c.label}`] }] : []),
4
+ };
@@ -0,0 +1,59 @@
1
+ export declare const RELEASE_TOOLCHAINS: readonly ["node", "go", "python", "rust", "java"];
2
+ export type ReleaseToolchainName = (typeof RELEASE_TOOLCHAINS)[number];
3
+ /** One entry of `release.workflow.toolchains`: a name, or a name with the version to install. */
4
+ export type ReleaseToolchainDecl = ReleaseToolchainName | {
5
+ name: ReleaseToolchainName;
6
+ version: string;
7
+ };
8
+ /** The files at a project's root that say which toolchain it builds with, and which version. */
9
+ export declare const TOOLCHAIN_MARKERS: readonly ["package.json", "go.mod", "pyproject.toml", "setup.py", "requirements.txt", ".python-version", "Cargo.toml", "pom.xml", "build.gradle", "build.gradle.kts", ".java-version", ".sdkmanrc", ".tool-versions"];
10
+ /** The toolchains the files at a project's root name, in {@link RELEASE_TOOLCHAINS} order. */
11
+ export declare function detectToolchains(files: ReadonlySet<string>): ReleaseToolchainName[];
12
+ /** A setup step: the pinned action and its inputs. */
13
+ export interface ToolchainStep {
14
+ name: ReleaseToolchainName;
15
+ uses: string;
16
+ with: Array<[string, string | number | boolean]>;
17
+ }
18
+ /** The Node every job that runs chant gets, as the workflow always set it up. */
19
+ export declare const NODE_DEFAULT_VERSION = 24;
20
+ /**
21
+ * The setup step for one toolchain. A declared version wins; otherwise the
22
+ * version file the project keeps (`go.mod`, `.python-version`,
23
+ * `.java-version`), and otherwise the toolchain's current stable line. Paths
24
+ * are from the repository root, where the setup actions read them.
25
+ */
26
+ export declare function toolchainStep(decl: ReleaseToolchainDecl, files: ReadonlySet<string>, root: string | null): ToolchainStep;
27
+ /**
28
+ * The toolchains a job sets up: those declared, or those the project's files
29
+ * name. `false` is none, the runner bringing its own. `withNode` adds Node
30
+ * first for a job that runs chant, at the declared version when there is one.
31
+ */
32
+ export declare function resolveToolchains(decl: readonly ReleaseToolchainDecl[] | false | undefined, files: ReadonlySet<string>, root: string | null, withNode: boolean): ToolchainStep[];
33
+ /** A step's lines in a GitHub or Forgejo job. Node renders as it always has: its inputs unquoted. */
34
+ export declare function toolchainLines(steps: readonly ToolchainStep[]): string[];
35
+ /**
36
+ * `release.workflow.builds` (#5152): a job per platform that builds on its
37
+ * own runner before the cut and hands its outputs to the cut.
38
+ */
39
+ export interface ReleaseBuildConfig {
40
+ /** The job's name, `build-<name>`: lowercase letters, digits and dashes. */
41
+ name: string;
42
+ /** The runner: GitHub's and Forgejo's `runs-on` label (or labels), GitLab's runner `tags`. */
43
+ runner: string | string[];
44
+ /** The command that builds, run with bash from the project root with `CHANT_RELEASE_LABEL` set. */
45
+ build: string;
46
+ /** The files it hands to the cut, from the project root. Shell globs such as `dist/*` are allowed. */
47
+ outputs: string[];
48
+ /** What installs before the build. Default the workflow's install; `false` for none. */
49
+ install?: string | false;
50
+ /** The toolchains this job sets up, in place of the workflow's. */
51
+ toolchains?: ReleaseToolchainDecl[] | false;
52
+ /** Variables for this job only. The cut and publish jobs' `env` is not given to it. */
53
+ env?: Record<string, string>;
54
+ }
55
+ /** The workflow artifact a build job hands its outputs on in, and the tar archive inside it. */
56
+ export declare const releaseBuildArtifact: (name: string) => string;
57
+ export declare const releaseBuildArchive: (name: string) => string;
58
+ /** Each build checked: a unique job name, a runner, a build, and outputs that stay inside the project. */
59
+ export declare function checkBuilds(builds: readonly ReleaseBuildConfig[]): void;