Skip to content

Commit 99d8280

Browse files
committed
bk + release
1 parent cb1ad4d commit 99d8280

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

.buildkite/pipeline.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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"

scripts/release.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ const _ = require('lodash');
66
const grenrc = require('../.grenrc');
77

88
// Workaround JS
9-
const isRelease = process.env.RELEASE_BUILD === 'true';
9+
const isRelease = process.env.BUILDKITE_MESSAGE.match(/^release$/i);
10+
const BRANCH = process.env.BUILDKITE_BRANCH;
1011

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+
}
1323
const VERSION_INC = 'patch';
1424

1525
function run() {
@@ -22,15 +32,9 @@ function run() {
2232
}
2333

2434
function validateEnv() {
25-
if (!process.env.JENKINS_CI) {
35+
if (!process.env.CI) {
2636
throw new Error(`releasing is only available from CI`);
2737
}
28-
29-
if (!process.env.JENKINS_MASTER) {
30-
console.log(`not publishing on a different build`);
31-
return false;
32-
}
33-
3438
return true;
3539
}
3640

0 commit comments

Comments
 (0)