File tree Expand file tree Collapse file tree 5 files changed +25
-6
lines changed
Expand file tree Collapse file tree 5 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ const VERSION_INC = 'patch';
1717
1818function run ( ) {
1919 if ( ! validateEnv ( ) ) {
20+ console . log ( 'Do not release demo' ) ;
2021 return ;
2122 }
23+
24+ console . log ( 'Release demo' ) ;
2225 createNpmRc ( ) ;
2326 versionTagAndPublish ( ) ;
2427}
@@ -27,7 +30,11 @@ function validateEnv() {
2730 if ( ! process . env . CI ) {
2831 throw new Error ( 'releasing is only available from CI' ) ;
2932 }
30- return true ;
33+ return (
34+ process . env . BUILDKITE_BRANCH === 'master' ||
35+ process . env . BUILDKITE_BRANCH === 'release' ||
36+ process . env . BUILDKITE_MESSAGE === 'snapshot'
37+ ) ;
3138}
3239
3340function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ const p = require('path');
33
44function run ( ) {
55 if ( ! validateEnv ( ) ) {
6+ console . log ( 'Do not release docs' ) ;
67 return ;
78 }
89
10+ console . log ( 'Release docs' ) ;
911 const currentPublished = findCurrentPublishedVersion ( ) ;
1012 const packageJson = require ( '../package.json' ) ;
1113 const newVersion = packageJson . version ;
@@ -20,7 +22,7 @@ function validateEnv() {
2022 if ( ! process . env . CI ) {
2123 throw new Error ( 'releasing is only available from CI' ) ;
2224 }
23- return true ;
25+ return process . env . BUILDKITE_BRANCH === 'master' ;
2426}
2527
2628function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ const p = require('path');
33
44function run ( ) {
55 if ( ! validateEnv ( ) ) {
6+ console . log ( 'Do not release eslint' ) ;
67 return ;
78 }
89
10+ console . log ( 'Release eslint' ) ;
911 const currentPublished = findCurrentPublishedVersion ( ) ;
1012 const packageJson = require ( '../package.json' ) ;
1113 const newVersion = packageJson . version ;
@@ -20,7 +22,7 @@ function validateEnv() {
2022 if ( ! process . env . CI ) {
2123 throw new Error ( 'releasing is only available from CI' ) ;
2224 }
23- return true ;
25+ return process . env . BUILDKITE_BRANCH === 'master' ;
2426}
2527
2628function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ const VERSION_TAG = IS_SNAPSHOT ? 'snapshot' : 'latest';
88
99function run ( ) {
1010 if ( ! validateEnv ( ) ) {
11+ console . log ( 'Do not release native' ) ;
1112 return ;
1213 }
1314
15+ console . log ( 'Release native' ) ;
1416 const packageJsonVersion = require ( '../package.json' ) . version ;
1517 const currentPublished = findCurrentPublishedVersion ( ) ;
1618 const newVersion = IS_SNAPSHOT
@@ -27,7 +29,7 @@ function validateEnv() {
2729 if ( ! process . env . CI ) {
2830 throw new Error ( 'releasing is only available from CI' ) ;
2931 }
30- return true ;
32+ return process . env . BUILDKITE_BRANCH === 'master' || process . env . BUILDKITE_MESSAGE === 'snapshot' ;
3133}
3234
3335function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
1818const VERSION_INC = 'patch' ;
1919function run ( ) {
2020 if ( ! validateEnv ( ) ) {
21+ console . log ( 'Do not release' ) ;
2122 return ;
2223 }
24+
25+ console . log ( 'Release' ) ;
2326 setupGit ( ) ;
2427 createNpmRc ( ) ;
2528 versionTagAndPublish ( ) ;
@@ -29,7 +32,11 @@ function validateEnv() {
2932 if ( ! process . env . CI ) {
3033 throw new Error ( 'releasing is only available from CI' ) ;
3134 }
32- return true ;
35+ return (
36+ process . env . BUILDKITE_BRANCH === 'master' ||
37+ process . env . BUILDKITE_BRANCH === 'release' ||
38+ process . env . BUILDKITE_MESSAGE === 'snapshot'
39+ ) ;
3340}
3441
3542function setupGit ( ) {
@@ -79,7 +86,6 @@ function tryPublishAndTag(version) {
7986 }
8087}
8188
82-
8389function tagAndPublish ( newVersion ) {
8490 console . log ( `trying to publish ${ newVersion } ...` ) ;
8591 exec . execSync ( `npm --no-git-tag-version version ${ newVersion } ` ) ;
You can’t perform that action at this time.
0 commit comments