Skip to content

Commit

Permalink
chore(ci): use TRAVIS_NEXT_NUMBER instead of Date.now()
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Feb 28, 2020
1 parent 583f7a0 commit d511d7d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/apply_next_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ const path = require('path');
const fs = require('fs');
const execSync = require('child_process').execSync;

if (!process.env.TRAVIS_BUILD_NUMBER) {
console.log('ERROR: TRAVIS_BUILD_NUMBER is not defined in env!');
process.exit(1);
return;
}

// Compare current HEAD to upstream master SHA.
// If they are not equal - refuse to publish since
// we're not tip-of-tree.
Expand All @@ -19,7 +25,7 @@ let version = package.version;
const dashIndex = version.indexOf('-');
if (dashIndex !== -1)
version = version.substring(0, dashIndex);
version += '-next.' + Date.now();
version += '-next.' + process.env.TRAVIS_BUILD_NUMBER;
console.log('Setting version to ' + version);

execSync(`npm --no-git-tag-version version ${version}`);
Expand Down

0 comments on commit d511d7d

Please sign in to comment.