Skip to content

Commit 158379c

Browse files
committed
HOTFIX: Android binary version alignment
1 parent 52eaae4 commit 158379c

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

scripts/ci.android-release.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
const exec = require('shell-utils').exec;
2-
const {log, logSection, getVersionSafe} = require('./ci.common');
2+
const {log, logSection, getVersionSafe, releaseNpmTag} = require('./ci.common');
33

44
function run() {
55
logSection('Initializing');
66
exec.execSync('lerna bootstrap --no-ci');
77

88
const versionType = process.env.RELEASE_VERSION_TYPE;
99
logSection(`Pre-calculating future version... (versionType=${versionType})`);
10-
exec.execSync(`lerna publish --cd-version "${versionType}" --yes --skip-git --skip-npm`);
10+
11+
const npmTag = releaseNpmTag();
12+
const preid = npmTag === 'latest'? '': `--preid=${npmTag}`;
13+
exec.execSync(`lerna publish --cd-version "${versionType}" --yes ${preid} --no-git-tag-version --no-push --skip-npm`);
1114
const futureVersion = getVersionSafe();
1215
log('Version is: ' + futureVersion);
1316
exec.execSync('git reset --hard');

scripts/ci.common.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,19 @@ function getVersionSafe() {
2222
return version;
2323
}
2424

25+
function releaseNpmTag() {
26+
if (process.env.RELEASE_NPM_TAG) {
27+
return process.env.RELEASE_NPM_TAG;
28+
} else if (process.env.GIT_BRANCH === 'master') {
29+
return 'latest';
30+
} else {
31+
return process.env.GIT_BRANCH;
32+
}
33+
}
34+
2535
module.exports = {
2636
log,
2737
logSection,
2838
getVersionSafe,
39+
releaseNpmTag
2940
};

scripts/ci.release.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* tslint:disable: no-console */
22
const exec = require('shell-utils').exec;
33
const fs = require('fs');
4-
const {log, logSection, getVersionSafe} = require('./ci.common');
4+
const {log, logSection, getVersionSafe, releaseNpmTag} = require('./ci.common');
55

66
const isRelease = (process.env.RELEASE_VERSION_TYPE && process.env.RELEASE_VERSION_TYPE !== 'none');
77

@@ -72,15 +72,6 @@ function versionTagAndPublish() {
7272
log(`Great success, much amaze`);
7373
}
7474

75-
function releaseNpmTag() {
76-
if (process.env.RELEASE_NPM_TAG) {
77-
return process.env.RELEASE_NPM_TAG;
78-
} else if (process.env.GIT_BRANCH === 'master') {
79-
return 'latest';
80-
} else {
81-
return process.env.GIT_BRANCH;
82-
}
83-
}
8475

8576
function findCurrentPublishedVersion() {
8677
return exec.execSyncRead(`npm view detox dist-tags.${releaseNpmTag()}`);

0 commit comments

Comments
 (0)