@r5n/sisyphus 0.4.8 β 0.6.0
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/LICENSE +1 -201
- package/README.md +127 -454
- package/dist/cli.js +202 -219
- package/dist/templates/github/sis-create-stone.yml +88 -0
- package/dist/templates/github/sis-release.yml +30 -0
- package/dist/templates/gitlab/sis-create-stone.yml +49 -0
- package/dist/templates/gitlab/sis-release.yml +13 -0
- package/package.json +6 -16
- package/schema.json +0 -112
package/README.md
CHANGED
|
@@ -1,546 +1,219 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://github.com/r5n-labs">
|
|
3
|
-
<img src="https://avatars.githubusercontent.com/u/99986752?s=400&v=4" alt="R5N Labs" width="100" height="100">
|
|
4
|
-
</a>
|
|
1
|
+
# Sisyphus
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
<p><em>πͺ¨ Because versioning shouldn't feel like pushing a boulder uphill</em></p>
|
|
3
|
+
Monorepo versioning and release tool. Pending changes are recorded as "stones" (JSON files in `.sisyphus/stones/`, in the spirit of changesets); rolling them bumps versions, writes changelogs, tags, publishes, and pushes in one step.
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@r5n/sisyphus) [](./LICENSE)
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
<a href="https://www.npmjs.com/package/@r5n/sisyphus">
|
|
13
|
-
<img src="https://img.shields.io/npm/v/@r5n/sisyphus.svg" alt="npm version">
|
|
14
|
-
</a>
|
|
15
|
-
<a href="https://github.com/r5n-labs/clis/blob/main/packages/sisyphus/LICENSE">
|
|
16
|
-
<img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License">
|
|
17
|
-
</a>
|
|
18
|
-
<img src="https://img.shields.io/badge/bundle%20size-~80KB-green.svg" alt="Bundle Size">
|
|
19
|
-
</p>
|
|
20
|
-
</div>
|
|
7
|
+
The binary is `sisyphus`, with `sis` as a short alias. Sisyphus runs on [Bun](https://bun.sh) and discovers packages from the `workspaces` globs in your root `package.json`.
|
|
21
8
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Overview
|
|
25
|
-
|
|
26
|
-
Ever wished you could stack up version changes like a todo list and release them all at once? That's Sisyphus. It revolutionizes how you handle versioning in monoreposβno more juggling multiple PRs or manual version bumps.
|
|
27
|
-
|
|
28
|
-
### β¨ Why You'll Love It
|
|
29
|
-
|
|
30
|
-
- πͺ¨ **Stack Your Changes** - Create "stones" as you work, release when you're ready
|
|
31
|
-
- π§ **Dependency Magic** - Updates related packages automatically (it just knows!)
|
|
32
|
-
- π **Changelogs That Write Themselves** - From commits to beautiful docs instantly
|
|
33
|
-
- π **One Command to Rule Them All** - Version, build, publish, tag - done!
|
|
34
|
-
- π·οΈ **Alpha to Stable Pipeline** - Smart prerelease promotion workflow
|
|
35
|
-
- π― **80KB of Excellence** - Faster than your npm install
|
|
36
|
-
- π **GitHub Native** - Creates releases and tags automatically
|
|
37
|
-
|
|
38
|
-
## π¬ See The Magic
|
|
39
|
-
|
|
40
|
-
<details>
|
|
41
|
-
<summary><strong>The stone system in action</strong></summary>
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
$ sisyphus init
|
|
45
|
-
β Initialize Sisyphus in single or multi package mode? Β· multi
|
|
46
|
-
β Which packages should be ignored? Β· @internal/scripts
|
|
47
|
-
β Select a tag for releases Β· latest
|
|
48
|
-
β Enable commit configuration? Β· Yes
|
|
49
|
-
β Commit message template Β· chore(release): $\{message}
|
|
50
|
-
β Enable changelog generation? Β· Yes
|
|
51
|
-
|
|
52
|
-
β¨ Sisyphus v0.3.42 is setup to roll stones.
|
|
53
|
-
|
|
54
|
-
$ sisyphus version
|
|
55
|
-
β Select packages for versioning:
|
|
56
|
-
β @myapp/auth
|
|
57
|
-
β @myapp/core
|
|
58
|
-
β― @myapp/utils
|
|
59
|
-
β Select bump type Β· minor
|
|
60
|
-
β Provide a summary for these changes Β· Add OAuth2 authentication
|
|
61
|
-
β Are you sure you want to create this stone? Β· Yes
|
|
62
|
-
|
|
63
|
-
β Stone created: proud-mountain
|
|
64
|
-
Location: .sisyphus/stones/proud-mountain.md
|
|
65
|
-
```
|
|
66
|
-
</details>
|
|
67
|
-
|
|
68
|
-
<details>
|
|
69
|
-
<summary><strong>Smart dependency tracking</strong></summary>
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
$ sisyphus check
|
|
73
|
-
πͺ¨ Pending stones (2):
|
|
74
|
-
|
|
75
|
-
1. proud-mountain
|
|
76
|
-
Created: 2 days ago
|
|
77
|
-
Message: Add OAuth2 authentication
|
|
78
|
-
|
|
79
|
-
Package changes:
|
|
80
|
-
β’ @myapp/auth: 1.2.0 β 1.3.0 (minor)
|
|
81
|
-
β’ @myapp/core: 2.1.0 β 2.1.1 (dependency)
|
|
82
|
-
|
|
83
|
-
2. gentle-river
|
|
84
|
-
Created: today
|
|
85
|
-
Message: Breaking API changes
|
|
86
|
-
|
|
87
|
-
Package changes:
|
|
88
|
-
β’ @myapp/api: 3.2.0 β 4.0.0 (major)
|
|
89
|
-
β’ @myapp/cli: 1.0.0 β 2.0.0 (dependency)
|
|
90
|
-
β’ @myapp/sdk: 2.5.0 β 3.0.0 (dependency)
|
|
91
|
-
|
|
92
|
-
Last release: v3.2.0 (1 week ago)
|
|
93
|
-
Ready to roll 5 packages with 2 stones
|
|
94
|
-
```
|
|
95
|
-
</details>
|
|
96
|
-
|
|
97
|
-
<details>
|
|
98
|
-
<summary><strong>One command release</strong></summary>
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
$ sisyphus roll --publish --github --changelog
|
|
102
|
-
πͺ¨ Rolling stones...
|
|
103
|
-
|
|
104
|
-
Processing 2 stones:
|
|
105
|
-
β’ proud-mountain
|
|
106
|
-
β’ gentle-river
|
|
107
|
-
|
|
108
|
-
π¦ Updating package versions:
|
|
109
|
-
β @myapp/auth: 1.2.0 β 1.3.0
|
|
110
|
-
β @myapp/core: 2.1.0 β 2.1.1
|
|
111
|
-
β @myapp/api: 3.2.0 β 4.0.0
|
|
112
|
-
β @myapp/cli: 1.0.0 β 2.0.0
|
|
113
|
-
β @myapp/sdk: 2.5.0 β 3.0.0
|
|
114
|
-
|
|
115
|
-
π Generating changelogs...
|
|
116
|
-
β Updated 5 CHANGELOG.md files
|
|
117
|
-
β Generated root CHANGELOG.md
|
|
118
|
-
|
|
119
|
-
π Publishing to npm...
|
|
120
|
-
β Published 5 packages
|
|
121
|
-
|
|
122
|
-
π·οΈ Creating git tags...
|
|
123
|
-
β Tagged 5 packages
|
|
124
|
-
β Created release tag: v4.0.0
|
|
125
|
-
|
|
126
|
-
π GitHub release created: v4.0.0
|
|
127
|
-
|
|
128
|
-
β Cleaned up 2 stones
|
|
129
|
-
β
Successfully rolled all stones!
|
|
130
|
-
```
|
|
131
|
-
</details>
|
|
132
|
-
|
|
133
|
-
## π¦ Installation
|
|
9
|
+
## Install
|
|
134
10
|
|
|
135
11
|
```bash
|
|
136
|
-
# Using Bun (recommended)
|
|
137
12
|
bun add -g @r5n/sisyphus
|
|
138
|
-
sisyphus --help
|
|
139
|
-
|
|
140
|
-
# Direct usage (no installation)
|
|
141
|
-
bunx @r5n/sisyphus --help
|
|
142
13
|
```
|
|
143
14
|
|
|
144
|
-
|
|
15
|
+
Or add it as a dev dependency and run it with `bunx @r5n/sisyphus`.
|
|
145
16
|
|
|
146
|
-
|
|
17
|
+
## Quick start
|
|
147
18
|
|
|
148
19
|
```bash
|
|
149
|
-
# Interactive setup
|
|
150
20
|
sisyphus init
|
|
151
|
-
|
|
152
|
-
# Non-interactive with options
|
|
153
|
-
sisyphus init --nonInteractive --tag latest
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### 2. Create Version Stones
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
# Interactive version creation
|
|
160
21
|
sisyphus version
|
|
161
|
-
|
|
162
|
-
# Quick version with commit message
|
|
163
|
-
sisyphus version "feat: add new feature" --packages @org/package-a:minor
|
|
164
|
-
|
|
165
|
-
# Specific version bump
|
|
166
|
-
sisyphus version --packages @org/core:major @org/utils:patch
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### 3. Roll Stones (Release)
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
# Check pending releases
|
|
173
22
|
sisyphus check
|
|
174
|
-
|
|
175
|
-
# Release with all features
|
|
176
|
-
sisyphus roll --publish --github
|
|
177
|
-
|
|
178
|
-
# Dry run to preview
|
|
179
|
-
sisyphus roll --dry-run
|
|
23
|
+
sisyphus roll
|
|
180
24
|
```
|
|
181
25
|
|
|
182
|
-
|
|
26
|
+
`init` writes `.sisyphus/config.json` (flag-driven; an interactive form lives in the `sis -i` menu). `version` with no arguments prompts you to pick packages per bump type and enter a message, then writes a stone. `check` shows workspace packages and what each pending stone will release. `roll` merges all pending stones, applies the version bumps, and deletes the stones.
|
|
183
27
|
|
|
184
|
-
|
|
185
|
-
Initialize Sisyphus in your project.
|
|
28
|
+
By default `roll` only updates files and creates the release commit. Publishing, tagging, pushing, and provider releases are opt-in via flags or the `release` section of the config.
|
|
186
29
|
|
|
187
|
-
|
|
188
|
-
- `-i, --ignore <packages>` - Packages to ignore (multiple allowed)
|
|
189
|
-
- `-n, --nonInteractive` - Skip interactive prompts
|
|
190
|
-
- `-o, --overwrite` - Overwrite existing configuration
|
|
191
|
-
- `-s, --single` - Single package mode (non-monorepo)
|
|
192
|
-
- `-t, --tag <tag>` - Default release tag (default: "latest")
|
|
30
|
+
## Commands
|
|
193
31
|
|
|
194
32
|
### `sisyphus version`
|
|
195
|
-
Create a new version stone (changeset).
|
|
196
33
|
|
|
197
|
-
|
|
198
|
-
- `-b, --bump <type>` - Bump type (major/minor/patch)
|
|
199
|
-
- `-d, --dryRun` - Preview changes without creating stone
|
|
200
|
-
- `-f, --filter <string>` - Filter packages by name
|
|
201
|
-
- `-s, --snapshot` - Create snapshot versions
|
|
202
|
-
- `-t, --tag <tag>` - Release tag (e.g., "beta", "alpha")
|
|
203
|
-
- `-y, --yes` - Skip confirmation prompt
|
|
34
|
+
Create a stone. Interactive when run without positionals; non-interactive with a message and package lists:
|
|
204
35
|
|
|
205
|
-
**Examples:**
|
|
206
36
|
```bash
|
|
207
|
-
|
|
208
|
-
sisyphus version
|
|
209
|
-
|
|
210
|
-
# Create stone with specific bump
|
|
211
|
-
sisyphus version --bump minor --filter @org/core
|
|
212
|
-
|
|
213
|
-
# Snapshot release
|
|
214
|
-
sisyphus version --snapshot --tag dev
|
|
215
|
-
|
|
216
|
-
# Skip confirmation
|
|
217
|
-
sisyphus version --yes
|
|
37
|
+
sisyphus version "feat: add auth" -m @org/auth -p @org/core
|
|
38
|
+
sisyphus version "fix: rc fixes" -p @org/api -t beta
|
|
39
|
+
sisyphus version --fromCommits
|
|
218
40
|
```
|
|
219
41
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
- `-
|
|
225
|
-
- `-d, --dryRun` - Preview release without publishing
|
|
226
|
-
- `-g, --github` - Create GitHub releases
|
|
227
|
-
- `-n, --npm` - Publish to npm
|
|
228
|
-
- `-r, --changelogRoot` - Generate root changelog
|
|
229
|
-
- `-t, --withTags` - Create git tags
|
|
230
|
-
- `--githubToken <token>` - GitHub authentication token
|
|
231
|
-
- `--npmToken <token>` - NPM authentication token
|
|
232
|
-
- `--rootTag <tag>` - Root package tag
|
|
42
|
+
- `-M, --major` / `-m, --minor` / `-p, --patch` β comma-separated package lists
|
|
43
|
+
- `--fromCommits` β generate stones from conventional commits since the last release (`lastStone` in config; `commits.skip` filters apply)
|
|
44
|
+
- `-t, --tag` β prerelease tag (e.g. `beta`), applied to the computed versions
|
|
45
|
+
- `-f, --filter` β filter workspace packages by name
|
|
46
|
+
- `-d, --dryRun`, `-y, --yes`
|
|
233
47
|
|
|
234
|
-
|
|
235
|
-
Check current stones and package states.
|
|
236
|
-
|
|
237
|
-
**Options:**
|
|
238
|
-
- `--debug` - Show debug information
|
|
239
|
-
- `--json` - Output in JSON format
|
|
240
|
-
|
|
241
|
-
**Output includes:**
|
|
242
|
-
- Pending stones with version changes
|
|
243
|
-
- Affected packages
|
|
244
|
-
- Dependency updates
|
|
245
|
-
- Last release information
|
|
246
|
-
|
|
247
|
-
### `sisyphus preview`
|
|
248
|
-
Preview what versions will be after rolling stones.
|
|
249
|
-
|
|
250
|
-
**Options:**
|
|
251
|
-
- `-j, --json` - Output in JSON format
|
|
252
|
-
- `-v, --verbose` - Show additional information
|
|
253
|
-
|
|
254
|
-
### `sisyphus prerelease`
|
|
255
|
-
Manage prerelease versions (alpha, beta, rc).
|
|
256
|
-
|
|
257
|
-
**Options:**
|
|
258
|
-
- `-t, --type <type>` - Prerelease type (alpha/beta/rc/canary/dev/next)
|
|
259
|
-
- `-b, --bump <type>` - Bump type (major/minor/patch)
|
|
260
|
-
- `-p, --promote` - Promote existing prereleases (interactive UI)
|
|
261
|
-
- `-f, --filter <string>` - Filter packages
|
|
262
|
-
- `-d, --dryRun` - Preview changes
|
|
263
|
-
- `-y, --yes` - Skip confirmation
|
|
264
|
-
|
|
265
|
-
**Promotion Flow:**
|
|
266
|
-
- **Alpha** β Beta, RC, or Stable
|
|
267
|
-
- **Beta** β RC or Stable
|
|
268
|
-
- **RC/Next** β Stable only
|
|
269
|
-
|
|
270
|
-
**Examples:**
|
|
271
|
-
```bash
|
|
272
|
-
# Create beta prerelease
|
|
273
|
-
sisyphus prerelease --type beta --bump minor
|
|
48
|
+
Packages that depend on the bumped ones are picked up automatically and get a dependency (patch-level) bump.
|
|
274
49
|
|
|
275
|
-
|
|
276
|
-
sisyphus prerelease --promote
|
|
50
|
+
### `sisyphus check`
|
|
277
51
|
|
|
278
|
-
|
|
279
|
-
sisyphus prerelease --type alpha --bump patch --filter @org/core --yes
|
|
280
|
-
```
|
|
52
|
+
Show the root package, workspace packages, and pending stones with the versions they will produce. `--json` for machine-readable output (used in CI), `-c, --config` to include the resolved config.
|
|
281
53
|
|
|
282
54
|
### `sisyphus stone`
|
|
283
|
-
Manage pending stones.
|
|
284
55
|
|
|
285
|
-
|
|
286
|
-
- `list` - View all pending stones
|
|
287
|
-
- `show <id>` - Display stone content
|
|
288
|
-
- `delete <id>` - Remove a stone
|
|
289
|
-
- `edit <id>` - Modify stone message
|
|
290
|
-
- `merge` - Combine multiple stones
|
|
56
|
+
Manage pending stones: `list` (`-j`, `-v`), `show <id>` (`-j`), `edit <id> -m "new message"`, `merge <id...> -m "message"` (`-d` deletes the originals; conflicting bumps resolve to the highest), `delete <id>`. Subcommands prompt for a stone when no id is given.
|
|
291
57
|
|
|
292
|
-
### `sisyphus
|
|
293
|
-
Visualize monorepo package dependencies.
|
|
58
|
+
### `sisyphus roll`
|
|
294
59
|
|
|
295
|
-
|
|
296
|
-
- `-j, --json` - Output in JSON format
|
|
297
|
-
- `-f, --filter <string>` - Filter to specific package
|
|
298
|
-
- `-d, --depth <number>` - Limit depth of dependency tree
|
|
299
|
-
- `-v, --show-versions` - Display package versions
|
|
60
|
+
Execute a release from all pending stones: bump versions, generate changelogs, delete the stones, commit, then optionally tag, publish, push, and create a provider release. Any step failure rolls back the created commit, tags, and file changes and restores the stones.
|
|
300
61
|
|
|
301
|
-
**Examples:**
|
|
302
62
|
```bash
|
|
303
|
-
|
|
304
|
-
sisyphus
|
|
63
|
+
sisyphus roll --dryRun
|
|
64
|
+
sisyphus roll -n -t -p -y
|
|
65
|
+
```
|
|
305
66
|
|
|
306
|
-
|
|
307
|
-
|
|
67
|
+
- `-c, --changelog` β generate changelogs (default from `changelog.generate`)
|
|
68
|
+
- `-n, --npm` β publish to npm (default from `release.npm`)
|
|
69
|
+
- `-t, --tags` β create `name@version` git tags (default from `release.tags`)
|
|
70
|
+
- `-p, --push` β push commits and tags (default from `release.push`)
|
|
71
|
+
- `-r, --createRelease` β create a release on the git provider (default from `release.createRelease`)
|
|
72
|
+
- `--noCommit` β skip the release commit (also disables tags, push, and provider release)
|
|
73
|
+
- `--preview` β write changelogs, show them, then offer to revert
|
|
74
|
+
- `--publishOnly` β publish from `currentRelease` recorded by `actions release-pr`, without touching files
|
|
75
|
+
- `-d, --dryRun`, `-y, --yes`
|
|
308
76
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
77
|
+
Publishing builds each package (`bun run build`) and runs `npm publish --tag <tag> --access public` in its directory. Private packages (`"private": true`) are skipped. Before publishing, each `package.json` is rewritten to a clean manifest: `workspace:` specifiers are resolved against the actual workspace versions (`workspace:*` pins the exact version, `workspace:^`/`workspace:~` become ranges), `catalog:` specifiers are resolved from the root `catalog`/`catalogs`, and `devDependencies` are stripped. The original file text is restored afterward, even if publishing fails.
|
|
78
|
+
|
|
79
|
+
### `sisyphus pr`
|
|
312
80
|
|
|
313
|
-
|
|
314
|
-
Show help information for commands.
|
|
81
|
+
Create a stone from a pull request (GitHub via the `gh` CLI, which must be installed and authenticated). Reads title, body, labels, commits, and changed files; the bump type comes from labels via `pr.labelMapping`, the title, `-b/--bump`, or a prompt. PRs matching `pr.skip` (labels, authors, title patterns) are ignored.
|
|
315
82
|
|
|
316
83
|
```bash
|
|
317
|
-
sisyphus
|
|
318
|
-
sisyphus help version
|
|
319
|
-
sisyphus version --help
|
|
84
|
+
sisyphus pr -u https://github.com/org/repo/pull/123 -y
|
|
320
85
|
```
|
|
321
86
|
|
|
322
|
-
|
|
87
|
+
### `sisyphus migrate`
|
|
323
88
|
|
|
324
|
-
|
|
89
|
+
Convert an existing `.changeset/` directory to stones and map supported changeset config (`ignore`, `commit`, `access`, `changelog`) onto the Sisyphus config. `-d, --dryRun`, `-y, --yes`.
|
|
325
90
|
|
|
326
|
-
|
|
91
|
+
### `sisyphus actions`
|
|
327
92
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
Wednesday: "Optimized database" β πͺ¨ Create stone
|
|
332
|
-
Thursday: "Ready to ship!" β π― Roll all stones!
|
|
333
|
-
```
|
|
93
|
+
CI integration. `actions init` detects your provider (GitHub Actions or GitLab CI) and installs workflow templates: a create-stone workflow that turns merged PRs into stones and maintains a release PR, and a release workflow that publishes when the release PR merges (`--all`, `--createStone`, `--release`, `-d`, `-y`). `actions release-pr` creates or updates the `sisyphus/release` branch and PR from pending stones, archives the stones to `.sisyphus/released/<timestamp>/`, and records `currentRelease` in the config for a later `roll --publishOnly`.
|
|
94
|
+
|
|
95
|
+
### `sisyphus init`
|
|
334
96
|
|
|
335
|
-
|
|
336
|
-
- β
Stack changes throughout the week
|
|
337
|
-
- β
Review everything before release
|
|
338
|
-
- β
Coordinate multi-package updates
|
|
339
|
-
- β
Never lose track of what needs releasing
|
|
340
|
-
- β
Git-friendly (stones are just markdown files)
|
|
97
|
+
Create or edit `.sisyphus/config.json`. Flag-driven when invoked directly (the interactive form lives in the `sis -i` menu); every form field has a matching flag (`--single`, `--tag`, `--npm`, `--tags`, `--push`, `--createRelease`, `--changelog`, `--rootChangelog`, `--commitAuthor`, `--commitEmail`, `--commitMessage`). `--default` resets to defaults, `--force` overwrites non-interactively. Also records the current HEAD as `lastStone`, the baseline for `version --fromCommits`.
|
|
341
98
|
|
|
342
|
-
|
|
99
|
+
## Configuration
|
|
343
100
|
|
|
344
|
-
|
|
101
|
+
`.sisyphus/config.json`, created by `init` (trimmed excerpt β `init` writes the full default set, including an extended `pr.labelMapping` and commit-skip patterns):
|
|
345
102
|
|
|
346
103
|
```json
|
|
347
104
|
{
|
|
348
|
-
"$schema": "https://raw.githubusercontent.com/r5n-labs/clis/
|
|
349
|
-
"tag": "latest",
|
|
350
|
-
"ignore": ["packages/*-internal"],
|
|
105
|
+
"$schema": "https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/sisyphus/schema.json",
|
|
351
106
|
"single": false,
|
|
107
|
+
"tag": "latest",
|
|
352
108
|
"commit": {
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"email": "bot@example.com"
|
|
356
|
-
},
|
|
357
|
-
"release": {
|
|
358
|
-
"github": true,
|
|
359
|
-
"npm": true,
|
|
360
|
-
"tags": true
|
|
109
|
+
"author": "r5n-bot",
|
|
110
|
+
"message": "chore(release): {message}"
|
|
361
111
|
},
|
|
362
112
|
"changelog": {
|
|
363
113
|
"generate": true,
|
|
364
|
-
"
|
|
114
|
+
"root": false,
|
|
115
|
+
"append": true,
|
|
116
|
+
"filename": "CHANGELOG.md",
|
|
117
|
+
"packageHeader": "{emoji} {version} ({date})",
|
|
118
|
+
"rootHeader": "{date} - {packages}"
|
|
119
|
+
},
|
|
120
|
+
"release": {
|
|
121
|
+
"npm": false,
|
|
122
|
+
"tags": false,
|
|
123
|
+
"push": false,
|
|
124
|
+
"createRelease": false
|
|
125
|
+
},
|
|
126
|
+
"commits": {
|
|
127
|
+
"skip": {
|
|
128
|
+
"authors": ["r5n-bot[bot]"],
|
|
129
|
+
"messagePatterns": ["^chore\\(release\\):"]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"pr": {
|
|
133
|
+
"labelMapping": { "breaking": "major", "feature": "minor", "fix": "patch" },
|
|
134
|
+
"skip": {
|
|
135
|
+
"labels": ["sisyphus-release", "skip-stone"],
|
|
136
|
+
"authors": ["r5n-bot[bot]"],
|
|
137
|
+
"titlePatterns": ["^chore\\(release\\):"]
|
|
138
|
+
}
|
|
365
139
|
}
|
|
366
140
|
}
|
|
367
141
|
```
|
|
368
142
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
| minor | patch |
|
|
381
|
-
| :-------: | :-----------------: |
|
|
382
|
-
| @org/auth | @org/core, @org/api |
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
## π Project Structure
|
|
386
|
-
|
|
387
|
-
```
|
|
388
|
-
your-project/
|
|
389
|
-
βββ .sisyphus/
|
|
390
|
-
β βββ config.json # Sisyphus configuration
|
|
391
|
-
β βββ stones/ # Pending version changes
|
|
392
|
-
β βββ feat-auth.md
|
|
393
|
-
β βββ fix-memory.md
|
|
394
|
-
βββ packages/
|
|
395
|
-
β βββ core/
|
|
396
|
-
β β βββ package.json
|
|
397
|
-
β β βββ CHANGELOG.md # Auto-generated
|
|
398
|
-
β βββ auth/
|
|
399
|
-
β βββ package.json
|
|
400
|
-
β βββ CHANGELOG.md
|
|
401
|
-
βββ CHANGELOG.md # Root changelog (optional)
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
## ποΈ Architecture
|
|
405
|
-
|
|
406
|
-
### Technology Stack
|
|
407
|
-
|
|
408
|
-
- **Runtime**: Bun (optimized for performance)
|
|
409
|
-
- **Validation**: Banditypes (lightweight schemas)
|
|
410
|
-
- **CLI Framework**: Custom with @clack/prompts
|
|
411
|
-
- **Bundle**: Fully self-contained with zero runtime dependencies
|
|
412
|
-
|
|
413
|
-
### How It Works
|
|
414
|
-
|
|
415
|
-
1. **Stone Creation**: Captures version intent without modifying files
|
|
416
|
-
2. **Dependency Resolution**: Analyzes workspace dependencies
|
|
417
|
-
3. **Version Calculation**: Determines final versions from all stones
|
|
418
|
-
4. **Release Pipeline**: Updates files, builds, publishes, and tags
|
|
419
|
-
5. **Cleanup**: Removes processed stones after success
|
|
420
|
-
|
|
421
|
-
## π Examples
|
|
422
|
-
|
|
423
|
-
### Monorepo Release Flow
|
|
424
|
-
|
|
425
|
-
```bash
|
|
426
|
-
# Monday: Feature development
|
|
427
|
-
sisyphus version --bump minor --filter @app/core
|
|
143
|
+
- `single` β version the root package instead of workspace packages
|
|
144
|
+
- `tag` β npm dist-tag used when publishing
|
|
145
|
+
- `commit` β release commit author/email and message template; `{message}` and `{packages}` are substituted
|
|
146
|
+
- `changelog` β `sections` maps conventional commit types (`feat`, `fix`, `breaking`, ...) to headings; `root` adds a combined root changelog; `packageHeader`/`rootHeader` support `{emoji}`, `{version}`, `{date}`, `{packages}`
|
|
147
|
+
- `commits.skip` / `pr.skip` β filters for `version --fromCommits` and `pr`
|
|
148
|
+
- `release` β defaults for the corresponding `roll` flags
|
|
149
|
+
- `sisyphusDir` / `stonesPath` β relocate the config directory or stone storage
|
|
150
|
+
- `lastStone`, `stones`, `currentRelease` β managed by the CLI; don't edit by hand
|
|
428
151
|
|
|
429
|
-
|
|
430
|
-
sisyphus version --bump patch --filter @app/auth
|
|
152
|
+
## Stones
|
|
431
153
|
|
|
432
|
-
|
|
433
|
-
sisyphus version --bump major --filter @app/api
|
|
154
|
+
Each stone is a JSON file at `.sisyphus/stones/<id>.json`, safe to commit and review:
|
|
434
155
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"id": "0001-741d2bed",
|
|
159
|
+
"message": "feat: add auth",
|
|
160
|
+
"description": "Optional longer notes",
|
|
161
|
+
"minor": ["@org/auth"],
|
|
162
|
+
"patch": ["@org/api"],
|
|
163
|
+
"dependency": ["@org/app"]
|
|
164
|
+
}
|
|
438
165
|
```
|
|
439
166
|
|
|
440
|
-
|
|
167
|
+
Stones may also carry a `tag` (prerelease) and the `commits` they were generated from. `roll` merges every pending stone, keeping the highest bump per package.
|
|
441
168
|
|
|
442
|
-
|
|
443
|
-
# Create beta versions
|
|
444
|
-
sisyphus version --bump minor --filter @org/new-feature --tag beta
|
|
445
|
-
|
|
446
|
-
# Roll beta release
|
|
447
|
-
sisyphus roll --npm
|
|
448
|
-
|
|
449
|
-
# Later, promote to stable
|
|
450
|
-
sisyphus version --bump minor --filter @org/new-feature --tag latest
|
|
451
|
-
sisyphus roll --npm
|
|
452
|
-
```
|
|
169
|
+
## GitHub Actions
|
|
453
170
|
|
|
454
|
-
|
|
171
|
+
A push-based release job, modeled on this repo's own workflow: roll whenever pending stones land on the main branch. Uses npm trusted publishing (OIDC), which needs `id-token: write` and npm >= 11.5.1, plus each package configured for trusted publishing on npmjs.com. If you don't use OIDC, `roll` publishes with plain `npm publish`, so a granular token in `~/.npmrc` (via `NPM_TOKEN`) works too.
|
|
455
172
|
|
|
456
173
|
```yaml
|
|
457
|
-
# .github/workflows/release.yml
|
|
458
174
|
name: Release
|
|
459
175
|
|
|
460
176
|
on:
|
|
461
177
|
push:
|
|
462
178
|
branches: [main]
|
|
463
179
|
|
|
180
|
+
permissions:
|
|
181
|
+
contents: write
|
|
182
|
+
id-token: write
|
|
183
|
+
|
|
464
184
|
jobs:
|
|
465
185
|
release:
|
|
466
186
|
runs-on: ubuntu-latest
|
|
187
|
+
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
|
|
467
188
|
steps:
|
|
468
189
|
- uses: actions/checkout@v4
|
|
469
190
|
with:
|
|
470
191
|
fetch-depth: 0
|
|
471
|
-
|
|
472
|
-
-
|
|
473
|
-
|
|
474
|
-
- name:
|
|
475
|
-
run: bun install
|
|
476
|
-
|
|
477
|
-
- name: Check for stones
|
|
478
|
-
id: check
|
|
192
|
+
- uses: oven-sh/setup-bun@v2
|
|
193
|
+
- run: bun install
|
|
194
|
+
- run: npm install -g npm@11
|
|
195
|
+
- name: Check for pending stones
|
|
479
196
|
run: |
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
197
|
+
COUNT=$(bunx @r5n/sisyphus check --json | jq '.stones | length')
|
|
198
|
+
echo "STONES_COUNT=$COUNT" >> "$GITHUB_ENV"
|
|
199
|
+
- name: Roll release
|
|
200
|
+
if: env.STONES_COUNT != '0'
|
|
201
|
+
run: |
|
|
202
|
+
git config user.name "github-actions[bot]"
|
|
203
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
204
|
+
bunx @r5n/sisyphus roll --yes
|
|
487
205
|
env:
|
|
488
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
489
206
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
490
207
|
```
|
|
491
208
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
### Token Management
|
|
495
|
-
|
|
496
|
-
- **NPM Publishing**: Requires `NPM_TOKEN` or `--npmToken`
|
|
497
|
-
- **GitHub Releases**: Requires `GITHUB_TOKEN` or `--githubToken`
|
|
498
|
-
- Tokens are never stored in configuration
|
|
499
|
-
- Use environment variables in CI/CD
|
|
500
|
-
|
|
501
|
-
### Best Practices
|
|
502
|
-
|
|
503
|
-
1. Review stones before rolling (`sisyphus check`)
|
|
504
|
-
2. Use dry-run mode for safety
|
|
505
|
-
3. Commit stones to version control
|
|
506
|
-
4. Set up branch protection for release branches
|
|
507
|
-
|
|
508
|
-
## π Troubleshooting
|
|
509
|
-
|
|
510
|
-
### Common Issues
|
|
511
|
-
|
|
512
|
-
1. **"No stones found"**
|
|
513
|
-
- Create stones with `sisyphus version` first
|
|
514
|
-
- Check `.sisyphus/stones/` directory
|
|
515
|
-
|
|
516
|
-
2. **"Package not found"**
|
|
517
|
-
- Verify package name in version command
|
|
518
|
-
- Check if package is ignored in config
|
|
519
|
-
|
|
520
|
-
3. **"Publish failed"**
|
|
521
|
-
- Verify NPM token permissions
|
|
522
|
-
- Check if version already exists
|
|
523
|
-
- Ensure package.json has required fields
|
|
524
|
-
|
|
525
|
-
### Debug Mode
|
|
526
|
-
|
|
527
|
-
```bash
|
|
528
|
-
# Verbose logging
|
|
529
|
-
DEBUG=* sisyphus roll --dry-run
|
|
530
|
-
|
|
531
|
-
# Check configuration
|
|
532
|
-
cat .sisyphus/config.json
|
|
533
|
-
|
|
534
|
-
# Inspect stones
|
|
535
|
-
ls -la .sisyphus/stones/
|
|
536
|
-
```
|
|
537
|
-
|
|
538
|
-
## π€ Contributing
|
|
209
|
+
On self-hosted runners, set `NPM_CONFIG_PROVENANCE: "false"` on the roll step; provenance generation only works on GitHub-hosted runners. For the PR-driven flow (stone per merged PR, rolling release PR, publish on merge), run `sisyphus actions init` and commit the generated workflows instead.
|
|
539
210
|
|
|
540
|
-
|
|
211
|
+
## Requirements
|
|
541
212
|
|
|
542
|
-
|
|
213
|
+
- Bun (the CLI is a Bun executable)
|
|
214
|
+
- git, with a `workspaces` field in the root `package.json` (unless `single`)
|
|
215
|
+
- `gh` CLI, authenticated, for GitHub PR and release operations (`pr`, `actions release-pr`, `roll --createRelease`); GitLab is supported via `GITLAB_TOKEN` or `glab`
|
|
543
216
|
|
|
544
|
-
|
|
217
|
+
## License
|
|
545
218
|
|
|
546
|
-
|
|
219
|
+
Apache 2.0 β see [LICENSE](./LICENSE)
|