@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
@@ -12,7 +12,15 @@
12
12
  * { type: "forge", forge: "github", repo: "acme/api", assets: ["dist/api-linux-amd64.tar.gz"] },
13
13
  * { type: "marketplace", marketplace: "openvsx", vsix: "dist/acme.vsix" },
14
14
  * { type: "tauri-updater", repo: "acme/app", tag: "app-latest", platforms: { "darwin-aarch64": "dist/Acme_aarch64.app.tar.gz" } },
15
+ * { type: "mcp-registry", server: "server.json" },
15
16
  * { type: "homebrew", tap: "acme/homebrew-tap", formula: "Formula/api.rb", template: "packaging/api.rb", assets: ["dist/api-linux-amd64.tar.gz"], url: "https://github.com/acme/api/releases/download/{tag}/{name}" },
17
+ * { type: "pypi", files: ["dist"] },
18
+ * { type: "cargo", crates: ["acme-core", "acme-cli"] },
19
+ * { type: "maven", bundle: "artifact:maven" },
20
+ * { type: "nuget", packages: ["artifact:nuget"] },
21
+ * { type: "rubygems", gems: ["artifact:gem"] },
22
+ * { type: "index", preset: "krew", name: "api", template: "packaging/krew.yaml", assets: ["artifact:api"], url: "https://github.com/acme/api/releases/download/{tag}/{name}" },
23
+ * { type: "helm", charts: ["artifact:chart"], oci: { repository: "ghcr.io/acme/charts" }, index: { repo: "acme/charts" } },
16
24
  * ],
17
25
  * },
18
26
  * };
@@ -106,29 +114,43 @@ export const ForgePublishSchema = z
106
114
  /** Files to attach, relative to the member. May be empty when `notes` gives the release its body. */
107
115
  assets: z.array(z.string().min(1)),
108
116
  /**
109
- * The release's notes (#4658): a section of a file in the member, sent as
110
- * the release's body on GitHub and Forgejo and its description on GitLab.
117
+ * The release's notes (#4658), sent as the release's body on GitHub and
118
+ * Forgejo and its description on GitLab: a section of a file in the
119
+ * member, notes generated for the release (#5153), or both, between
120
+ * `before` and `after`. They are decided when the target stages, so the
121
+ * draft release carries them before the reveal.
111
122
  */
112
123
  notes: z
113
124
  .object({
114
- /** The file, relative to the member, such as `CHANGELOG.md` or a docs site's changes page. */
115
- file: z.string().min(1),
125
+ /** The file, relative to the member, such as `CHANGELOG.md` or a docs site's changes page. Needs `heading`. */
126
+ file: z.string().min(1).optional(),
116
127
  /**
117
128
  * The heading that starts the section, such as `## In {version}` or `## [{version}]`. `{label}`, `{version}`
118
129
  * (the label from its first digit) and `{tag}` are filled in. The section runs to the next heading of the same
119
130
  * level or higher.
120
131
  */
121
- heading: z.string().regex(/^#{1,6} \S/, "a markdown heading, such as ## {version}"),
132
+ heading: z.string().regex(/^#{1,6} \S/, "a markdown heading, such as ## {version}").optional(),
122
133
  /** Links that start with `/` are made absolute against this, such as `https://docs.example.com`. */
123
134
  linkBase: z.string().url().optional(),
124
- /** A paragraph before the section, with the same placeholders. */
135
+ /**
136
+ * Notes generated for the release, after the file's section (#5153). `forge`: the forge's own, GitHub's
137
+ * generate-notes or GitLab's changelog from `Changelog:` commit trailers; Forgejo has none and is refused.
138
+ * `commits`: chant's own, from the conventional commits in the member since its previous release.
139
+ */
140
+ generate: z.enum(["forge", "commits"]).optional(),
141
+ /** With `generate: "commits"`: the commit types listed. Default `feat`, `fix` and `perf`. A breaking change is listed whatever its type; `*` lists every commit. */
142
+ types: z.array(z.string().min(1)).min(1).optional(),
143
+ /** A paragraph before the notes, with the same placeholders. */
125
144
  before: z.string().min(1).optional(),
126
- /** A paragraph after the section, with the same placeholders. */
145
+ /** A paragraph after the notes, with the same placeholders. */
127
146
  after: z.string().min(1).optional(),
128
147
  })
129
148
  .strict()
149
+ .refine((n) => (n.file === undefined) === (n.heading === undefined), { message: "notes.file and notes.heading go together", path: ["heading"] })
150
+ .refine((n) => n.file !== undefined || n.generate !== undefined, { message: "notes need a file section, generate, or both", path: ["generate"] })
151
+ .refine((n) => n.types === undefined || n.generate === "commits", { message: 'notes.types applies to generate: "commits"', path: ["types"] })
130
152
  .optional(),
131
- /** The forge release's tag. Default: the tag the cut made, `release/<label>` or `release/<member>/<label>`. */
153
+ /** The forge release's tag. Default: the tag the cut made, from `release.tag` (#5150; `release/<label>` or `release/<member>/<label>` when unset). */
132
154
  tag: z.string().min(1).optional(),
133
155
  /** The variable holding the token. Default `GITHUB_TOKEN`, `GITLAB_TOKEN` (then `CI_JOB_TOKEN`), or `FORGEJO_TOKEN`. */
134
156
  tokenEnv: envName.optional(),
@@ -243,4 +265,313 @@ export const TauriUpdaterPublishSchema = z
243
265
  tokenEnv: envName.optional(),
244
266
  })
245
267
  .strict();
246
- export const PublishDeclarationSchema = z.discriminatedUnion("type", [NpmPublishSchema, OciPublishSchema, ForgePublishSchema, HomebrewPublishSchema, MarketplacePublishSchema, TauriUpdaterPublishSchema]);
268
+ /**
269
+ * Python distributions on PyPI, TestPyPI or another index that takes PyPI's
270
+ * upload API (./publish-pypi.ts). The wheels and sdists are uploaded at the
271
+ * reveal, since an index has no draft.
272
+ */
273
+ export const PypiPublishSchema = z
274
+ .object({
275
+ type: z.literal("pypi"),
276
+ /**
277
+ * The wheels and sdists, relative to the member: a file, a directory
278
+ * (every `.whl`, `.tar.gz` and `.zip` in it), or `artifact:<name>` for the
279
+ * files the release records for that `release.artifacts` entry.
280
+ */
281
+ files: z.array(z.string().min(1)).min(1),
282
+ /** `pypi` (the default) or `testpypi`. */
283
+ index: z.enum(["pypi", "testpypi"]).optional(),
284
+ /** Another index's upload URL, such as `https://pypi.example.com/legacy/`. Needs `simpleUrl`. */
285
+ uploadUrl: z.string().url().optional(),
286
+ /** That index's simple API root, such as `https://pypi.example.com/simple/`, which the stage and reveal read. */
287
+ simpleUrl: z.string().url().optional(),
288
+ /**
289
+ * `token` reads an API token from `tokenEnv`. `trusted-publishing`
290
+ * exchanges the run's OIDC ID token for a short-lived upload token, on
291
+ * PyPI and TestPyPI only. Unset: a token when `tokenEnv`'s variable is
292
+ * set, else trusted publishing when the run has an OIDC ID token.
293
+ */
294
+ auth: z.enum(["token", "trusted-publishing"]).optional(),
295
+ /** The variable holding the API token. Default `PYPI_TOKEN`, or `TEST_PYPI_TOKEN` for TestPyPI. */
296
+ tokenEnv: envName.optional(),
297
+ /** The variable holding the user name the token is sent with. Default: `__token__`, as PyPI's API tokens take. */
298
+ usernameEnv: envName.optional(),
299
+ /**
300
+ * `false` publishes wheels without an SBOM under the `supply-chain`
301
+ * group, which otherwise refuses a wheel that carries none in its
302
+ * `.dist-info/sboms/` (PEP 770).
303
+ */
304
+ sbom: z.literal(false).optional(),
305
+ /**
306
+ * Upload the PEP 740 attestations beside each file, `<file>.<name>.attestation`
307
+ * as `pypi-attestations sign` writes them. Default `true`. chant does not
308
+ * write them.
309
+ */
310
+ attestations: z.boolean().optional(),
311
+ })
312
+ .strict()
313
+ .refine((d) => (d.uploadUrl === undefined) === (d.simpleUrl === undefined), { message: "uploadUrl and simpleUrl go together", path: ["simpleUrl"] })
314
+ .refine((d) => d.uploadUrl === undefined || d.index === undefined, { message: "index names PyPI or TestPyPI; uploadUrl names another index, so set one of them", path: ["index"] })
315
+ .refine((d) => d.uploadUrl === undefined || d.auth !== "trusted-publishing", { message: "trusted publishing is PyPI's and TestPyPI's; another index takes a token", path: ["auth"] })
316
+ .refine((d) => d.auth !== "trusted-publishing" || (d.tokenEnv === undefined && d.usernameEnv === undefined), { message: "auth: trusted-publishing reads no token", path: ["tokenEnv"] });
317
+ /**
318
+ * Rust crates on crates.io or another Cargo registry, published with
319
+ * `cargo publish` one crate at a time in dependency order
320
+ * (./publish-cargo.ts). A crate is visible as soon as it is published, so
321
+ * the reveal publishes.
322
+ */
323
+ export const CargoPublishSchema = z
324
+ .object({
325
+ type: z.literal("cargo"),
326
+ /** The `Cargo.toml` of the workspace or the crate, relative to the member. Default `Cargo.toml`. */
327
+ manifest: z.string().min(1).optional(),
328
+ /** The crates to publish, by package name. Default: every workspace member whose `publish` allows the registry. */
329
+ crates: z.array(z.string().min(1)).min(1).optional(),
330
+ /** A registry named in the project's `.cargo/config.toml`, passed as `cargo publish --registry`. Default: crates.io. Needs `index`. */
331
+ registry: z.string().regex(/^[A-Za-z0-9_-]+$/, "a registry name from .cargo/config.toml").optional(),
332
+ /** The registry's sparse index, such as `sparse+https://cargo.example.com/index/`, which the stage and reveal read. Default: crates.io's. */
333
+ index: z.string().regex(/^(sparse\+)?https?:\/\//, "a sparse index URL").optional(),
334
+ /** crates.io's API root, for trusted publishing. Default `https://crates.io`. */
335
+ api: z.string().url().optional(),
336
+ /**
337
+ * `token` reads a registry token from `tokenEnv`. `trusted-publishing`
338
+ * exchanges the run's OIDC ID token for a short-lived crates.io token,
339
+ * revoked after the publish. Unset: a token when `tokenEnv`'s variable is
340
+ * set, else trusted publishing when the run has an OIDC ID token.
341
+ */
342
+ auth: z.enum(["token", "trusted-publishing"]).optional(),
343
+ /** The variable holding the token. Default `CARGO_REGISTRY_TOKEN`, or `CARGO_REGISTRIES_<NAME>_TOKEN` with `registry`, the variables cargo reads. */
344
+ tokenEnv: envName.optional(),
345
+ /** `false` publishes under the `supply-chain` group, which otherwise refuses this target: a registry keeps no SBOM beside a crate. */
346
+ sbom: z.literal(false).optional(),
347
+ })
348
+ .strict()
349
+ .refine((d) => d.registry === undefined || d.index !== undefined, { message: "a registry other than crates.io needs its sparse index", path: ["index"] })
350
+ .refine((d) => d.registry === undefined || d.auth !== "trusted-publishing", { message: "trusted publishing is crates.io's; another registry takes a token", path: ["auth"] })
351
+ .refine((d) => d.auth !== "trusted-publishing" || d.tokenEnv === undefined, { message: "auth: trusted-publishing reads no token", path: ["tokenEnv"] });
352
+ /**
353
+ * Maven components on Maven Central (#5232): a bundle uploaded to the
354
+ * Central Portal at the stage, validated there, and published at the reveal
355
+ * (./publish-maven.ts).
356
+ */
357
+ export const MavenPublishSchema = z
358
+ .object({
359
+ type: z.literal("maven"),
360
+ /**
361
+ * The bundle, relative to the member: a `.zip` in Maven repository
362
+ * layout, a directory in that layout (chant zips it, adding each missing
363
+ * `.md5` and `.sha1`), or `artifact:<name>` for the one `.zip` the release
364
+ * records for that `release.artifacts` entry.
365
+ */
366
+ bundle: z.string().min(1),
367
+ /** The Central Portal's root. Default `https://central.sonatype.com`. */
368
+ api: z.string().url().optional(),
369
+ /** The repository the stage reads for components already published. Default `https://repo1.maven.org/maven2/`. */
370
+ repository: z.string().url().optional(),
371
+ /** The variable holding the user token's name. Default `MAVEN_CENTRAL_USERNAME`. */
372
+ usernameEnv: envName.optional(),
373
+ /** The variable holding the user token's password. Default `MAVEN_CENTRAL_PASSWORD`. */
374
+ passwordEnv: envName.optional(),
375
+ /** `false` publishes under the `supply-chain` group components that carry no `-cyclonedx` or `-spdx` file. */
376
+ sbom: z.literal(false).optional(),
377
+ })
378
+ .strict();
379
+ /**
380
+ * NuGet packages on nuget.org or another feed that takes NuGet's push API
381
+ * (#5232), pushed at the reveal (./publish-nuget.ts).
382
+ */
383
+ export const NugetPublishSchema = z
384
+ .object({
385
+ type: z.literal("nuget"),
386
+ /** The `.nupkg` files, relative to the member: a file, a directory (every `.nupkg` in it), or `artifact:<name>`. */
387
+ packages: z.array(z.string().min(1)).min(1),
388
+ /** Another feed's push URL, such as `https://nuget.acme.dev/api/v2/package`. Needs `flatContainerUrl`. Default nuget.org's. */
389
+ pushUrl: z.string().url().optional(),
390
+ /** That feed's package base address (flat container), which the stage and reveal read. */
391
+ flatContainerUrl: z.string().url().optional(),
392
+ /**
393
+ * `token` reads an API key from `tokenEnv`. `trusted-publishing`
394
+ * exchanges the run's OIDC ID token for a key that lasts an hour, on
395
+ * nuget.org only. Unset: a token when `tokenEnv`'s variable is set, else
396
+ * trusted publishing when the run has an OIDC ID token.
397
+ */
398
+ auth: z.enum(["token", "trusted-publishing"]).optional(),
399
+ /** The variable holding the API key. Default `NUGET_API_KEY`. */
400
+ tokenEnv: envName.optional(),
401
+ /** The variable holding the nuget.org user (profile name, not email) whose trusted publishing policy names this workflow. Default `NUGET_USER`. */
402
+ userEnv: envName.optional(),
403
+ /** `false` publishes under the `supply-chain` group packages that carry no SBOM. */
404
+ sbom: z.literal(false).optional(),
405
+ })
406
+ .strict()
407
+ .refine((d) => (d.pushUrl === undefined) === (d.flatContainerUrl === undefined), { message: "pushUrl and flatContainerUrl go together", path: ["flatContainerUrl"] })
408
+ .refine((d) => d.pushUrl === undefined || d.auth !== "trusted-publishing", { message: "trusted publishing is nuget.org's; another feed takes a token", path: ["auth"] })
409
+ .refine((d) => d.auth !== "trusted-publishing" || d.tokenEnv === undefined, { message: "auth: trusted-publishing reads no token", path: ["tokenEnv"] });
410
+ /**
411
+ * Ruby gems on RubyGems.org or another host that takes its API (#5232),
412
+ * pushed at the reveal (./publish-rubygems.ts).
413
+ */
414
+ export const RubygemsPublishSchema = z
415
+ .object({
416
+ type: z.literal("rubygems"),
417
+ /** The `.gem` files, relative to the member: a file, a directory (every `.gem` in it), or `artifact:<name>`. */
418
+ gems: z.array(z.string().min(1)).min(1),
419
+ /** The gem host. Default `https://rubygems.org`. */
420
+ host: z.string().url().optional(),
421
+ /**
422
+ * `token` reads an API key from `tokenEnv`. `trusted-publishing`
423
+ * exchanges the run's OIDC ID token for a short-lived key, on
424
+ * RubyGems.org only. Unset: a token when `tokenEnv`'s variable is set,
425
+ * else trusted publishing when the run has an OIDC ID token.
426
+ */
427
+ auth: z.enum(["token", "trusted-publishing"]).optional(),
428
+ /** The variable holding the API key. Default `GEM_HOST_API_KEY`, the one `gem push` reads. */
429
+ tokenEnv: envName.optional(),
430
+ /** `false` publishes under the `supply-chain` group, which otherwise refuses this target: a gem host keeps no SBOM beside a gem. */
431
+ sbom: z.literal(false).optional(),
432
+ })
433
+ .strict()
434
+ .refine((d) => d.host === undefined || d.auth !== "trusted-publishing", { message: "trusted publishing is RubyGems.org's; another host takes a token", path: ["auth"] })
435
+ .refine((d) => d.auth !== "trusted-publishing" || d.tokenEnv === undefined, { message: "auth: trusted-publishing reads no token", path: ["tokenEnv"] });
436
+ /**
437
+ * A `server.json` on the official MCP Registry (#5162), published after the
438
+ * npm packages or images it names have been revealed
439
+ * (./publish-mcp-registry.ts).
440
+ */
441
+ export const McpRegistryPublishSchema = z
442
+ .object({
443
+ type: z.literal("mcp-registry"),
444
+ /** The `server.json`, relative to the member. Default `server.json`. Its `version` and each package's version must be the release's label. */
445
+ server: z.string().min(1).optional(),
446
+ /** The registry's root. Default `https://registry.modelcontextprotocol.io`. */
447
+ registry: z.string().url().optional(),
448
+ /**
449
+ * How the target gets a registry token. `"github-oidc"` (the default)
450
+ * exchanges the GitHub Actions OIDC token of a job with `id-token: write`.
451
+ * `"github-token"` exchanges a GitHub token read from `tokenEnv`, default
452
+ * `MCP_GITHUB_TOKEN`. `"registry-token"` sends a registry token read from
453
+ * `tokenEnv`, default `MCP_REGISTRY_TOKEN`, such as one `mcp-publisher`
454
+ * got by a DNS or HTTP login.
455
+ */
456
+ auth: z.enum(["github-oidc", "github-token", "registry-token"]).optional(),
457
+ /** The variable holding the token, under `github-token` or `registry-token`. */
458
+ tokenEnv: envName.optional(),
459
+ })
460
+ .strict();
461
+ /** The index repositories `index` has a preset for (#5158). */
462
+ export const INDEX_PRESETS = ["krew", "winget", "scoop", "homebrew-core", "homebrew-tap", "zed", "artifacthub"];
463
+ /**
464
+ * A manifest in an index repository on GitHub (#5158), such as krew-index,
465
+ * winget-pkgs, a Scoop bucket, homebrew-core, a Homebrew tap, Zed's
466
+ * extensions or an Artifact Hub repository, rendered from templates in the
467
+ * member and either committed to a repository the publisher may push to
468
+ * (`mode: "commit"`) or proposed in a pull request from a fork
469
+ * (`mode: "pull-request"`). It reveals after every other target
470
+ * (./publish-index.ts).
471
+ */
472
+ export const IndexPublishSchema = z
473
+ .object({
474
+ type: z.literal("index"),
475
+ /** Defaults for a known index: its repository, mode, manifest path and pull request title. */
476
+ preset: z.enum(INDEX_PRESETS).optional(),
477
+ /** The index repository, `owner/name`. Default: the preset's, where it has one (krew, winget, homebrew-core, zed). */
478
+ repo: z.string().regex(/^[^/\s]+\/[^/\s]+$/, "owner/name").optional(),
479
+ /** The package's name in the index: the krew plugin, the winget `PackageIdentifier`, the Scoop app, the formula, the Zed extension id, the Artifact Hub package. */
480
+ name: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/, "a name of letters, digits, '.', '_', '+' and '-'"),
481
+ /** `commit` pushes to `branch` of `repo`; `pull-request` opens a pull request on `repo` from a branch of `fork`. Default: the preset's, else `pull-request`. */
482
+ mode: z.enum(["commit", "pull-request"]).optional(),
483
+ /** One manifest template, relative to the member, written to `path`. */
484
+ template: z.string().min(1).optional(),
485
+ /** Where `template` goes in the index. Default: the preset's path. `{name}`, `{version}`, `{label}`, `{letter}` (the name's first letter, lowercased) and `{namePath}` (the name with each `.` a `/`) are filled in. */
486
+ path: z.string().min(1).optional(),
487
+ /** More manifests: each path in the index, with the same placeholders as `path`, and its template relative to the member. */
488
+ files: z.record(z.string().min(1), z.string().min(1)).optional(),
489
+ /** The release's files the manifests download: `artifact:<name>` for an entry of `release.artifacts`, or a path the release records. Each SHA-256 is the one the release records. */
490
+ assets: z.array(z.string().min(1)).optional(),
491
+ /** Where each asset is downloaded from: `{tag}`, `{label}`, `{version}` and `{name}` (its file name) are filled in. Needed with `assets`. */
492
+ url: z.string().min(1).optional(),
493
+ /** The branch of `repo` the index is read from, and the base of a pull request. Default: the repository's default branch. */
494
+ branch: z.string().min(1).optional(),
495
+ /** `pull-request` only: the repository the branch is pushed to, `owner/name`. Default: the token's user's fork of `repo`, made when it has none. `repo` itself opens the pull request from a branch of `repo`. */
496
+ fork: z.string().regex(/^[^/\s]+\/[^/\s]+$/, "owner/name").optional(),
497
+ /** The commit message and pull request title: `{name}`, `{version}`, `{label}` and `{tag}` are filled in. Default: the preset's. */
498
+ title: z.string().min(1).optional(),
499
+ /** The pull request's body, with the same placeholders. */
500
+ body: z.string().min(1).optional(),
501
+ /** The GitHub API root. Default `$GITHUB_API_URL`, else `https://api.github.com`. */
502
+ api: z.string().url().optional(),
503
+ /** The variable holding the token. Default `HOMEBREW_TAP_TOKEN` under the homebrew-tap preset, else `INDEX_TOKEN`. */
504
+ tokenEnv: envName.optional(),
505
+ /** `commit` only: the variable holding an SSH private key that may push to `repo`, such as a deploy key. Set, the target pushes with git over SSH and reads no token. */
506
+ sshKeyEnv: envName.optional(),
507
+ /** What a refusal from the index does: `warn` (the default) prints a warning and leaves the target unrecorded, so a run of the same publish tries again; `fail` fails the publish. */
508
+ onRefusal: z.enum(["fail", "warn"]).optional(),
509
+ })
510
+ .strict()
511
+ .refine((d) => d.sshKeyEnv === undefined || d.tokenEnv === undefined, { message: "keep one of tokenEnv and sshKeyEnv", path: ["sshKeyEnv"] })
512
+ .refine((d) => d.path === undefined || d.template !== undefined, { message: "path is where template goes; name a template", path: ["path"] })
513
+ .refine((d) => (d.assets?.length ?? 0) === 0 || d.url !== undefined, { message: "assets need url, the pattern each is downloaded from", path: ["url"] });
514
+ /**
515
+ * Helm charts (#5233): each chart archive pushed to an OCI registry, where
516
+ * `helm install oci://...` reads it, and listed in a classic chart
517
+ * repository's `index.yaml` on a branch of a GitHub repository, such as the
518
+ * `gh-pages` branch GitHub Pages serves (./publish-helm.ts).
519
+ */
520
+ export const HelmPublishSchema = z
521
+ .object({
522
+ type: z.literal("helm"),
523
+ /** The chart archives, relative to the member: a `.tgz` file, or `artifact:<name>` for the files the release records for that `release.artifacts` entry. */
524
+ charts: z.array(z.string().min(1)).min(1),
525
+ /** Push each chart to `<repository>/<chart name>`, tagged with its version, as `helm push` does. */
526
+ oci: z
527
+ .object({
528
+ /** `<registry host>/<path>`, such as `ghcr.io/acme/charts`; a chart goes under it by its name. */
529
+ repository: z.string().min(1),
530
+ /** The variable holding the registry user name. Default `OCI_USERNAME`. */
531
+ usernameEnv: envName.optional(),
532
+ /** The variable holding the registry password or token. Default `OCI_PASSWORD`. */
533
+ passwordEnv: envName.optional(),
534
+ })
535
+ .strict()
536
+ .optional(),
537
+ /** List each chart in an `index.yaml` committed to a branch of a GitHub repository. */
538
+ index: z
539
+ .object({
540
+ /** The repository, `owner/name`. */
541
+ repo: z.string().regex(/^[^/\s]+\/[^/\s]+$/, "owner/name"),
542
+ /** The branch the chart repository is served from. Default `gh-pages`. */
543
+ branch: z.string().min(1).optional(),
544
+ /** The index's path on the branch. Default `index.yaml`. */
545
+ path: z.string().min(1).optional(),
546
+ /**
547
+ * Where each chart is downloaded from: `{tag}`, `{label}`, `{version}` and `{name}` (the archive's file name) are
548
+ * filled in, such as a forge release's asset URL. Unset, each archive is committed beside the index, and the
549
+ * index names it by its file name, which helm reads from the repository's URL.
550
+ */
551
+ url: z.string().min(1).optional(),
552
+ /** The GitHub API root. Default `$GITHUB_API_URL`, else `https://api.github.com`. */
553
+ api: z.string().url().optional(),
554
+ /** The variable holding a token that may push to the branch. Default `GITHUB_TOKEN`. */
555
+ tokenEnv: envName.optional(),
556
+ })
557
+ .strict()
558
+ .optional(),
559
+ })
560
+ .strict()
561
+ .refine((d) => d.oci !== undefined || d.index !== undefined, { message: "a helm target pushes to oci, lists the charts in an index, or both", path: ["oci"] });
562
+ export const PublishDeclarationSchema = z.discriminatedUnion("type", [
563
+ NpmPublishSchema,
564
+ OciPublishSchema,
565
+ ForgePublishSchema,
566
+ HomebrewPublishSchema,
567
+ MarketplacePublishSchema,
568
+ TauriUpdaterPublishSchema,
569
+ PypiPublishSchema,
570
+ CargoPublishSchema,
571
+ McpRegistryPublishSchema,
572
+ IndexPublishSchema,
573
+ HelmPublishSchema,
574
+ MavenPublishSchema,
575
+ NugetPublishSchema,
576
+ RubygemsPublishSchema,
577
+ ]);
@@ -4,7 +4,8 @@
4
4
  * each forge's REST API and an injectable `fetch`.
5
5
  *
6
6
  * The tag is the declaration's `tag`, else the one the cut made
7
- * (`release/<label>`, or `release/<member>/<label>`), so a release with no
7
+ * (`release.tag`, #5150; `release/<label>` or `release/<member>/<label>`
8
+ * when unset), so a release with no
8
9
  * label and no declared tag is refused.
9
10
  *
10
11
  * A publish is two steps (#4048), so a consumer never sees a release with
@@ -40,15 +41,32 @@
40
41
  * (./publish-attachments.ts). They go on the draft with the assets, so
41
42
  * nothing is visible before they are attached.
42
43
  *
44
+ * The release's notes (#4658, #5153) are a section of a file in the member,
45
+ * notes generated for the release, or both, between `before` and `after`.
46
+ * Generated notes are the forge's own (GitHub's `generate-notes`, GitLab's
47
+ * changelog API) or chant's, from the conventional commits in the member
48
+ * since its previous release. The stage decides them: the draft is made
49
+ * with them, or edited to them when it already exists, and they are kept in
50
+ * the publish record, so the reveal publishes what the draft showed, and a
51
+ * resumed reveal does not ask the forge again.
52
+ *
53
+ * When the publish signs (#5164, ./publish-signing.ts), the stage also
54
+ * uploads `<file>.sigstore.json` beside each file and
55
+ * `release.slsa.sigstore.json`, SLSA provenance over the declared assets. A
56
+ * bundle already on the draft is kept, since signing again gives other bytes.
57
+ *
43
58
  * The token is read from `tokenEnv`, else `GITHUB_TOKEN`, `GITLAB_TOKEN`
44
59
  * then `CI_JOB_TOKEN`, or `FORGEJO_TOKEN`, and is masked in all output.
45
60
  */
46
61
  import type { ForgePublishDeclaration } from "./publish-declaration.js";
47
- import { type PublishDeps, type PublishTarget } from "./release-publish.js";
62
+ import { type ChangelogCommit } from "./release-changelog.js";
63
+ import { type PublishContext, type PublishDeps, type PublishTarget } from "./release-publish.js";
48
64
  /** The first chant that reads `latest` on a forge target and sends it as GitHub's `make_latest` (#4676). */
49
65
  export declare const PUBLISH_FORGE_LATEST_FLOOR = "0.124.63";
50
66
  /** The first chant whose forge target reads `notes` and may have no assets (#4658). Products feature-detect on it. */
51
67
  export declare const PUBLISH_FORGE_NOTES_FLOOR = "0.124.71";
68
+ /** The first chant whose forge target generates notes, `notes.generate` (#5153). Products feature-detect on it. */
69
+ export declare const PUBLISH_FORGE_GENERATED_NOTES_FLOOR = "0.124.101";
52
70
  /**
53
71
  * The section of `page` that starts at the heading `heading` names (#4658),
54
72
  * up to the next heading of the same level or higher, trimmed. A heading
@@ -63,6 +81,31 @@ export declare function releaseNotesSection(page: string, heading: string, linkB
63
81
  export declare function forgeTokenEnv(decl: Pick<ForgePublishDeclaration, "forge" | "tokenEnv">): string[];
64
82
  /** The API root a forge is reached at. */
65
83
  export declare function forgeApi(decl: Pick<ForgePublishDeclaration, "forge" | "api">, env: NodeJS.ProcessEnv): string | null;
84
+ /**
85
+ * The member's previous release (#5153): the release of it cut from the
86
+ * nearest ancestor of this release's commit, as the cut finds it, with its
87
+ * label. Null for the member's first release. Refuses when the history the
88
+ * notes are generated from is not in the checkout.
89
+ */
90
+ export declare function previousMemberRelease(ctx: Pick<PublishContext, "cwd" | "release">, forge: string): Promise<{
91
+ commit: string;
92
+ label: string | null;
93
+ } | null>;
94
+ /**
95
+ * The tag the member's previous release has (#5150): its label through
96
+ * `release.tag`. A context that does not carry the template reads it off
97
+ * this release's tag, as the label's suffix, or not at all.
98
+ */
99
+ export declare function previousReleaseTag(ctx: Pick<PublishContext, "label" | "releaseTag" | "releaseTagOf">, label: string): string | null;
100
+ /** The commits in the member's directory after `from` (all of them when null) up to the release's commit, newest first, merges left out. */
101
+ export declare function memberCommits(ctx: Pick<PublishContext, "cwd" | "release">, from: string | null, forge: string): ChangelogCommit[];
102
+ /**
103
+ * Notes from the intent files the release's cuts consumed (#5159), read at
104
+ * the release's commit: their summaries, the highest level first. Empty
105
+ * when the cuts consumed none. A file the commit does not hold, or that
106
+ * can't be read, is left out.
107
+ */
108
+ export declare function consumedIntentNotes(ctx: Pick<PublishContext, "cwd" | "release">): Promise<string>;
66
109
  /** A GitLab generic package version: the label with what GitLab refuses replaced. */
67
110
  export declare function gitlabPackageVersion(label: string): string;
68
111
  export declare function forgeTarget(decl: ForgePublishDeclaration, deps: PublishDeps): PublishTarget;