Skip to content

Commit

Permalink
chore(artifacts): Use target angular-hybrid version in tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed May 7, 2017
1 parent db9398e commit ccef213
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/artifact_tagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

let pkg = require('../package.json');
let version = pkg.version;
let hybridVersion = require('../../angular-hybrid/package.json').version;

require('shelljs/global');
let shx = require('shelljs');
let readlineSync = require('readline-sync');
let fs = require('fs');
let path = require('path');
let util = require('./util');
let _exec = util._exec;

cd(path.join(__dirname, '..'));
shx.cd(path.join(__dirname, '..'));

var widen = false;
var coreDep = pkg.dependencies['@uirouter/core'];
Expand All @@ -22,14 +23,17 @@ if (isNarrow && readlineSync.keyInYN('Widen @uirouter/core dependency from ' + c
widen = false;
}

if (!readlineSync.keyInYN('Ready to publish to ' + version + '-artifacts tag?')) {
let tagname = `${version}+hybrid-${hybridVersion}`;
tagname += readlineSync.question(`Suffix for tag ${tagname} (optional)?`);

if (!readlineSync.keyInYN(`Ready to publish ${tagname} tag?`)) {
process.exit(1);
}

util.ensureCleanMaster('master');

// then tag and push tag
_exec(`git checkout -b ${version}-artifacts-prep`);
_exec(`git checkout -b ${tagname}-prep`);

pkg.dependencies['@uirouter/core'] = widenedDep;
fs.writeFileSync("package.json", JSON.stringify(pkg, undefined, 2));
Expand All @@ -39,7 +43,7 @@ _exec('npm run package');

_exec(`git add --force lib lib-esm release package.json`);
_exec(`git commit -m 'chore(*): commiting build files'`);
_exec(`git tag ${version}-artifacts`);
_exec(`git push -u origin ${version}-artifacts`);
_exec(`git tag ${tagname}`);
_exec(`git push -u origin ${tagname}`);
_exec(`git checkout master`);
_exec(`git branch -D ${version}-artifacts-prep`);
_exec(`git branch -D ${tagname}-prep`);

0 comments on commit ccef213

Please sign in to comment.