Skip to content

Commit 63a0e54

Browse files
authored
update version scripts (#887)
1 parent d2e3221 commit 63a0e54

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

packages/ringcentral-integration/gulpfile.babel.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,21 @@ async function exec(command) {
177177
}
178178

179179
async function getVersionFromTag() {
180+
let tag = process.env.TRAVIS_TAG;
181+
if (tag && /^\d+.\d+.\d+/.test(tag)) {
182+
return tag;
183+
}
180184
try {
181-
let tag = await exec('git describe --exact-match --tags $(git rev-parse HEAD)');
185+
tag = await exec('git describe --exact-match --tags $(git rev-parse HEAD)');
182186
console.log(tag);
183187
tag = tag.replace(/\r?\n|\r/g, '');
184188
if (/^\d+.\d+.\d+/.test(tag)) {
185189
return tag;
186190
}
187-
return null;
188191
} catch (e) {
189-
return null;
192+
console.error(e);
190193
}
194+
return null;
191195
}
192196

193197
const RELEASE_PATH = path.resolve(__dirname, '../../release/ringcentral-integration');
@@ -211,7 +215,7 @@ gulp.task('release', ['release-copy'], async () => {
211215
delete packageInfo.scripts;
212216
packageInfo.main = 'rc-phone.js';
213217
const version = await getVersionFromTag();
214-
console.log(version);
218+
console.log('version:', version);
215219
if (version) {
216220
packageInfo.version = version;
217221
}

packages/ringcentral-widgets/gulpfile.babel.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ import consolidateLocale from '@ringcentral-integration/locale-loader/lib/consol
1212
import localeSettings from 'locale-settings';
1313

1414
async function getVersionFromTag() {
15+
let tag = process.env.TRAVIS_TAG;
16+
if (tag && /^\d+.\d+.\d+/.test(tag)) {
17+
return tag;
18+
}
1519
try {
16-
let tag = await execa.shell('git describe --exact-match --tags $(git rev-parse HEAD)');
20+
tag = await execa.shell('git describe --exact-match --tags $(git rev-parse HEAD)');
1721
tag = tag.replace(/\r?\n|\r/g, '');
1822
if (/^\d+.\d+.\d+/.test(tag)) {
1923
return tag;
2024
}
21-
return null;
2225
} catch (e) {
23-
return null;
26+
console.error(e);
2427
}
28+
return null;
2529
}
2630

2731
const BUILD_PATH = path.resolve(__dirname, '../../build/ringcentral-widgets');
@@ -81,6 +85,7 @@ gulp.task('release', ['release-copy'], async () => {
8185
delete packageInfo.scripts;
8286
delete packageInfo.jest;
8387
const version = await getVersionFromTag();
88+
console.log('version:', version);
8489
if (version) {
8590
packageInfo.version = version;
8691
packageInfo.name = 'ringcentral-widgets';

0 commit comments

Comments
 (0)