@intentius/chant 0.124.100 → 0.124.101

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 (223) 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-system.d.ts +66 -0
  6. package/dist/ci-system.js +61 -0
  7. package/dist/cli/handlers/build.js +27 -0
  8. package/dist/cli/handlers/release-doctor.d.ts +12 -0
  9. package/dist/cli/handlers/release-doctor.js +118 -0
  10. package/dist/cli/handlers/release-init.d.ts +10 -0
  11. package/dist/cli/handlers/release-init.js +342 -0
  12. package/dist/cli/handlers/release.d.ts +42 -1
  13. package/dist/cli/handlers/release.js +656 -31
  14. package/dist/cli/handlers/run-generate.js +11 -0
  15. package/dist/cli/main.d.ts +2 -0
  16. package/dist/cli/main.js +44 -101
  17. package/dist/cli/parse-args.js +48 -0
  18. package/dist/cli/registry.d.ts +16 -0
  19. package/dist/cli/release-commands/artifacts.d.ts +3 -0
  20. package/dist/cli/release-commands/artifacts.js +14 -0
  21. package/dist/cli/release-commands/candidates.d.ts +3 -0
  22. package/dist/cli/release-commands/candidates.js +16 -0
  23. package/dist/cli/release-commands/changed.d.ts +3 -0
  24. package/dist/cli/release-commands/changed.js +14 -0
  25. package/dist/cli/release-commands/compose.d.ts +3 -0
  26. package/dist/cli/release-commands/compose.js +16 -0
  27. package/dist/cli/release-commands/cut.d.ts +3 -0
  28. package/dist/cli/release-commands/cut.js +49 -0
  29. package/dist/cli/release-commands/doctor.d.ts +3 -0
  30. package/dist/cli/release-commands/doctor.js +14 -0
  31. package/dist/cli/release-commands/export.d.ts +3 -0
  32. package/dist/cli/release-commands/export.js +12 -0
  33. package/dist/cli/release-commands/images.d.ts +3 -0
  34. package/dist/cli/release-commands/images.js +13 -0
  35. package/dist/cli/release-commands/index.d.ts +8 -0
  36. package/dist/cli/release-commands/index.js +52 -0
  37. package/dist/cli/release-commands/init.d.ts +3 -0
  38. package/dist/cli/release-commands/init.js +16 -0
  39. package/dist/cli/release-commands/list.d.ts +3 -0
  40. package/dist/cli/release-commands/list.js +10 -0
  41. package/dist/cli/release-commands/next.d.ts +3 -0
  42. package/dist/cli/release-commands/next.js +13 -0
  43. package/dist/cli/release-commands/publish.d.ts +3 -0
  44. package/dist/cli/release-commands/publish.js +22 -0
  45. package/dist/cli/release-commands/stamp.d.ts +3 -0
  46. package/dist/cli/release-commands/stamp.js +15 -0
  47. package/dist/cli/release-commands/status.d.ts +3 -0
  48. package/dist/cli/release-commands/status.js +17 -0
  49. package/dist/cli/release-commands/tag.d.ts +3 -0
  50. package/dist/cli/release-commands/tag.js +12 -0
  51. package/dist/cli/release-commands/types.d.ts +20 -0
  52. package/dist/cli/release-commands/types.js +1 -0
  53. package/dist/cli/release-commands/verify.d.ts +3 -0
  54. package/dist/cli/release-commands/verify.js +15 -0
  55. package/dist/cli/release-commands/workflow.d.ts +3 -0
  56. package/dist/cli/release-commands/workflow.js +13 -0
  57. package/dist/components/cli-support.d.ts +1 -1
  58. package/dist/components/cli-support.js +1 -1
  59. package/dist/config-environments.d.ts +8 -1
  60. package/dist/config-environments.js +2 -0
  61. package/dist/config.d.ts +294 -9
  62. package/dist/config.js +100 -5
  63. package/dist/floor-table.data.js +15 -1
  64. package/dist/forge-remote.d.ts +13 -0
  65. package/dist/forge-remote.js +15 -0
  66. package/dist/lexicon.d.ts +41 -2
  67. package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
  68. package/dist/lifecycle/__fixtures__/publish-fakes.js +270 -3
  69. package/dist/lifecycle/publish-attachments.d.ts +2 -1
  70. package/dist/lifecycle/publish-attachments.js +19 -2
  71. package/dist/lifecycle/publish-cargo.d.ts +99 -0
  72. package/dist/lifecycle/publish-cargo.js +412 -0
  73. package/dist/lifecycle/publish-credentials.d.ts +1 -1
  74. package/dist/lifecycle/publish-credentials.js +8 -0
  75. package/dist/lifecycle/publish-declaration.d.ts +199 -4
  76. package/dist/lifecycle/publish-declaration.js +200 -9
  77. package/dist/lifecycle/publish-forge.d.ts +45 -2
  78. package/dist/lifecycle/publish-forge.js +434 -34
  79. package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
  80. package/dist/lifecycle/publish-git-ssh.js +30 -4
  81. package/dist/lifecycle/publish-github.d.ts +40 -2
  82. package/dist/lifecycle/publish-github.js +100 -3
  83. package/dist/lifecycle/publish-homebrew.d.ts +7 -9
  84. package/dist/lifecycle/publish-homebrew.js +34 -197
  85. package/dist/lifecycle/publish-index.d.ts +141 -0
  86. package/dist/lifecycle/publish-index.js +719 -0
  87. package/dist/lifecycle/publish-marketplace.js +77 -0
  88. package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
  89. package/dist/lifecycle/publish-mcp-registry.js +306 -0
  90. package/dist/lifecycle/publish-npm.js +165 -2
  91. package/dist/lifecycle/publish-oci.d.ts +34 -1
  92. package/dist/lifecycle/publish-oci.js +246 -7
  93. package/dist/lifecycle/publish-pypi.d.ts +136 -0
  94. package/dist/lifecycle/publish-pypi.js +657 -0
  95. package/dist/lifecycle/publish-record.d.ts +6 -3
  96. package/dist/lifecycle/publish-record.js +6 -3
  97. package/dist/lifecycle/publish-signing.d.ts +147 -0
  98. package/dist/lifecycle/publish-signing.js +257 -0
  99. package/dist/lifecycle/publish-targets.d.ts +27 -1
  100. package/dist/lifecycle/publish-targets.js +80 -0
  101. package/dist/lifecycle/publish-tauri.js +43 -0
  102. package/dist/lifecycle/publish-train-names.d.ts +54 -0
  103. package/dist/lifecycle/publish-train-names.js +118 -0
  104. package/dist/lifecycle/publish-verify.d.ts +121 -0
  105. package/dist/lifecycle/publish-verify.js +130 -0
  106. package/dist/lifecycle/query.js +8 -0
  107. package/dist/lifecycle/release-artifacts.d.ts +212 -0
  108. package/dist/lifecycle/release-artifacts.js +571 -0
  109. package/dist/lifecycle/release-changelog.d.ts +13 -1
  110. package/dist/lifecycle/release-changelog.js +35 -2
  111. package/dist/lifecycle/release-cut.d.ts +58 -3
  112. package/dist/lifecycle/release-cut.js +132 -34
  113. package/dist/lifecycle/release-doctor.d.ts +113 -0
  114. package/dist/lifecycle/release-doctor.js +996 -0
  115. package/dist/lifecycle/release-green.d.ts +86 -0
  116. package/dist/lifecycle/release-green.js +286 -0
  117. package/dist/lifecycle/release-init.d.ts +255 -0
  118. package/dist/lifecycle/release-init.js +859 -0
  119. package/dist/lifecycle/release-intents.d.ts +73 -0
  120. package/dist/lifecycle/release-intents.js +128 -0
  121. package/dist/lifecycle/release-next.d.ts +111 -0
  122. package/dist/lifecycle/release-next.js +252 -0
  123. package/dist/lifecycle/release-prerelease.d.ts +19 -0
  124. package/dist/lifecycle/release-prerelease.js +30 -0
  125. package/dist/lifecycle/release-publish.d.ts +256 -10
  126. package/dist/lifecycle/release-publish.js +246 -34
  127. package/dist/lifecycle/release-status-change.d.ts +226 -0
  128. package/dist/lifecycle/release-status-change.js +478 -0
  129. package/dist/lifecycle/release-status.d.ts +11 -0
  130. package/dist/lifecycle/release-status.js +1 -1
  131. package/dist/lifecycle/release-store.d.ts +73 -2
  132. package/dist/lifecycle/release-store.js +32 -1
  133. package/dist/lifecycle/release-tag.d.ts +142 -0
  134. package/dist/lifecycle/release-tag.js +323 -0
  135. package/dist/lifecycle/release-verify.d.ts +73 -1
  136. package/dist/lifecycle/release-verify.js +117 -2
  137. package/dist/lifecycle/release-version-formats.d.ts +73 -0
  138. package/dist/lifecycle/release-version-formats.js +570 -0
  139. package/dist/lifecycle/release-version.d.ts +58 -10
  140. package/dist/lifecycle/release-version.js +164 -36
  141. package/dist/lifecycle/release-workstation.d.ts +3 -2
  142. package/dist/lifecycle/release-workstation.js +3 -2
  143. package/dist/op/generate-pipeline.js +1 -1
  144. package/dist/pr-forge-base.js +4 -2
  145. package/dist/pr-forge.d.ts +20 -2
  146. package/dist/pr-forge.js +46 -10
  147. package/dist/release-floors.d.ts +8 -1
  148. package/dist/release-floors.js +9 -2
  149. package/dist/tool-pins.d.ts +38 -0
  150. package/dist/tool-pins.js +54 -0
  151. package/dist/wave-runtime.mjs +337 -334
  152. package/dist/workspace/ci-forge.d.ts +17 -0
  153. package/dist/workspace/ci-forge.js +17 -0
  154. package/dist/workspace/ci-init.js +1 -1
  155. package/dist/workspace/composites.schema.json +1 -0
  156. package/dist/workspace/declaration.d.ts +8 -0
  157. package/dist/workspace/declaration.js +12 -0
  158. package/dist/workspace/declaration.schema.json +8 -0
  159. package/dist/workspace/environments.d.ts +2 -0
  160. package/dist/workspace/environments.js +1 -1
  161. package/dist/workspace/identity-gate-rule.d.ts +61 -5
  162. package/dist/workspace/identity-gate-rule.js +81 -12
  163. package/dist/workspace/member-pipeline.d.ts +2 -1
  164. package/dist/workspace/member-pipeline.js +5 -2
  165. package/dist/workspace/reason-codes.d.ts +2 -0
  166. package/dist/workspace/reason-codes.js +3 -1
  167. package/dist/workspace/release-changed.d.ts +75 -4
  168. package/dist/workspace/release-changed.js +205 -34
  169. package/dist/workspace/release-changed.schema.json +20 -2
  170. package/dist/workspace/release-steps/artifacts.d.ts +7 -0
  171. package/dist/workspace/release-steps/artifacts.js +45 -0
  172. package/dist/workspace/release-steps/builds.d.ts +12 -0
  173. package/dist/workspace/release-steps/builds.js +38 -0
  174. package/dist/workspace/release-steps/doctor.d.ts +8 -0
  175. package/dist/workspace/release-steps/doctor.js +14 -0
  176. package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
  177. package/dist/workspace/release-steps/goreleaser.js +36 -0
  178. package/dist/workspace/release-steps/green.d.ts +3 -0
  179. package/dist/workspace/release-steps/green.js +6 -0
  180. package/dist/workspace/release-steps/images.d.ts +22 -0
  181. package/dist/workspace/release-steps/images.js +59 -0
  182. package/dist/workspace/release-steps/index.d.ts +9 -0
  183. package/dist/workspace/release-steps/index.js +46 -0
  184. package/dist/workspace/release-steps/pypi.d.ts +15 -0
  185. package/dist/workspace/release-steps/pypi.js +21 -0
  186. package/dist/workspace/release-steps/qemu.d.ts +21 -0
  187. package/dist/workspace/release-steps/qemu.js +35 -0
  188. package/dist/workspace/release-steps/signing.d.ts +18 -0
  189. package/dist/workspace/release-steps/signing.js +30 -0
  190. package/dist/workspace/release-steps/stamp.d.ts +3 -0
  191. package/dist/workspace/release-steps/stamp.js +4 -0
  192. package/dist/workspace/release-steps/targets.d.ts +31 -0
  193. package/dist/workspace/release-steps/targets.js +40 -0
  194. package/dist/workspace/release-steps/types.d.ts +104 -0
  195. package/dist/workspace/release-steps/types.js +2 -0
  196. package/dist/workspace/release-steps/verify.d.ts +3 -0
  197. package/dist/workspace/release-steps/verify.js +4 -0
  198. package/dist/workspace/release-toolchains.d.ts +59 -0
  199. package/dist/workspace/release-toolchains.js +133 -0
  200. package/dist/workspace/release-train-workflow.d.ts +29 -0
  201. package/dist/workspace/release-train-workflow.js +85 -0
  202. package/dist/workspace/release-train.d.ts +3 -1
  203. package/dist/workspace/release-train.js +20 -3
  204. package/dist/workspace/release-workflow.d.ts +160 -61
  205. package/dist/workspace/release-workflow.js +539 -193
  206. package/dist/workspace/releases.schema.json +70 -1
  207. package/dist/workspace/search-contract.d.ts +1 -1
  208. package/dist/workspace/security.js +9 -2
  209. package/dist/workspace/train-cut.d.ts +182 -0
  210. package/dist/workspace/train-cut.js +482 -0
  211. package/dist/workspace/train-prepare.d.ts +61 -0
  212. package/dist/workspace/train-prepare.js +267 -0
  213. package/dist/workspace/train-publish.d.ts +177 -0
  214. package/dist/workspace/train-publish.js +575 -0
  215. package/dist/workspace/train-range-labels.d.ts +33 -0
  216. package/dist/workspace/train-range-labels.js +109 -0
  217. package/dist/workspace/trust/seal.d.ts +13 -3
  218. package/dist/workspace/trust/seal.js +14 -4
  219. package/dist/workspace/work-cli.d.ts +3 -2
  220. package/dist/workspace/work-cli.js +3 -2
  221. package/dist/workspace/workspace-ledger.d.ts +14 -1
  222. package/dist/workspace/workspace-ledger.js +33 -7
  223. package/package.json +1 -1
@@ -11,8 +11,9 @@
11
11
  *
12
12
  * For each `chant` member it finds the commit of its last release: the newest
13
13
  * cut in the member's ledger, else the newest legacy tag, one of the
14
- * `release.legacyTags` prefixes of the root's `chant.config.ts` followed by a
15
- * version (`release/npm/0.124.44`, `chant-v0.124.44`). It then lists the
14
+ * `release.legacyTags` prefixes of the root's `chant.config.ts` or the
15
+ * member's own followed by a version (`release/npm/0.124.44`,
16
+ * `chant-v0.124.44`). It then lists the
16
17
  * paths changed from there to the commit, takes the outer member that holds
17
18
  * each (`memberHolding`, the outermost workspace's members, one of which has
18
19
  * the member's own name), and drops the paths `changes.ignore` matches and
@@ -46,12 +47,13 @@ import { readDeclaration, readerVersion } from "./declaration.js";
46
47
  import { isGeneratedPath } from "./generated-files.js";
47
48
  import { memberHolding } from "./record-assets.js";
48
49
  import { workingTree } from "./tree.js";
50
+ import { changelogBump } from "../lifecycle/release-changelog.js";
49
51
  export const RELEASE_CHANGED_CONTRACT_VERSION = 1;
50
52
  export const RELEASE_CHANGED_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/release-changed/v1/release-changed.schema.json";
51
53
  /** Why the read stopped. Closed; each code is in `reason-codes.ts`. */
52
- export const RELEASE_CHANGED_ERROR_CODES = ["not-a-git-repository", "declaration-missing", "revision-unknown", "bump-invalid", "ledger-unreadable"];
54
+ export const RELEASE_CHANGED_ERROR_CODES = ["not-a-git-repository", "declaration-missing", "revision-unknown", "bump-invalid", "ledger-unreadable", "intent-invalid"];
53
55
  /** Why a member is in the release. Closed; each code is in `reason-codes.ts`. */
54
- export const RELEASE_CHANGED_REASON_CODES = ["paths-changed", "needed-by", "range-broken-by"];
56
+ export const RELEASE_CHANGED_REASON_CODES = ["paths-changed", "needed-by", "range-broken-by", "intent-pending"];
55
57
  export const RELEASE_BUMPS = ["major", "minor", "patch"];
56
58
  class ReadFailure extends Error {
57
59
  constructor(code, message) {
@@ -176,6 +178,38 @@ export function rangeAdmits(range, label) {
176
178
  }
177
179
  return unread;
178
180
  }
181
+ /** The higher of two bumps; null is lower than any. */
182
+ function maxBump(a, b) {
183
+ if (a === null)
184
+ return b;
185
+ if (b === null)
186
+ return a;
187
+ const order = ["patch", "minor", "major"];
188
+ return order.indexOf(a) >= order.indexOf(b) ? a : b;
189
+ }
190
+ /**
191
+ * The bump the conventional commits in `from..to` that touch `paths` (from
192
+ * the repository root) give, as `changelogBump` decides it (#5159), or null
193
+ * when none does. The paths go to git on its standard input, literally.
194
+ */
195
+ function commitBumpOver(top, from, to, paths) {
196
+ let out;
197
+ try {
198
+ out = execFileSync("git", ["log", "--no-merges", "--format=%B%x1e", `${from}..${to}`, "--stdin"], {
199
+ cwd: top,
200
+ encoding: "utf-8",
201
+ input: `--\n${paths.join("\n")}\n`,
202
+ env: { ...process.env, GIT_LITERAL_PATHSPECS: "1" },
203
+ stdio: ["pipe", "pipe", "pipe"],
204
+ maxBuffer: 256 * 1024 * 1024,
205
+ });
206
+ }
207
+ catch {
208
+ return null;
209
+ }
210
+ const messages = out.split("\x1e").map((m) => m.trim()).filter(Boolean);
211
+ return messages.length > 0 ? changelogBump(messages) : null;
212
+ }
179
213
  function readPackage(top, rev, path) {
180
214
  const text = tryGit(top, ["show", `${rev}:${path}`]);
181
215
  if (text === null)
@@ -208,7 +242,35 @@ function outermostRoot(dir) {
208
242
  }
209
243
  }
210
244
  const posix = (p) => (sep === "/" ? p : p.split(sep).join("/"));
211
- /** The member's last release from its ledger, or null. */
245
+ /**
246
+ * The directory whose commits count for the member at `memberDir` (#5159):
247
+ * as `release changed` maps paths, the directory of the outermost
248
+ * workspace's member of the same name when there is one (a release member
249
+ * under `release/<name>` releases the package at `packages/<name>`), else
250
+ * the member's own directory.
251
+ */
252
+ export function memberSourcePath(memberDir) {
253
+ const dir = resolve(memberDir);
254
+ try {
255
+ const found = findWorkspaceRoot(dir);
256
+ if (!found)
257
+ return dir;
258
+ const rootDir = realpathSync(found.dir);
259
+ const real = realpathSync(dir);
260
+ const own = readDeclaration(workingTree(rootDir)).members.find((m) => m.dir !== "." && realpathSync(join(rootDir, m.dir)) === real);
261
+ if (!own)
262
+ return dir;
263
+ const outerDir = realpathSync(outermostRoot(rootDir));
264
+ if (outerDir === rootDir)
265
+ return dir;
266
+ const outer = readDeclaration(workingTree(outerDir)).members.find((m) => m.name === own.name && m.kind !== "workspace");
267
+ return outer ? join(outerDir, outer.dir) : dir;
268
+ }
269
+ catch {
270
+ return dir;
271
+ }
272
+ }
273
+ /** The member's last release from its ledger, or null, and its cuts. */
212
274
  async function ledgerRelease(memberDir) {
213
275
  const loc = { cwd: memberDir };
214
276
  await resolveMemberLedger(memberDir);
@@ -223,37 +285,118 @@ async function ledgerRelease(memberDir) {
223
285
  if (!best || c.timestamp > best.at)
224
286
  best = { at: c.timestamp, label: c.label, commit };
225
287
  }
226
- return best ? { label: best.label, commit: best.commit, source: "ledger" } : null;
288
+ return { last: best ? { label: best.label, commit: best.commit, source: "ledger" } : null, cuts };
227
289
  }
228
- /** The newest legacy tag of `prefixes` that names a version, as a release, or null. */
229
- function legacyRelease(top, prefixes) {
230
- let best = null;
231
- for (const prefix of prefixes) {
232
- const tags = tryGit(top, ["tag", "-l", `${prefix}[0-9]*`]) ?? "";
290
+ /**
291
+ * The newest tag of `shapes` that names a version, as a release, or null.
292
+ * The version between prefix and suffix holds no `/`: `release/npm/core/0.125.0`
293
+ * is a member's tag, not one of the prefix `release/`. The label drops a
294
+ * leading `v`, unless the shape's `render` only gives the tag back with it.
295
+ * With `at`, only a tag on that commit or an ancestor of it counts; with
296
+ * `stable`, only a version with no prerelease part; with `skip`, no
297
+ * version it lists (written without a leading `v`).
298
+ */
299
+ export function tagHistoryRelease(top, shapes, opts = {}) {
300
+ const found = [];
301
+ for (const shape of shapes) {
302
+ const tags = tryGit(top, ["tag", "-l", `${shape.prefix}*${shape.suffix}`]) ?? "";
233
303
  for (const tag of tags.split("\n").filter(Boolean)) {
234
- const rest = tag.slice(prefix.length);
304
+ if (!tag.startsWith(shape.prefix) || !tag.endsWith(shape.suffix) || tag.length <= shape.prefix.length + shape.suffix.length)
305
+ continue;
306
+ const rest = tag.slice(shape.prefix.length, tag.length - shape.suffix.length);
235
307
  const v = parseVersion(rest);
236
- // `release/npm/core/0.125.0` is a member's tag, not a legacy one: a version has no slash.
237
- if (!v || rest.includes("/"))
308
+ if (!v || rest.includes("/") || !/^v?\d/.test(rest))
309
+ continue;
310
+ if (opts.stable && /[-+]/.test(rest))
238
311
  continue;
239
- if (!best || compare(v, best.v) > 0)
240
- best = { v, label: rest.replace(/^v/, ""), tag };
312
+ if (opts.skip?.includes(rest.replace(/^v/, "")))
313
+ continue;
314
+ const label = [rest.replace(/^v/, ""), rest].find((l) => {
315
+ if (!shape.render)
316
+ return true;
317
+ try {
318
+ return shape.render(l) === tag;
319
+ }
320
+ catch {
321
+ return false;
322
+ }
323
+ });
324
+ if (label !== undefined)
325
+ found.push({ v, label, tag });
241
326
  }
242
327
  }
243
- if (!best)
244
- return null;
245
- const commit = tryGit(top, ["rev-list", "-n", "1", best.tag]);
246
- return commit ? { label: best.label, commit, source: "legacy" } : null;
328
+ found.sort((a, b) => compare(b.v, a.v));
329
+ for (const best of found) {
330
+ const commit = tryGit(top, ["rev-list", "-n", "1", best.tag]);
331
+ if (!commit)
332
+ continue;
333
+ if (opts.at !== undefined && commit !== opts.at && tryGit(top, ["merge-base", "--is-ancestor", commit, opts.at]) === null)
334
+ continue;
335
+ return { label: best.label, commit, source: "legacy", tag: best.tag };
336
+ }
337
+ return null;
247
338
  }
248
- async function legacyPrefixes(root) {
339
+ /** The newest legacy tag of `prefixes` that names a version, as a release, or null. */
340
+ function legacyRelease(top, prefixes) {
341
+ const hit = tagHistoryRelease(top, prefixes.map((prefix) => ({ prefix, suffix: "" })));
342
+ return hit ? { label: hit.label, commit: hit.commit, source: hit.source } : null;
343
+ }
344
+ /** The `release` settings of the `chant.config.ts` (or `.json`) in `dir` that pick a next label; empty when it has none or can't be read. */
345
+ export async function releaseSettingsAt(dir) {
346
+ if (!existsSync(join(dir, "chant.config.ts")) && !existsSync(join(dir, "chant.config.json")))
347
+ return { legacyTags: [] };
249
348
  try {
250
349
  const { loadChantConfig } = await import("../config.js");
251
- return [...((await loadChantConfig(root)).config.release?.legacyTags ?? [])];
350
+ const release = (await loadChantConfig(dir)).config.release;
351
+ return { legacyTags: [...(release?.legacyTags ?? [])], ...(release?.breakingOnZero ? { breakingOnZero: release.breakingOnZero } : {}) };
352
+ }
353
+ catch {
354
+ return { legacyTags: [] };
355
+ }
356
+ }
357
+ /**
358
+ * The settings for the member at `memberDir` (#5200, #5191): its own
359
+ * `release.legacyTags` with those of the workspace root it sits in, and its
360
+ * own `release.breakingOnZero`, else the root's. A project with no
361
+ * workspace reads its own config alone.
362
+ */
363
+ export async function memberReleaseSettings(memberDir, root) {
364
+ const own = await releaseSettingsAt(memberDir);
365
+ let outer = root;
366
+ if (outer === undefined) {
367
+ const found = findWorkspaceRoot(memberDir);
368
+ if (found && resolve(found.dir) !== resolve(memberDir))
369
+ outer = { dir: found.dir, settings: await releaseSettingsAt(found.dir) };
370
+ }
371
+ const same = outer !== undefined && realpathOr(outer.dir) === realpathOr(memberDir);
372
+ const rootSettings = outer && !same ? outer.settings : { legacyTags: [] };
373
+ return {
374
+ legacyTags: [...new Set([...own.legacyTags, ...rootSettings.legacyTags])],
375
+ breakingOnZero: own.breakingOnZero ?? rootSettings.breakingOnZero ?? "minor",
376
+ };
377
+ }
378
+ function realpathOr(p) {
379
+ try {
380
+ return realpathSync(p);
252
381
  }
253
382
  catch {
254
- return [];
383
+ return resolve(p);
255
384
  }
256
385
  }
386
+ /**
387
+ * The bump a commit gives on the version `label` (#5191): on 0.x, unless
388
+ * `breakingOnZero` is `major`, a breaking change bumps minor and a feature
389
+ * patch, since a 0.x project moves to 1.0.0 by choice (an intent file or a
390
+ * typed level of `major`). Any other version, or a null bump, is as given.
391
+ */
392
+ export function zeroShift(bump, label, breakingOnZero) {
393
+ if (bump === null || breakingOnZero === "major" || label === null)
394
+ return bump;
395
+ const v = parseVersion(label);
396
+ if (!v || v[0] !== 0)
397
+ return bump;
398
+ return bump === "major" ? "minor" : "patch";
399
+ }
257
400
  /** Read what a release at a commit of the workspace at `query.cwd` has to cut. */
258
401
  export async function releaseChangedDocument(query) {
259
402
  const head = { $schema: RELEASE_CHANGED_SCHEMA_ID, contract: RELEASE_CHANGED_CONTRACT_VERSION, chant: readerVersion() };
@@ -306,14 +449,31 @@ async function read(query) {
306
449
  throw new ReadFailure("bump-invalid", `--bump-member names ${member}, which is not a chant member of this declaration (${[...names].sort().join(", ") || "none"})`);
307
450
  bumps.set(member, level);
308
451
  }
452
+ // #5159: the intent files at the commit, each naming members of this declaration.
453
+ const { readIntents, consumedIntents, pendingIntents, ReleaseIntentError } = await import("../lifecycle/release-intents.js");
454
+ let intentFiles;
455
+ try {
456
+ intentFiles = readIntents(top, at);
457
+ }
458
+ catch (err) {
459
+ if (err instanceof ReleaseIntentError)
460
+ throw new ReadFailure("intent-invalid", err.message);
461
+ throw err;
462
+ }
463
+ for (const f of intentFiles) {
464
+ for (const name of f.members.keys()) {
465
+ if (name !== "*" && !names.has(name))
466
+ throw new ReadFailure("intent-invalid", `the intent file ${f.path} names ${name}, which is not a chant member of this declaration (${[...names].sort().join(", ") || "none"})`);
467
+ }
468
+ }
309
469
  // Each member's package, last release and the paths changed since.
310
470
  const outerMemberOf = (name) => outer.members.find((m) => m.name === name);
311
471
  const pkgDir = (name) => {
312
472
  const holder = outerMemberOf(name) ?? declaration.members.find((m) => m.name === name);
313
473
  return holder === outerMemberOf(name) ? holder.dir : posix(relative(outerDir, join(rootDir, holder.dir)));
314
474
  };
315
- const legacy = await legacyPrefixes(rootDir);
316
- const legacyLast = legacy.length > 0 ? legacyRelease(top, legacy) : null;
475
+ const rootSettings = await releaseSettingsAt(rootDir);
476
+ const legacyLast = rootSettings.legacyTags.length > 0 ? legacyRelease(top, rootSettings.legacyTags) : null;
317
477
  const ignore = (outer.changes?.ignore ?? []).map((g) => picomatch(g, { dot: true }));
318
478
  const info = new Map();
319
479
  for (const m of members) {
@@ -321,7 +481,10 @@ async function read(query) {
321
481
  const memberDir = join(rootDir, m.dir);
322
482
  if (!existsSync(memberDir))
323
483
  throw new ReadFailure("ledger-unreadable", `member ${m.name} has no directory ${m.dir}`);
324
- const last = (await ledgerRelease(memberDir)) ?? legacyLast;
484
+ const ledger = await ledgerRelease(memberDir);
485
+ // #5200: a member's own legacyTags count beside the root's; #5191: its breakingOnZero, else the root's.
486
+ const settings = await memberReleaseSettings(memberDir, { dir: rootDir, settings: rootSettings });
487
+ const last = ledger.last ?? (settings.legacyTags.length > rootSettings.legacyTags.length ? legacyRelease(top, settings.legacyTags) : legacyLast);
325
488
  let paths = [];
326
489
  if (last) {
327
490
  if (tryGit(top, ["cat-file", "-e", `${last.commit}^{commit}`]) === null)
@@ -342,13 +505,16 @@ async function read(query) {
342
505
  paths = [...new Set(paths)].sort();
343
506
  }
344
507
  const prefix = outerFromTop === "." || outerFromTop === "" ? "" : `${outerFromTop}/`;
508
+ const intents = pendingIntents(intentFiles, [m.name], consumedIntents(ledger.cuts)).map((i) => ({ path: i.path, bump: i.bump }));
345
509
  info.set(m.name, {
346
510
  name: m.name,
347
511
  dir,
348
512
  pkg: readPackage(top, at, `${prefix}${dir}/package.json`),
349
513
  last,
350
514
  paths,
351
- changed: last === null || paths.length > 0,
515
+ changed: last === null || paths.length > 0 || intents.length > 0,
516
+ commitBump: last && paths.length > 0 ? zeroShift(commitBumpOver(top, last.commit, at, paths.map((p) => `${prefix}${p}`)), last.label, settings.breakingOnZero) : null,
517
+ intents,
352
518
  published: last ? readPackage(top, last.commit, `${prefix}${dir}/package.json`) : null,
353
519
  });
354
520
  }
@@ -361,16 +527,21 @@ async function read(query) {
361
527
  for (const i of info.values())
362
528
  needs.set(i.name, [...new Set([...i.pkg.ranges.keys()].map((n) => memberOfPackage.get(n)).filter((n) => n !== undefined && n !== i.name))].sort());
363
529
  const nextOf = (name) => {
364
- const bump = bumps.get(name) ?? "patch";
365
- const label = info.get(name).last?.label;
366
- return { bump, next: label ? bumpLabel(label, bump) : null };
530
+ const i = info.get(name);
531
+ const flag = bumps.get(name);
532
+ const fromIntents = i.intents.reduce((b, x) => maxBump(b, x.bump), null);
533
+ const computed = maxBump(i.commitBump, fromIntents);
534
+ const bump = flag ?? computed ?? "patch";
535
+ const bumpFrom = flag ? "flag" : computed === null ? "default" : i.commitBump === computed ? "commits" : "intents";
536
+ const label = i.last?.label;
537
+ return { bump, bumpFrom, next: label ? bumpLabel(label, bump) : null };
367
538
  };
368
539
  // The closure.
369
540
  const chosen = new Map();
370
541
  const queue = [];
371
542
  for (const i of [...info.values()].sort((a, b) => a.name.localeCompare(b.name))) {
372
543
  if (i.changed) {
373
- chosen.set(i.name, { code: "paths-changed", member: null });
544
+ chosen.set(i.name, { code: i.last !== null && i.paths.length === 0 ? "intent-pending" : "paths-changed", member: null });
374
545
  queue.push(i.name);
375
546
  }
376
547
  }
@@ -424,7 +595,7 @@ async function read(query) {
424
595
  };
425
596
  // A changed member another member of the release depends on is there because that member needs it.
426
597
  for (const [name, reason] of chosen) {
427
- if (reason.code !== "paths-changed")
598
+ if (reason.code !== "paths-changed" && reason.code !== "intent-pending")
428
599
  continue;
429
600
  const needer = [...chosen.keys()].sort().find((m) => m !== name && chosen.get(m).code !== "range-broken-by" && reach(m).has(name));
430
601
  if (needer !== undefined)
@@ -447,8 +618,8 @@ async function read(query) {
447
618
  .sort((a, b) => layerOf.get(a) - layerOf.get(b) || a.localeCompare(b))
448
619
  .map((name) => {
449
620
  const i = info.get(name);
450
- const { bump, next } = nextOf(name);
451
- return { member: name, layer: layerOf.get(name), reason: chosen.get(name), last: i.last, bump, next, paths: i.paths };
621
+ const { bump, bumpFrom, next } = nextOf(name);
622
+ return { member: name, layer: layerOf.get(name), reason: chosen.get(name), last: i.last, bump, bumpFrom, next, paths: i.paths, intents: i.intents.map((x) => x.path) };
452
623
  });
453
624
  return { at, members: out };
454
625
  }
@@ -76,7 +76,8 @@
76
76
  "declaration-missing",
77
77
  "revision-unknown",
78
78
  "bump-invalid",
79
- "ledger-unreadable"
79
+ "ledger-unreadable",
80
+ "intent-invalid"
80
81
  ]
81
82
  },
82
83
  "message": {
@@ -118,7 +119,8 @@
118
119
  "enum": [
119
120
  "paths-changed",
120
121
  "needed-by",
121
- "range-broken-by"
122
+ "range-broken-by",
123
+ "intent-pending"
122
124
  ]
123
125
  },
124
126
  "member": {
@@ -181,6 +183,22 @@
181
183
  "type": "string"
182
184
  },
183
185
  "description": "The changed paths that count, from the outermost workspace root. Empty for a member taken only by the closure."
186
+ },
187
+ "bumpFrom": {
188
+ "enum": [
189
+ "flag",
190
+ "commits",
191
+ "intents",
192
+ "default"
193
+ ],
194
+ "description": "Added within contract version 1 by #5159. Where bump came from: flag for --bump-member, commits or intents for the higher of the conventional commits over paths since the last release and the pending intent files (commits when they tie), default for a patch when neither gives one."
195
+ },
196
+ "intents": {
197
+ "type": "array",
198
+ "items": {
199
+ "type": "string"
200
+ },
201
+ "description": "Added within contract version 1 by #5159. The intent files under .chant/release/ that name the member and that no cut of it consumed, by path from the repository root."
184
202
  }
185
203
  }
186
204
  }
@@ -0,0 +1,7 @@
1
+ import type { ReleaseWorkflowForge } from "../release-workflow.js";
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ /** The workflow artifact the cut job hands the files `release.artifacts` built on in (#5151). */
4
+ export declare const RELEASE_ARTIFACTS_ARTIFACT = "chant-release-artifacts";
5
+ /** Where a job stages, and the publish job finds, the files the cut built (#5151): outside the checkout on GitHub and Forgejo; GitLab keeps job artifacts only inside the project directory, so its publish job moves them out first. */
6
+ export declare const RELEASE_ARTIFACTS_STAGE: Record<ReleaseWorkflowForge, string>;
7
+ export declare const artifactsFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * `release.artifacts` (#5151). In a dispatched release the cut job stages the
3
+ * files it built (`chant release artifacts --no-build -o`) and hands them to
4
+ * the publish job as the workflow artifact {@link RELEASE_ARTIFACTS_ARTIFACT},
5
+ * which checks them against the record (`--from`) after its build. On a
6
+ * release tag the publish job builds them again and checks them.
7
+ */
8
+ import { ACTION_PINS, usesRef } from "../../action-pins.js";
9
+ /** The workflow artifact the cut job hands the files `release.artifacts` built on in (#5151). */
10
+ export const RELEASE_ARTIFACTS_ARTIFACT = "chant-release-artifacts";
11
+ /** Where a job stages, and the publish job finds, the files the cut built (#5151): outside the checkout on GitHub and Forgejo; GitLab keeps job artifacts only inside the project directory, so its publish job moves them out first. */
12
+ export const RELEASE_ARTIFACTS_STAGE = {
13
+ github: "$RUNNER_TEMP/chant-release-artifacts",
14
+ forgejo: "$RUNNER_TEMP/chant-release-artifacts",
15
+ gitlab: "$CI_PROJECT_DIR/.chant-release-artifacts",
16
+ };
17
+ export const artifactsFeature = {
18
+ name: "artifacts",
19
+ steps: (c) => {
20
+ if (!c.artifacts)
21
+ return [];
22
+ if (c.shape !== "dispatch")
23
+ return c.job === "publish" ? [{ slot: "beforeBuild", order: 20, items: [`${c.chant} release artifacts ${c.label}`] }] : [];
24
+ const gitlab = c.forge === "gitlab";
25
+ if (c.job === "cut") {
26
+ const stage = `${c.chant} release artifacts ${c.label} --no-build -o "${RELEASE_ARTIFACTS_STAGE[c.forge]}"`;
27
+ if (gitlab)
28
+ return [{ slot: "afterCut", order: 10, items: [stage] }, { slot: "artifactPaths", order: 20, items: [{ lines: [' - ".chant-release-artifacts/"'] }] }];
29
+ const upload = usesRef(c.forge === "forgejo" ? ACTION_PINS.uploadArtifact3 : ACTION_PINS.uploadArtifact4);
30
+ return [{ slot: "afterCut", order: 10, items: [stage, { lines: [` - uses: ${upload}`, " with:", ` name: ${RELEASE_ARTIFACTS_ARTIFACT}`, " path: ${{ runner.temp }}/chant-release-artifacts", " if-no-files-found: error", " retention-days: 1"] }] }];
31
+ }
32
+ if (gitlab) {
33
+ return [
34
+ // The staged files leave the checkout, which the publish finds as the cut left it.
35
+ { slot: "afterCheckout", order: 10, items: ['mv "$CI_PROJECT_DIR/.chant-release-artifacts" /tmp/chant-release-artifacts'] },
36
+ { slot: "afterBuild", order: 10, items: [`${c.chant} release artifacts ${c.label} --from /tmp/chant-release-artifacts`] },
37
+ ];
38
+ }
39
+ const download = usesRef(c.forge === "forgejo" ? ACTION_PINS.downloadArtifact3 : ACTION_PINS.downloadArtifact4);
40
+ return [
41
+ { slot: "beforeBuild", order: 20, items: [{ lines: [` - uses: ${download}`, " with:", ` name: ${RELEASE_ARTIFACTS_ARTIFACT}`, " path: ${{ runner.temp }}/chant-release-artifacts"] }] },
42
+ { slot: "afterBuild", order: 10, items: [`${c.chant} release artifacts ${c.label} --from "${RELEASE_ARTIFACTS_STAGE[c.forge]}"`] },
43
+ ];
44
+ },
45
+ };
@@ -0,0 +1,12 @@
1
+ import { type ReleaseBuildConfig } from "../release-toolchains.js";
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ /** The shell line that packs a build job's outputs into its archive (#5152): tar keeps each file's path and mode, which an upload of the files would not. */
4
+ export declare function packLine(b: ReleaseBuildConfig): string;
5
+ /**
6
+ * The shell line that unpacks a build's archive into the project root (#5152).
7
+ * In the cut, `-k` refuses a file that is already there, so a build cannot
8
+ * replace a file of the commit, and two builds cannot write one path.
9
+ */
10
+ export declare function unpackLine(archive: string, cut: boolean): string;
11
+ /** The restore: in the cut before `release cut`, in the publish before the stamp. GitLab hands the archive into the project directory, so it is moved out after, and the publish finds the tree as the cut left it. */
12
+ export declare const buildsFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,38 @@
1
+ /** `release.workflow.builds` (#5152): the cut and publish jobs unpack each build job's archive into the project root. */
2
+ import { ACTION_PINS, usesRef } from "../../action-pins.js";
3
+ import { releaseBuildArchive, releaseBuildArtifact } from "../release-toolchains.js";
4
+ /** The shell line that packs a build job's outputs into its archive (#5152): tar keeps each file's path and mode, which an upload of the files would not. */
5
+ export function packLine(b) {
6
+ return `tar -cf ${releaseBuildArchive(b.name)} -- ${b.outputs.join(" ")}`;
7
+ }
8
+ /**
9
+ * The shell line that unpacks a build's archive into the project root (#5152).
10
+ * In the cut, `-k` refuses a file that is already there, so a build cannot
11
+ * replace a file of the commit, and two builds cannot write one path.
12
+ */
13
+ export function unpackLine(archive, cut) {
14
+ return `tar -x${cut ? "k" : ""}f ${archive}`;
15
+ }
16
+ /** The restore: in the cut before `release cut`, in the publish before the stamp. GitLab hands the archive into the project directory, so it is moved out after, and the publish finds the tree as the cut left it. */
17
+ export const buildsFeature = {
18
+ name: "builds",
19
+ steps: (c) => {
20
+ if (c.shape !== "dispatch" || c.builds.length === 0)
21
+ return [];
22
+ const cut = c.job === "cut";
23
+ const items = c.forge === "gitlab"
24
+ ? c.builds.flatMap((b) => [unpackLine(releaseBuildArchive(b.name), cut), `mv ${releaseBuildArchive(b.name)} /tmp/`])
25
+ : [
26
+ {
27
+ lines: c.builds.flatMap((b) => [
28
+ ` - uses: ${usesRef(c.forge === "forgejo" ? ACTION_PINS.downloadArtifact3 : ACTION_PINS.downloadArtifact4)}`,
29
+ " with:",
30
+ ` name: ${releaseBuildArtifact(b.name)}`,
31
+ " path: ${{ runner.temp }}/chant-release-builds",
32
+ ` - run: ${unpackLine(`"$RUNNER_TEMP/chant-release-builds/${releaseBuildArchive(b.name)}"`, cut)}`,
33
+ ]),
34
+ },
35
+ ];
36
+ return [cut ? { slot: "beforeCut", order: 10, items } : { slot: "prepare", order: 27, items }];
37
+ },
38
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * `chant release doctor` (#5161) in the release workflow: in a dispatched
3
+ * release's cut job before the cut, unless `release.workflow.doctor` is
4
+ * false, and in a tag-triggered publish job before the build under
5
+ * `doctor: true`.
6
+ */
7
+ import type { ReleaseWorkflowFeature } from "./types.js";
8
+ export declare const doctorFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,14 @@
1
+ export const doctorFeature = {
2
+ name: "doctor",
3
+ steps: (c) => {
4
+ if (!c.doctor)
5
+ return [];
6
+ const items = [`${c.chant} release doctor`];
7
+ if (c.shape !== "dispatch")
8
+ return c.job === "publish" ? [{ slot: "prepare", order: 10, items }] : [];
9
+ if (c.job !== "cut")
10
+ return [];
11
+ // GitLab's cut runs it after the fetches, with the forge-checks token exported.
12
+ return c.forge === "gitlab" ? [{ slot: "beforeCut", order: 30, items }] : [{ slot: "prepare", order: 10, items }];
13
+ },
14
+ };
@@ -0,0 +1,16 @@
1
+ import type { ReleasePipelineConfig, ReleaseWorkflowForge } from "../release-workflow.js";
2
+ import { type ReleaseWorkflowFeature } from "./types.js";
3
+ /**
4
+ * What a job that builds goreleaser entries runs first (#5151): Go from the
5
+ * member's `go.mod` (GitHub and Forgejo, unless `release.workflow.setup`
6
+ * names `actions/setup-go`), then the pinned goreleaser, downloaded, checked
7
+ * by SHA-256 and named by `CHANT_GORELEASER`. A config that sets
8
+ * `CHANT_GORELEASER` in `release.workflow.env` gets no install. GitLab
9
+ * jobs run in the project's image, which brings its own Go.
10
+ */
11
+ export declare function goreleaserSetup(forge: ReleaseWorkflowForge, root: string | null, p: ReleasePipelineConfig): {
12
+ github: string[];
13
+ gitlab: string[];
14
+ };
15
+ /** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
16
+ export declare const goreleaserFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,36 @@
1
+ /** goreleaser for the `release.artifacts` entries it builds (#5151). */
2
+ import { ACTION_PINS, usesRef } from "../../action-pins.js";
3
+ import { TOOL_PINS, toolInstallLine } from "../../tool-pins.js";
4
+ import { RELEASE_RUNNER_PLATFORM } from "./types.js";
5
+ /**
6
+ * What a job that builds goreleaser entries runs first (#5151): Go from the
7
+ * member's `go.mod` (GitHub and Forgejo, unless `release.workflow.setup`
8
+ * names `actions/setup-go`), then the pinned goreleaser, downloaded, checked
9
+ * by SHA-256 and named by `CHANT_GORELEASER`. A config that sets
10
+ * `CHANT_GORELEASER` in `release.workflow.env` gets no install. GitLab
11
+ * jobs run in the project's image, which brings its own Go.
12
+ */
13
+ export function goreleaserSetup(forge, root, p) {
14
+ const install = p.env?.CHANT_GORELEASER === undefined;
15
+ if (forge === "gitlab") {
16
+ return { github: [], gitlab: install ? [`${toolInstallLine(TOOL_PINS.goreleaser, RELEASE_RUNNER_PLATFORM, "/tmp/goreleaser")} && export CHANT_GORELEASER=/tmp/goreleaser/goreleaser`] : [] };
17
+ }
18
+ const go = (p.setup ?? []).some((s) => "uses" in s && /^actions\/setup-go@/.test(s.uses))
19
+ ? []
20
+ : [` - uses: ${usesRef(ACTION_PINS.setupGo7)}`, " with:", ` go-version-file: ${root ? `${root}/` : ""}go.mod`];
21
+ const line = `${toolInstallLine(TOOL_PINS.goreleaser, RELEASE_RUNNER_PLATFORM, "$RUNNER_TEMP/goreleaser")} && echo "CHANT_GORELEASER=$RUNNER_TEMP/goreleaser/goreleaser" >> "$GITHUB_ENV"`;
22
+ return { github: [...go, ...(install ? [` - name: goreleaser ${TOOL_PINS.goreleaser.version}`, ` run: ${JSON.stringify(line)}`] : [])], gitlab: [] };
23
+ }
24
+ /** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
25
+ export const goreleaserFeature = {
26
+ name: "goreleaser",
27
+ steps: (c) => {
28
+ if (!c.artifacts || c.input.goreleaser !== true)
29
+ return [];
30
+ if (c.job !== (c.shape === "dispatch" ? "cut" : "publish"))
31
+ return [];
32
+ const g = goreleaserSetup(c.forge, c.root, c.pipeline);
33
+ const items = c.forge !== "gitlab" ? [{ lines: g.github }] : c.shape === "dispatch" ? g.gitlab : [{ lines: g.gitlab.map((l) => ` - ${JSON.stringify(l)}`) }];
34
+ return [{ slot: "prepare", order: 20, items }];
35
+ },
36
+ };
@@ -0,0 +1,3 @@
1
+ /** `release.green: "forge-checks"` (#5149): GitLab's cut asks the forge for the commit's checks with the release token unless a token of its own is set. */
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ export declare const greenFeature: ReleaseWorkflowFeature;
@@ -0,0 +1,6 @@
1
+ export const greenFeature = {
2
+ name: "green",
3
+ steps: (c) => c.green === "forge-checks" && c.shape === "dispatch" && c.job === "cut" && c.forge === "gitlab"
4
+ ? [{ slot: "beforeCut", order: 20, items: ['export CHANT_GITLAB_TOKEN="${CHANT_GITLAB_TOKEN:-$CHANT_RELEASE_TOKEN}"'] }]
5
+ : [],
6
+ };
@@ -0,0 +1,22 @@
1
+ import type { ReleaseWorkflowForge } from "../release-workflow.js";
2
+ import type { ReleaseWorkflowFeature } from "./types.js";
3
+ /** Where `chant release images` writes the digests the publish job's build reads (#4657), by default and at a workstation. */
4
+ export declare 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 declare const RELEASE_DIGESTS_PATHS: Record<ReleaseWorkflowForge, string>;
13
+ /** The workflow artifact the cut job hands its image archives on in. */
14
+ export declare const RELEASE_IMAGES_ARTIFACT = "chant-release-images";
15
+ /**
16
+ * In a dispatched release the cut job hands the archives to the publish job,
17
+ * which checks them against the recorded digests (`release images
18
+ * --no-build`) rather than building them again, so a moved package mirror
19
+ * between the two jobs cannot change what is published. On a tag the publish
20
+ * job builds them again from the release.
21
+ */
22
+ export declare const imagesFeature: ReleaseWorkflowFeature;