Skip to content

Commit 0d5a951

Browse files
committed
fix(release): only publish alpha and production releases to NPM
1 parent 8c4c479 commit 0d5a951

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/release.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ const filesList = files.split( ',' );
1212

1313
utils.log( `Releasing ${ process.env.CIRCLE_PROJECT_REPONAME }…` );
1414

15-
const shouldPublishOnNPM = Boolean( process.env.NPM_TOKEN );
16-
17-
if ( shouldPublishOnNPM ) {
18-
utils.log( `Will publish on npm` );
19-
}
15+
let shouldPublishOnNPM = Boolean( process.env.NPM_TOKEN );
2016

2117
const getConfig = ({ gitBranchName }) => {
2218
const branchType = gitBranchName.split("/")[0];
@@ -35,6 +31,12 @@ const getConfig = ({ gitBranchName }) => {
3531
githubConfig.failComment = false;
3632
}
3733

34+
// Only publish alpha and release branches to NPM.
35+
shouldPublishOnNPM = shouldPublishOnNPM && ["alpha", "release"].includes(branchType);
36+
if ( shouldPublishOnNPM ) {
37+
utils.log( `Will publish to npm.` );
38+
}
39+
3840
const config = {
3941
dryRun: otherArgs.dryRun,
4042
ci: otherArgs.ci,

0 commit comments

Comments
 (0)