Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ const filesList = files.split( ',' );

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

const shouldPublishOnNPM = Boolean( process.env.NPM_TOKEN );

if ( shouldPublishOnNPM ) {
utils.log( `Will publish on npm` );
}

const getConfig = ({ gitBranchName }) => {
const branchType = gitBranchName.split("/")[0];
const githubConfig = {
Expand All @@ -35,6 +29,12 @@ const getConfig = ({ gitBranchName }) => {
githubConfig.failComment = false;
}

// Only publish alpha and release branches to NPM.
const shouldPublishOnNPM = Boolean( process.env.NPM_TOKEN ) && ["alpha", "release"].includes(branchType);
if ( shouldPublishOnNPM ) {
utils.log( `Will publish to npm.` );
}

const config = {
dryRun: otherArgs.dryRun,
ci: otherArgs.ci,
Expand Down