Commit 99d8280 1 parent cb1ad4d commit 99d8280 Copy full SHA for 99d8280
File tree 2 files changed +53
-10
lines changed
2 files changed +53
-10
lines changed Original file line number Diff line number Diff line change
1
+ steps :
2
+ - block : " :rocket: Release!"
3
+ prompt : " Fill out the details for release"
4
+ if : ' build.message =~ /^release\$/i'
5
+ fields :
6
+ - text : " VERSION"
7
+ key : " version"
8
+ - text : " NPM_TAG"
9
+ key : " npm-tag"
10
+ default : ' null'
11
+ hint : ' Leave NULL if no version is specified'
12
+ required : false
13
+
14
+ - label : " Android"
15
+ command :
16
+ - " nvm install"
17
+ - " npm install"
18
+ - " npm run test-js"
19
+ - " npm run clean"
20
+ - " npm run test-unit-android -- --release"
21
+ key : android
22
+
23
+ - label : " iOS"
24
+ command :
25
+ - " nvm install"
26
+ - " npm install"
27
+ - " npm run test-unit-ios -- --release"
28
+ - " npm run test-e2e-ios -- --release --multi"
29
+ key : ios
30
+
31
+ - label : " :package: Publish"
32
+ if : " build.pull_request.id == null"
33
+ command :
34
+ - " nvm install"
35
+ - " npm install"
36
+ - " npm run release"
37
+ depends_on :
38
+ - " android"
39
+ - " ios"
Original file line number Diff line number Diff line change @@ -6,10 +6,20 @@ const _ = require('lodash');
6
6
const grenrc = require ( '../.grenrc' ) ;
7
7
8
8
// Workaround JS
9
- const isRelease = process . env . RELEASE_BUILD === 'true' ;
9
+ const isRelease = process . env . BUILDKITE_MESSAGE . match ( / ^ r e l e a s e $ / i) ;
10
+ const BRANCH = process . env . BUILDKITE_BRANCH ;
10
11
11
- const BRANCH = process . env . BRANCH ;
12
- const VERSION_TAG = process . env . NPM_TAG || isRelease ? 'latest' : 'snapshot' ;
12
+ let VERSION , VERSION_TAG ;
13
+ if ( isRelease ) {
14
+ VERSION = cp . execSync ( `buildkite-agent meta-data get version` ) . toString ( ) ;
15
+ VERSION_TAG = cp . execSync ( `buildkite-agent meta-data get npm-tag` ) . toString ( ) ;
16
+ }
17
+ // const VERSION_TAG = process.env.NPM_TAG || isRelease ? 'latest' : 'snapshot';
18
+ // const VERSION_INC = 'patch';
19
+
20
+ if ( VERSION_TAG == 'null' ) {
21
+ VERSION_TAG = isRelease ? 'latest' : 'snapshot' ;
22
+ }
13
23
const VERSION_INC = 'patch' ;
14
24
15
25
function run ( ) {
@@ -22,15 +32,9 @@ function run() {
22
32
}
23
33
24
34
function validateEnv ( ) {
25
- if ( ! process . env . JENKINS_CI ) {
35
+ if ( ! process . env . CI ) {
26
36
throw new Error ( `releasing is only available from CI` ) ;
27
37
}
28
-
29
- if ( ! process . env . JENKINS_MASTER ) {
30
- console . log ( `not publishing on a different build` ) ;
31
- return false ;
32
- }
33
-
34
38
return true ;
35
39
}
36
40
You can’t perform that action at this time.
0 commit comments