Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit ef9a589

Browse files
committed
chore(release): support publishing to NPM with tags other than latest
- default to 'latest' - allow 'next' to support RC releases Fixes #11873
1 parent 928c71d commit ef9a589

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

release.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
const lineWidth = 80;
1919
const lastMajorVer = JSON.parse(exec('curl https://material.angularjs.org/docs.json')).latest;
2020
let newVersion;
21+
let npmTag = 'latest';
2122

2223
try {
2324
child_process.execSync('gulp --version', defaultOptions);
@@ -26,6 +27,7 @@
2627
}
2728
header();
2829
const dryRun = prompt(`Is this a dry-run? [${"yes".cyan}/no] `, 'yes') !== 'no';
30+
npmTag = prompt(`What would you like the NPM tag to be? [${npmTag.cyan}/next] `, npmTag);
2931

3032
if (dryRun) {
3133
oldVersion = prompt(`What would you like the old version to be? (default: ${oldVersion.cyan}) `, oldVersion);
@@ -243,7 +245,7 @@
243245
done();
244246
// add steps to push script
245247
pushCmds.push(
246-
comment('push to bower (master and tag) and publish to npm'),
248+
comment(`push to bower (master and tag) and publish to npm as '${npmTag}'`),
247249
'cd ' + options.cwd,
248250
'cp ../CHANGELOG.md .',
249251
'git add CHANGELOG.md',
@@ -253,7 +255,7 @@
253255
'git push',
254256
'git push --tags',
255257
'rm -rf .git/',
256-
'npm publish',
258+
`npm publish --tag ${npmTag}`,
257259
'cd ..'
258260
);
259261
}

0 commit comments

Comments
 (0)