Skip to content

Commit c0ada53

Browse files
committed
build: --skipPublish [skip ci]
1 parent 84810b9 commit c0ada53

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

scripts/release.mjs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ let {
2121
dry: isDryRun,
2222
skipCleanCheck: skipCleanGitCheck,
2323
noDepsUpdate,
24+
noPublish,
2425
} = args
2526

2627
if (args.h || args.help) {
@@ -35,6 +36,7 @@ Flags:
3536
--dry Dry run
3637
--skipCleanCheck Skip checking if the git repo is clean
3738
--noDepsUpdate Skip updating dependencies in package.json files
39+
--noPublish Skip publishing packages
3840
`.trim()
3941
)
4042
process.exit(0)
@@ -260,14 +262,18 @@ async function main() {
260262
await runIfNotDry('git', ['tag', `${pkg.name}@${pkg.version}`])
261263
}
262264

263-
step('\nPublishing packages...')
264-
for (const pkg of pkgWithVersions) {
265-
await publishPackage(pkg)
266-
}
265+
if (!noPublish) {
266+
step('\nPublishing packages...')
267+
for (const pkg of pkgWithVersions) {
268+
await publishPackage(pkg)
269+
}
267270

268-
step('\nPushing to Github...')
269-
await runIfNotDry('git', ['push', 'origin', ...versionsToPush])
270-
await runIfNotDry('git', ['push'])
271+
step('\nPushing to Github...')
272+
await runIfNotDry('git', ['push', 'origin', ...versionsToPush])
273+
await runIfNotDry('git', ['push'])
274+
} else {
275+
console.log(chalk.bold.white(`Skipping publishing...`))
276+
}
271277
}
272278

273279
/**

0 commit comments

Comments
 (0)