Skip to content

Commit 8bc17f5

Browse files
chore(*): update release.js script
1 parent 3a60645 commit 8bc17f5

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

scripts/release.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!env node
22
"use strict";
33

4+
let version = require('../package.json').version;
5+
46
require('shelljs/global');
57
let readlineSync = require('readline-sync');
8+
let fs = require('fs');
9+
let path = require('path');
610
let util = require('./util');
711
let _exec = util._exec;
812

9-
let version = require('../package.json').version;
13+
cd(path.join(__dirname, '..'));
1014

1115
if (!readlineSync.keyInYN('Did you bump the version number in package.json?')) {
1216
process.exit(1);
@@ -16,12 +20,24 @@ if (!readlineSync.keyInYN('Did you update CHANGELOG.md using scripts/update_chan
1620
process.exit(1);
1721
}
1822

19-
if (!readlineSync.keyInYN('Did you commit/push all changes back to origin?')) {
23+
if (!readlineSync.keyInYN('Did you push all changes back to origin?')) {
24+
process.exit(1);
25+
}
26+
27+
if (!readlineSync.keyInYN('Ready to publish?')) {
2028
process.exit(1);
2129
}
2230

2331
util.ensureCleanMaster('master');
32+
33+
_exec('npm run package');
34+
_exec(`npm run docs`);
35+
36+
// publish to npm first
2437
_exec(`npm publish`);
38+
39+
// then tag and push tag
2540
_exec(`git tag ${version}`);
2641
_exec(`git push origin ${version}`);
2742

43+
console.log("\n\nAPI docs generated (but not deployed) at ./_docs");

0 commit comments

Comments
 (0)