@theholocron/cli 5.0.0-alpha.475 → 5.0.0-alpha.476
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 +14 -9
- package/dist/cli.mjs +24 -3
- package/dist/cli.mjs.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -499,7 +499,7 @@ job execute the same thing — at a turbo root both are
|
|
|
499
499
|
### `holocron deploy on-release`
|
|
500
500
|
|
|
501
501
|
```bash
|
|
502
|
-
holocron deploy on-release [--channel <alpha|main>] [--from <commit>] [--to <commit>] [--dry-run]
|
|
502
|
+
holocron deploy on-release [--channel <alpha|main>] [--from <commit>] [--to <commit>] [--record-file <file>] [--record] [--dry-run]
|
|
503
503
|
```
|
|
504
504
|
|
|
505
505
|
Deploys every workspace package whose own `holocron.config` declares
|
|
@@ -514,14 +514,19 @@ doesn't succeed exits non-zero. The shared `release` workflow runs it as its own
|
|
|
514
514
|
`deploy` job after the release job (opt in with `deploy-on-release: true`).
|
|
515
515
|
|
|
516
516
|
Each package is compared from the commit it was last deployed at, not only from
|
|
517
|
-
`--from`: a successful deploy
|
|
518
|
-
(`@theholocron/sentinel` is `deployed/theholocron-sentinel`)
|
|
519
|
-
commit
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
517
|
+
`--from`: a successful deploy is recorded as a `deployed/<package>` tag
|
|
518
|
+
(`@theholocron/sentinel` is `deployed/theholocron-sentinel`) at the release
|
|
519
|
+
commit, so a release whose deploy job failed is made up by the next release,
|
|
520
|
+
even one that touches nothing in the app. A package with no tag yet (or one
|
|
521
|
+
whose tag is not an ancestor of `--to`) falls back to `--from`, and the skip line
|
|
522
|
+
then says `No deploy is recorded for it yet.`
|
|
523
|
+
|
|
524
|
+
The tag is written by a second step, so the deploy script never holds a write
|
|
525
|
+
token. `--record-file <file>` makes the deploy list the packages that deployed
|
|
526
|
+
(failed ones are left out) and write no tag; `--record --record-file <file>` then
|
|
527
|
+
tags and pushes them, reading the token from `GITHUB_TOKEN` and handing it to
|
|
528
|
+
`git push` in that command's environment only. A tag that cannot be pushed fails
|
|
529
|
+
that step, naming the package. `--dry-run` writes nothing.
|
|
525
530
|
|
|
526
531
|
### `holocron run ci`
|
|
527
532
|
|
package/dist/cli.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { appendFileSync, copyFileSync, existsSync, fstatSync, mkdirSync, mkdtemp
|
|
|
14
14
|
import { DRY_RUN_NOOP_EXIT_CODE, createCommandRegistry, createMenu, numeric } from "@theholocron/kyber/menu";
|
|
15
15
|
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
16
16
|
import { AuthError, DOTENV_FILE, copyToClipboard, createFeatureResolver as createFeatureResolver$1, createKeyring, dotenvLine, findCredential, finishCredentialsFile, hasCredentials, isGitIgnored, readDotenvFile, resolveValue as resolveValue$1, resolveValue as resolveValue$2, setCredentials, writeCredentialsFile } from "@theholocron/kyber/secrets";
|
|
17
|
-
import { DEFAULT_ORG, DOCUMENTATION_FLAG, DOT_GITHUB_REPO, HOLOCRON_REPO, KNOWN_TASKS, KNOWN_WORKFLOWS, LEGACY_NAMES, PNPM_BUILTIN_COMMANDS, PRERELEASE_CHANNEL, RELEASE_BRANCHES, RESERVED_SCRIPT_NAMES, SUITES, TASKS, aggregateChecks, checkPackageScripts, checkReleaseLines, codecovFlagNames, createAstromech, createCommitMsg, createDependabot, createDevmoji, createEditorconfig, createEditorconfigChecker, createHeader, createLabeler, createPreCommit, createPrePush, createPrepareCommitMsg, createYamlignore, createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, describeTasks, extractPreviewConfig, formatJson, frozenReusablePaths, generateThinCallerContent, hostedReusableWorkflows, isDeprecated, isTask, legacyCaller, legacyCallerFile, legacyGate, legacyWorkflowKey, localize, localizeActions, mergeScripts, packageLocation, readWorkspacePackages, resolveTaskName, reusableTemplates, scriptName, stampDeprecated, wedgeFix, workflowFile, workflowKey, workflowKeys, workspacePackages as workspacePackages$1 } from "@theholocron/astromech";
|
|
17
|
+
import { DEFAULT_ORG, DOCUMENTATION_FLAG, DOT_GITHUB_REPO, HOLOCRON_REPO, KNOWN_TASKS, KNOWN_WORKFLOWS, LEGACY_NAMES, PNPM_BUILTIN_COMMANDS, PRERELEASE_CHANNEL, RELEASE_BRANCHES, RESERVED_SCRIPT_NAMES, SUITES, TASKS, aggregateChecks, checkPackageScripts, checkReleaseLines, codecovFlagNames, createAstromech, createCommitMsg, createDependabot, createDevmoji, createEditorconfig, createEditorconfigChecker, createHeader, createLabeler, createPreCommit, createPrePush, createPrepareCommitMsg, createYamlignore, createYamllint, defaultListDirs, defaultPaths, defaultReadJson, deployOnRelease, describeTasks, extractPreviewConfig, formatJson, frozenReusablePaths, generateThinCallerContent, hostedReusableWorkflows, isDeprecated, isTask, legacyCaller, legacyCallerFile, legacyGate, legacyWorkflowKey, localize, localizeActions, mergeScripts, packageLocation, readWorkspacePackages, recordDeploys, resolveTaskName, reusableTemplates, scriptName, stampDeprecated, wedgeFix, workflowFile, workflowKey, workflowKeys, workspacePackages as workspacePackages$1 } from "@theholocron/astromech";
|
|
18
18
|
import { loadTasksConfig, releaseGroups } from "@theholocron/astromech/config";
|
|
19
19
|
import { createCliLogger, createCliTelemetry } from "@theholocron/kyber/observability";
|
|
20
20
|
import { resolveAxiomFromEnv } from "@theholocron/observability/logger";
|
|
@@ -333,7 +333,9 @@ const deployOnReleaseEntry = {
|
|
|
333
333
|
"files",
|
|
334
334
|
"channel",
|
|
335
335
|
"from",
|
|
336
|
-
"to"
|
|
336
|
+
"to",
|
|
337
|
+
"record-file",
|
|
338
|
+
"record"
|
|
337
339
|
],
|
|
338
340
|
supportsDryRun: true
|
|
339
341
|
};
|
|
@@ -5930,6 +5932,13 @@ const deployOnReleaseArgs = (y) => y.option("channel", {
|
|
|
5930
5932
|
}).option("to", {
|
|
5931
5933
|
type: "string",
|
|
5932
5934
|
describe: "The release commit. Default HEAD."
|
|
5935
|
+
}).option("record-file", {
|
|
5936
|
+
type: "string",
|
|
5937
|
+
describe: "A file the deploy lists the packages it deployed in (and `--record` reads), so a later step tags them."
|
|
5938
|
+
}).option("record", {
|
|
5939
|
+
type: "boolean",
|
|
5940
|
+
default: false,
|
|
5941
|
+
describe: "Tag and push the `deployed/<package>` marker of each package in --record-file, using GITHUB_TOKEN. Deploys nothing."
|
|
5933
5942
|
});
|
|
5934
5943
|
// src/commands/deploy/deploy-on-release.command.ts
|
|
5935
5944
|
const deployOnReleaseCommand = {
|
|
@@ -5937,13 +5946,25 @@ const deployOnReleaseCommand = {
|
|
|
5937
5946
|
describe: "Deploy every workspace package whose delivery.deploy task is `on: release` — run by the delivery.publish workflow's deploy job",
|
|
5938
5947
|
builder: deployOnReleaseArgs,
|
|
5939
5948
|
handler: async (argv) => {
|
|
5949
|
+
const print = (line) => console.log(line);
|
|
5950
|
+
if (argv.record) {
|
|
5951
|
+
if (recordDeploys({
|
|
5952
|
+
cwd: argv.cwd,
|
|
5953
|
+
file: argv.recordFile ?? "",
|
|
5954
|
+
token: createEnvLookup().get("GITHUB_TOKEN"),
|
|
5955
|
+
dryRun: argv.dryRun,
|
|
5956
|
+
print
|
|
5957
|
+
}).status === "fail") process.exitCode = 1;
|
|
5958
|
+
return;
|
|
5959
|
+
}
|
|
5940
5960
|
if ((await deployOnRelease({
|
|
5941
5961
|
cwd: argv.cwd,
|
|
5942
5962
|
channel: argv.channel,
|
|
5943
5963
|
...argv.from ? { from: argv.from } : {},
|
|
5944
5964
|
...argv.to ? { to: argv.to } : {},
|
|
5965
|
+
...argv.recordFile ? { recordFile: argv.recordFile } : {},
|
|
5945
5966
|
dryRun: argv.dryRun,
|
|
5946
|
-
print
|
|
5967
|
+
print
|
|
5947
5968
|
})).status === "fail") process.exitCode = 1;
|
|
5948
5969
|
}
|
|
5949
5970
|
};
|