diff --git a/.travis.yml b/.travis.yml index 867a0c76..1225dfc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ jobs: env: NODE7=true - node_js: "6.4.0" env: NODE6=true +before_deploy: "yarn run apply-next-version" deploy: provider: npm email: aslushnikov@gmail.com diff --git a/package.json b/package.json index 6fd5d65d..53e82d11 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "build": "node utils/node6-transform/index.js", "unit-node6": "node node6/test/test.js", "tsc": "tsc -p .", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "apply-next-version": "node utils/apply_next_version.js" }, "author": "The Chromium Authors", "license": "Apache-2.0", diff --git a/utils/apply_next_version.js b/utils/apply_next_version.js new file mode 100644 index 00000000..f85ad285 --- /dev/null +++ b/utils/apply_next_version.js @@ -0,0 +1,12 @@ +const path = require('path'); +const fs = require('fs'); + +const package = require('../package.json'); +let version = package.version; +const dashIndex = version.indexOf('-'); +if (dashIndex !== -1) + version = version.substring(0, dashIndex); +version += '-next.' + Date.now(); +console.log('Setting version to ' + version); +package.version = version; +fs.writeFileSync(path.join(__dirname, '..', 'package.json'), JSON.stringify(package, undefined, 2) + '\n'); \ No newline at end of file