chore(ci): another attempt to program in .travis.yml
This commit is contained in:
parent
8fc519de56
commit
b20b323106
|
|
@ -37,7 +37,7 @@ script:
|
|||
jobs:
|
||||
include:
|
||||
- node_js: '12'
|
||||
before_deploy: npm run apply-next-version
|
||||
after_success: npm run apply-next-version
|
||||
deploy:
|
||||
- provider: npm
|
||||
src: "."
|
||||
|
|
|
|||
|
|
@ -2,12 +2,6 @@ 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.
|
||||
|
|
@ -25,7 +19,7 @@ let version = package.version;
|
|||
const dashIndex = version.indexOf('-');
|
||||
if (dashIndex !== -1)
|
||||
version = version.substring(0, dashIndex);
|
||||
version += '-next.' + process.env.TRAVIS_BUILD_NUMBER;
|
||||
version += '-next.' + Date.now();
|
||||
console.log('Setting version to ' + version);
|
||||
|
||||
execSync(`npm --no-git-tag-version version ${version}`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue