Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ after_success:
- mkdir s3-publish
- cp nativescript*.tgz s3-publish/nativescript.tgz
before_deploy:
- node .travis/add-publishConfig.js next
- node .travis/add-publishConfig.js
deploy:
- provider: s3
bucket: nativescript-ci
Expand All @@ -43,3 +43,10 @@ deploy:
branch: master
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
- provider: npm
skip_cleanup: true
email: [email protected]
on:
branch: release
api_key:
secure: KzzsvF3eA3j4gRQa8tO//+XWNSR3XiX8Sa18o3PyKyG9/cBZ6PQ3Te74cNS1C3ZiLUOgs5dWA6/TmRVPci4XjvFaWo/B6e2fuVSl5H94Od99bkeBHJsbLSEkLN4ClV/YbGuyKgA5Q2yIFt6p2EJjL90RjbbIk7I4YuyG2Mo3j0Q=
17 changes: 8 additions & 9 deletions .travis/add-publishConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@

var fsModule = require('fs');

//Adds a publishConfig section to the package.json file
// Adds a publishConfig section to the package.json file
// and sets a tag to it

var path = './package.json';
var fileOptions = {encoding: "utf-8"};
var content = fsModule.readFileSync(path, fileOptions);

var tag = process.argv[2];
if (!tag) {
console.log('Please pass the tag name as an argument!');
process.exit(1);
}

var packageDef = JSON.parse(content);
if (!packageDef.publishConfig) {
packageDef.publishConfig = {};
}
packageDef.publishConfig.tag = tag;

if ($TRAVIS_BRANCH === 'release') {
packageDef.publishConfig.tag = 'rc';
} else {
packageDef.publishConfig.tag = 'next';
}

var newContent = JSON.stringify(packageDef, null, ' ');
fsModule.writeFileSync(path, newContent, fileOptions);
fsModule.writeFileSync(path, newContent, fileOptions);