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';
17
17
18
18
function run ( ) {
19
19
if ( ! validateEnv ( ) ) {
20
+ console . log ( 'Do not release demo' ) ;
20
21
return ;
21
22
}
23
+
24
+ console . log ( 'Release demo' ) ;
22
25
createNpmRc ( ) ;
23
26
versionTagAndPublish ( ) ;
24
27
}
@@ -27,7 +30,11 @@ function validateEnv() {
27
30
if ( ! process . env . CI ) {
28
31
throw new Error ( 'releasing is only available from CI' ) ;
29
32
}
30
- return true ;
33
+ return (
34
+ process . env . BUILDKITE_BRANCH === 'master' ||
35
+ process . env . BUILDKITE_BRANCH === 'release' ||
36
+ process . env . BUILDKITE_MESSAGE === 'snapshot'
37
+ ) ;
31
38
}
32
39
33
40
function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ const p = require('path');
3
3
4
4
function run ( ) {
5
5
if ( ! validateEnv ( ) ) {
6
+ console . log ( 'Do not release docs' ) ;
6
7
return ;
7
8
}
8
9
10
+ console . log ( 'Release docs' ) ;
9
11
const currentPublished = findCurrentPublishedVersion ( ) ;
10
12
const packageJson = require ( '../package.json' ) ;
11
13
const newVersion = packageJson . version ;
@@ -20,7 +22,7 @@ function validateEnv() {
20
22
if ( ! process . env . CI ) {
21
23
throw new Error ( 'releasing is only available from CI' ) ;
22
24
}
23
- return true ;
25
+ return process . env . BUILDKITE_BRANCH === 'master' ;
24
26
}
25
27
26
28
function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ const p = require('path');
3
3
4
4
function run ( ) {
5
5
if ( ! validateEnv ( ) ) {
6
+ console . log ( 'Do not release eslint' ) ;
6
7
return ;
7
8
}
8
9
10
+ console . log ( 'Release eslint' ) ;
9
11
const currentPublished = findCurrentPublishedVersion ( ) ;
10
12
const packageJson = require ( '../package.json' ) ;
11
13
const newVersion = packageJson . version ;
@@ -20,7 +22,7 @@ function validateEnv() {
20
22
if ( ! process . env . CI ) {
21
23
throw new Error ( 'releasing is only available from CI' ) ;
22
24
}
23
- return true ;
25
+ return process . env . BUILDKITE_BRANCH === 'master' ;
24
26
}
25
27
26
28
function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ const VERSION_TAG = IS_SNAPSHOT ? 'snapshot' : 'latest';
8
8
9
9
function run ( ) {
10
10
if ( ! validateEnv ( ) ) {
11
+ console . log ( 'Do not release native' ) ;
11
12
return ;
12
13
}
13
14
15
+ console . log ( 'Release native' ) ;
14
16
const packageJsonVersion = require ( '../package.json' ) . version ;
15
17
const currentPublished = findCurrentPublishedVersion ( ) ;
16
18
const newVersion = IS_SNAPSHOT
@@ -27,7 +29,7 @@ function validateEnv() {
27
29
if ( ! process . env . CI ) {
28
30
throw new Error ( 'releasing is only available from CI' ) ;
29
31
}
30
- return true ;
32
+ return process . env . BUILDKITE_BRANCH === 'master' || process . env . BUILDKITE_MESSAGE === 'snapshot' ;
31
33
}
32
34
33
35
function createNpmRc ( ) {
Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
18
18
const VERSION_INC = 'patch' ;
19
19
function run ( ) {
20
20
if ( ! validateEnv ( ) ) {
21
+ console . log ( 'Do not release' ) ;
21
22
return ;
22
23
}
24
+
25
+ console . log ( 'Release' ) ;
23
26
setupGit ( ) ;
24
27
createNpmRc ( ) ;
25
28
versionTagAndPublish ( ) ;
@@ -29,7 +32,11 @@ function validateEnv() {
29
32
if ( ! process . env . CI ) {
30
33
throw new Error ( 'releasing is only available from CI' ) ;
31
34
}
32
- return true ;
35
+ return (
36
+ process . env . BUILDKITE_BRANCH === 'master' ||
37
+ process . env . BUILDKITE_BRANCH === 'release' ||
38
+ process . env . BUILDKITE_MESSAGE === 'snapshot'
39
+ ) ;
33
40
}
34
41
35
42
function setupGit ( ) {
@@ -79,7 +86,6 @@ function tryPublishAndTag(version) {
79
86
}
80
87
}
81
88
82
-
83
89
function tagAndPublish ( newVersion ) {
84
90
console . log ( `trying to publish ${ newVersion } ...` ) ;
85
91
exec . execSync ( `npm --no-git-tag-version version ${ newVersion } ` ) ;
You can’t perform that action at this time.
0 commit comments