super-release 1.8.1 → 1.9.1

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.
package/README.md CHANGED
@@ -70,6 +70,11 @@ Options:
70
70
  -C, --path <PATH> Repository root [default: .]
71
71
  -c, --config <CONFIG> Path to config file [default: .release.yaml]
72
72
  --show-next-version Print the next version and exit
73
+ --preview Render a pull-request release preview and exit
74
+ --pr <PR> Pull request number for --preview (auto-detected in CI)
75
+ --repo <OWNER/NAME> GitHub repository for --preview (auto-detected)
76
+ --base <BRANCH> Base branch to evaluate --preview against
77
+ --no-comment With --preview, print Markdown instead of commenting
73
78
  -p, --package <PACKAGE> Filter to a specific package (for --show-next-version)
74
79
  -v, --verbose Verbose output
75
80
  --dangerously-skip-config-check
@@ -89,6 +94,26 @@ SUPER_RELEASE_VERSION=$VERSION cargo build --release
89
94
 
90
95
  In monorepos, use `--package` to select which package: `super-release --show-next-version -p @acme/core`
91
96
 
97
+ ### `--preview`
98
+
99
+ Renders a **release preview** for a pull request: the next version for each package plus a preview of the release
100
+ notes, without changing anything. When a GitHub token and a pull request are detected (as in GitHub Actions), it posts —
101
+ and on later runs updates in place — a single "sticky" comment on the PR. Otherwise it prints the Markdown to stdout so
102
+ you can pipe it into your own comment step.
103
+
104
+ ```bash
105
+ # In CI (GitHub Actions): auto-detects the PR, repo, base branch, and token
106
+ super-release --preview
107
+
108
+ # Locally / other CI: print the Markdown
109
+ super-release --preview --base main --no-comment
110
+ ```
111
+
112
+ The preview evaluates the PR against its **base** branch and reflects the commits currently on the branch, so the final
113
+ release may differ after a squash-merge. Requires `pull-requests: write` permission and a full checkout
114
+ (`fetch-depth: 0`). A ready-to-use workflow lives in
115
+ [`.github/workflows/pr-preview.yml`](.github/workflows/pr-preview.yml).
116
+
92
117
  ## How It Works
93
118
 
94
119
  1. **Discover packages** -- finds all directories with a `package.json` (respects `.gitignore`)
@@ -336,6 +361,17 @@ steps:
336
361
  prepare_cmd: 'sed -i'''' -e ''s/^version = .*/version = "{version}"/'' Cargo.toml'
337
362
  publish_cmd: 'cargo publish'
338
363
  files: [Cargo.toml, Cargo.lock] # include in git commit
364
+
365
+ - name: github
366
+ options:
367
+ assets: ['dist/*.tgz'] # glob(s), relative to repo root
368
+ draft: false
369
+ # prerelease: true # default: true on prerelease branches
370
+ # release_name_template: '{name} v{version}' # default: the tag
371
+ # github_url: https://ghe.corp/api/v3 # GitHub Enterprise
372
+ comment_on_success: true # comment on resolved PRs/issues (default: true)
373
+ released_labels: ['released'] # labels added to them (default: ['released'])
374
+ # success_comment: '🎉 Shipped in {releases}' # {releases} = the tags, {tag}
339
375
  ```
340
376
 
341
377
  Each step can be scoped:
@@ -345,15 +381,27 @@ Each step can be scoped:
345
381
  - **`branches`** -- glob patterns for branch names this step runs on. If empty, the step runs on all branches.
346
382
  For example, `branches: ["main"]` ensures a step only runs on the main branch.
347
383
 
348
- | Step | Prepare | Publish |
349
- | ----------- | -------------------------------------------------- | ------------------------------------------------------ |
350
- | `changelog` | Generates/updates changelog per package (parallel) | -- |
351
- | `npm` | -- | Publishes packages (parallel within dependency levels) |
352
- | `exec` | Runs custom shell command per package | Runs custom shell command per package |
384
+ | Step | Prepare/Publish | Release (after tags are pushed) |
385
+ | ----------- | ------------------------------------------------------ | -------------------------------------------------------- |
386
+ | `changelog` | Generates/updates changelog per package (parallel) | -- |
387
+ | `npm` | Publishes packages (parallel within dependency levels) | -- |
388
+ | `exec` | Runs custom shell command per package | -- |
389
+ | `github` | -- | Creates a GitHub Release per package with its notes + assets |
353
390
 
354
391
  Package version bumps (`package.json`) happen automatically before steps run (part of core).
355
392
  Steps return the files they modified. The core git step stages exactly those files for the commit -- no `git add .`.
356
393
 
394
+ The `github` step runs **after** the commit and tags are pushed, so it needs `git.push: true` and a
395
+ `GITHUB_TOKEN` (or `GH_TOKEN`) with `contents: write` (and `issues: write` + `pull-requests: write` for
396
+ comments). It creates one GitHub Release per released package (idempotent -- safe to re-run) and comments on the
397
+ PRs/issues each release resolved (detected from `(#N)` squash/merge subjects and `closes/fixes #N` keywords),
398
+ adding a `released` label. Comments are posted once (marker-guarded), so re-runs don't duplicate them.
399
+
400
+ Release bodies are enriched with GitHub data when a token is available -- a "What's Changed" list with `@author`
401
+ mentions and PR links, plus a "New Contributors" section -- via git-cliff's GitHub integration (the API calls are
402
+ cached on disk, and fall back to the plain git-cliff notes if the fetch fails). The `CHANGELOG.md` file keeps its
403
+ conventional grouped format.
404
+
357
405
  Default: `[changelog, npm]`
358
406
 
359
407
  #### `git`
@@ -1 +1 @@
1
- 5adb8bd8adf5a50f199ccec6430df144388e063857bbd17a1f5943bf68e3b186 super-release-darwin-aarch64.tar.gz
1
+ 04e1ab4febfbac6b2c15e97bb0e90221ec9d22e4620980172b242ba44238cce8 super-release-darwin-aarch64.tar.gz
@@ -1 +1 @@
1
- 8f81c72a3f721df5802b9370695fe31db8c2be2d53fc089671e7caee8b694c32 super-release-darwin-x86_64.tar.gz
1
+ 5fd17f7303c3ae36724afbd4bb5973e34ce6cd68070bcc2e1c76bd07c9b25eab super-release-darwin-x86_64.tar.gz
@@ -1 +1 @@
1
- 4bd2f710f3d7016bea5cd5839cddc1aa185144fce0346b09639624167f3540f3 super-release-linux-aarch64.tar.gz
1
+ 722e466268fae8a64c091018a9f78c2f78f516905910cb3bfa8b210a1444fd7c super-release-linux-aarch64.tar.gz
@@ -1 +1 @@
1
- 1c46b9505d606dab35f7a1ec9fa7cd3e51c7715ba284161ff6d77f3c2801c272 super-release-linux-x86_64-musl.tar.gz
1
+ 1ca5015f55708b2b3c6e44f8ae94ae5059e1cfd09da38d4cb71dec2318f36da6 super-release-linux-x86_64-musl.tar.gz
@@ -1 +1 @@
1
- 500e0655d24d267d7f5c85e6e696291fcb1c9d51266f6e54f0bfdbab363a4573 super-release-linux-x86_64.tar.gz
1
+ a861a37df67de4cb24f535c20646e125cf4ed5f2a145bbe75c281a90b98f48e2 super-release-linux-x86_64.tar.gz
@@ -1 +1 @@
1
- 492A1A8BA9253D39F2F04502947606A2F46CD902739CF5910367F035738233A0
1
+ E6D69F40AFCEA5DF2B19D67A33AE24FC6F4FB96F2674F5A3597C91665D83B386
@@ -120,7 +120,7 @@
120
120
  "properties": {
121
121
  "name": {
122
122
  "type": "string",
123
- "enum": ["changelog", "npm", "exec"],
123
+ "enum": ["changelog", "npm", "exec", "github"],
124
124
  "description": "Step name"
125
125
  },
126
126
  "packages": {
@@ -155,6 +155,12 @@
155
155
  "then": {
156
156
  "properties": { "options": { "$ref": "#/$defs/execOptions" } }
157
157
  }
158
+ },
159
+ {
160
+ "if": { "properties": { "name": { "const": "github" } } },
161
+ "then": {
162
+ "properties": { "options": { "$ref": "#/$defs/githubOptions" } }
163
+ }
158
164
  }
159
165
  ]
160
166
  },
@@ -259,6 +265,49 @@
259
265
  "examples": [["Cargo.toml", "Cargo.lock"]]
260
266
  }
261
267
  }
268
+ },
269
+ "githubOptions": {
270
+ "type": "object",
271
+ "additionalProperties": false,
272
+ "properties": {
273
+ "draft": {
274
+ "type": "boolean",
275
+ "default": false,
276
+ "description": "Create the GitHub Release as a draft"
277
+ },
278
+ "prerelease": {
279
+ "type": "boolean",
280
+ "description": "Force the prerelease flag. Default: true on prerelease branches, false otherwise."
281
+ },
282
+ "assets": {
283
+ "type": "array",
284
+ "items": { "type": "string" },
285
+ "description": "Glob patterns (relative to the repo root) for files to attach to the release."
286
+ },
287
+ "release_name_template": {
288
+ "type": "string",
289
+ "description": "Release name template. Placeholders: {name}, {version}, {tag}. Default: the tag."
290
+ },
291
+ "github_url": {
292
+ "type": "string",
293
+ "format": "uri",
294
+ "description": "GitHub Enterprise API base URL, e.g. https://ghe.corp/api/v3"
295
+ },
296
+ "comment_on_success": {
297
+ "type": "boolean",
298
+ "default": true,
299
+ "description": "Comment on the PRs/issues a release resolves"
300
+ },
301
+ "success_comment": {
302
+ "type": "string",
303
+ "description": "Success-comment template. Placeholders: {releases} (the tags), {tag}."
304
+ },
305
+ "released_labels": {
306
+ "type": "array",
307
+ "items": { "type": "string" },
308
+ "description": "Labels to add to resolved PRs/issues. Default: [\"released\"]."
309
+ }
310
+ }
262
311
  }
263
312
  }
264
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-release",
3
- "version": "1.8.1",
3
+ "version": "1.9.1",
4
4
  "description": "A fast semantic-release alternative for monorepos, written in Rust",
5
5
  "keywords": [
6
6
  "changelog",
@@ -28,11 +28,11 @@
28
28
  "provenance": true
29
29
  },
30
30
  "optionalDependencies": {
31
- "super-release-darwin-arm64": "1.6.1",
32
- "super-release-linux-arm64": "1.6.1",
33
- "super-release-windows-x64": "1.6.1",
34
- "super-release-linux-x64": "1.6.1",
35
- "super-release-darwin-x64": "1.6.1"
31
+ "super-release-darwin-arm64": "1.7.1",
32
+ "super-release-darwin-x64": "1.7.1",
33
+ "super-release-linux-arm64": "1.7.1",
34
+ "super-release-linux-x64": "1.7.1",
35
+ "super-release-windows-x64": "1.7.1"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=20"