@sous-io/sous 0.2.0 → 0.2.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/docs/markdown/commands.md +1 -1
- package/docs/markdown/repositories-authoring.md +7 -6
- package/docs/markdown/repositories-file-formats.md +1 -1
- package/package.json +1 -1
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
- package/src/commands/repo/release.ts +14 -8
- package/src/lib/repos/scaffold/templates.ts +9 -7
|
@@ -246,7 +246,7 @@ These three run inside a recipe repository and take none of the config-locating
|
|
|
246
246
|
`sous repo release` plans first, asks once, and then bumps, regenerates the index, commits and
|
|
247
247
|
tags in one run. `--namespace` and `--recipe` are repeatable and narrow the run; `--check` reads
|
|
248
248
|
only and cannot be combined with `--bump`, `--tag` or `--push`; `--ci` is the merge preset and
|
|
249
|
-
implies `--no-bump
|
|
249
|
+
implies both `--no-bump` and `--yes`, so it prints the plan and carries it out without asking. See [Authoring a repository](repositories-authoring.md).
|
|
250
250
|
|
|
251
251
|
## Variables
|
|
252
252
|
|
|
@@ -287,7 +287,7 @@ Three facts about each recipe decide everything, and nothing else does:
|
|
|
287
287
|
| `sous repo release --tag` | Cut the tags even on a branch other than the default one |
|
|
288
288
|
| `sous repo release --push` | Push the commit, and the tags this run created, to `origin` |
|
|
289
289
|
| `sous repo release --check` | Read only: validate, and fail when the committed index is out of date |
|
|
290
|
-
| `sous repo release --ci` | The merge preset: never bump, never ask, fail on anything unbumped |
|
|
290
|
+
| `sous repo release --ci` | The merge preset: never bump, accept the plan, never ask, fail on anything unbumped |
|
|
291
291
|
|
|
292
292
|
### The branch rule
|
|
293
293
|
|
|
@@ -346,11 +346,12 @@ repository:
|
|
|
346
346
|
- On a **pull request**, `sous repo release --check`. It only reads, so it is safe on an
|
|
347
347
|
untrusted branch, and it fails the pull request when a manifest is wrong or the committed index
|
|
348
348
|
(including the dependencies it records) is stale.
|
|
349
|
-
- On a **push to the default branch**, `sous repo release --ci --push`. `--ci` raises no
|
|
350
|
-
and asks no questions: the version bump belongs in the
|
|
351
|
-
changed without one fails here rather than being given a
|
|
352
|
-
|
|
353
|
-
|
|
349
|
+
- On a **push to the default branch**, `sous repo release --ci --push --yes`. `--ci` raises no
|
|
350
|
+
versions, accepts the plan it prints, and asks no questions: the version bump belongs in the
|
|
351
|
+
change being merged, so a recipe that changed without one fails here rather than being given a
|
|
352
|
+
version nobody reviewed. `--ci` implies `--yes`; the workflow passes it as well so the same
|
|
353
|
+
file works with an older sous. Both checkouts use `fetch-depth: 0`, so existing tags are
|
|
354
|
+
visible and a published version is never cut a second time.
|
|
354
355
|
|
|
355
356
|
## Contribute to someone else's repository
|
|
356
357
|
|
|
@@ -1039,7 +1039,7 @@ that tag.
|
|
|
1039
1039
|
| `sous repo release --tag` | Cut the tags even on a branch other than the default one. |
|
|
1040
1040
|
| `sous repo release --push` | Push the commit, and the tags this run created, to `origin`. |
|
|
1041
1041
|
| `sous repo release --check` | Read only: validate, and fail when the committed index is out of date. This is what a pull request runs. |
|
|
1042
|
-
| `sous repo release --ci` | The merge preset: never bump, never ask, fail on anything unbumped. |
|
|
1042
|
+
| `sous repo release --ci` | The merge preset: never bump, accept the plan, never ask, fail on anything unbumped. |
|
|
1043
1043
|
|
|
1044
1044
|
Tags are cut dependency-first, and each version's resolved dependencies are written into the
|
|
1045
1045
|
index. On a branch other than the default one a release bumps and commits but cuts no tags,
|
package/package.json
CHANGED
|
@@ -77,7 +77,8 @@ const RELEASE_REMOTE = "origin";
|
|
|
77
77
|
*
|
|
78
78
|
* Two presets sit on top of it. `--check` is read-only and is what a pull
|
|
79
79
|
* request runs; `--ci` is the non-interactive form a merge runs, which bumps
|
|
80
|
-
* nothing because the version was raised in the change being merged
|
|
80
|
+
* nothing because the version was raised in the change being merged, and which
|
|
81
|
+
* accepts the plan it prints because there is nobody there to accept it.
|
|
81
82
|
*/
|
|
82
83
|
export default class RepoRelease extends Command {
|
|
83
84
|
static description =
|
|
@@ -106,7 +107,8 @@ export default class RepoRelease extends Command {
|
|
|
106
107
|
}),
|
|
107
108
|
ci: Flags.boolean({
|
|
108
109
|
description:
|
|
109
|
-
"Run the way a merge does: never bump, never ask, and fail on
|
|
110
|
+
"Run the way a merge does: never bump, accept the plan, never ask, and fail on " +
|
|
111
|
+
"anything unbumped",
|
|
110
112
|
default: false,
|
|
111
113
|
}),
|
|
112
114
|
namespace: Flags.string({
|
|
@@ -156,10 +158,14 @@ export default class RepoRelease extends Command {
|
|
|
156
158
|
const { flags } = await this.parse(RepoRelease);
|
|
157
159
|
const dryRun = flags["dry-run"];
|
|
158
160
|
const ci = flags.ci;
|
|
159
|
-
// The CI preset is exactly
|
|
160
|
-
//
|
|
161
|
-
//
|
|
161
|
+
// The CI preset is exactly three settings: never raise a version, accept
|
|
162
|
+
// the plan it prints, and never ask. Accepting the plan is part of the
|
|
163
|
+
// preset because there is nobody to ask: a run that only refused to ask
|
|
164
|
+
// would fail on the very confirmation the preset exists to answer. It
|
|
165
|
+
// deliberately does NOT imply --push; the workflow passes that itself, so
|
|
166
|
+
// what gets pushed is visible in the workflow file.
|
|
162
167
|
const noBump = flags["no-bump"] || ci;
|
|
168
|
+
const accepted = flags.yes || ci;
|
|
163
169
|
const interactive = ci ? false : isInteractive();
|
|
164
170
|
|
|
165
171
|
assertFlagsAgree({ ...flags, noBump });
|
|
@@ -222,7 +228,7 @@ export default class RepoRelease extends Command {
|
|
|
222
228
|
|
|
223
229
|
// --- Confirm ----------------------------------------------------------
|
|
224
230
|
|
|
225
|
-
if (!
|
|
231
|
+
if (!accepted) {
|
|
226
232
|
if (!interactive) {
|
|
227
233
|
throw nonInteractiveError({
|
|
228
234
|
prompt: "whether to publish the versions listed above",
|
|
@@ -232,8 +238,8 @@ export default class RepoRelease extends Command {
|
|
|
232
238
|
});
|
|
233
239
|
}
|
|
234
240
|
blankLine();
|
|
235
|
-
const
|
|
236
|
-
if (!
|
|
241
|
+
const answer = await askYesNo("Publish these versions?");
|
|
242
|
+
if (!answer) {
|
|
237
243
|
blankLine();
|
|
238
244
|
log(" Nothing was written.");
|
|
239
245
|
footer();
|
|
@@ -332,12 +332,14 @@ export function buildReleaseWorkflow(): string {
|
|
|
332
332
|
# declare. It only reads; it never writes, commits or tags. That makes it the
|
|
333
333
|
# right thing to run on a pull request.
|
|
334
334
|
#
|
|
335
|
-
# 'sous repo release --ci --push' does the same validation and then
|
|
336
|
-
# '--ci' raises no versions
|
|
337
|
-
# the change being merged, so a
|
|
338
|
-
#
|
|
339
|
-
# for every version that does not
|
|
340
|
-
# pushes the commit and those
|
|
335
|
+
# 'sous repo release --ci --push --yes' does the same validation and then
|
|
336
|
+
# publishes. '--ci' raises no versions, accepts the plan it prints, and asks
|
|
337
|
+
# no questions: the version bump belongs in the change being merged, so a
|
|
338
|
+
# recipe that changed without one fails here rather than being given a version
|
|
339
|
+
# nobody reviewed. It cuts an annotated tag for every version that does not
|
|
340
|
+
# have one yet, dependency-first, and '--push' pushes the commit and those
|
|
341
|
+
# tags. '--ci' implies '--yes'; passing it as well keeps this workflow working
|
|
342
|
+
# with a sous old enough that it did not.
|
|
341
343
|
|
|
342
344
|
name: sous release
|
|
343
345
|
|
|
@@ -385,7 +387,7 @@ jobs:
|
|
|
385
387
|
git config user.name "github-actions[bot]"
|
|
386
388
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
387
389
|
- name: Publish every new version
|
|
388
|
-
run: npx --yes @sous-io/sous repo release --ci --push
|
|
390
|
+
run: npx --yes @sous-io/sous repo release --ci --push --yes
|
|
389
391
|
`;
|
|
390
392
|
}
|
|
391
393
|
|