Skip to content

Commit 91548be

Browse files
committed
chore(): add release script
1 parent 645ded9 commit 91548be

File tree

4 files changed

+37
-120
lines changed

4 files changed

+37
-120
lines changed

lib/tasks/bumpversion.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

lib/tasks/createDocsJson.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
"ionic": "bin/ionic"
99
},
1010
"scripts": {
11-
"bump": "node lib/tasks/bumpversion",
12-
"beta-bump": "node lib/tasks/bumpversion --level pre --identifier beta",
13-
"lint": "eslint .",
14-
"publish-release": "node lib/tasks/bumpversion --npmPublish",
15-
"publish-tag": "node lib/tasks/bumpversion --level beta --npmPublishTag",
16-
"full-release": "node lib/tasks/bumpversion --npmInstall --git --npmPublish",
17-
"test": "npm run jasmine",
11+
"gh-release": "node scripts/release",
1812
"e2e": "jasmine-node --captureExceptions ./e2e",
19-
"jasmine": "jasmine-node --captureExceptions ./spec"
13+
"jasmine": "jasmine-node --captureExceptions ./spec",
14+
"lint": "eslint .",
15+
"test": "npm run jasmine"
2016
},
2117
"keywords": [
2218
"ionic",
@@ -86,7 +82,9 @@
8682
"unzip": "0.1.9"
8783
},
8884
"devDependencies": {
85+
"conventional-changelog-cli": "1.1.1",
8986
"eslint": "^2.8.0",
87+
"github": "0.2.4",
9088
"jasmine-node": "1.14.5",
9189
"rewire": "2.5.1"
9290
},

scripts/release.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var changelog = require('conventional-changelog');
2+
var GithubApi = require('github');
3+
var packageJSON = require('../package.json');
4+
var through = require('through2');
5+
6+
var github = new GithubApi({
7+
version: '3.0.0'
8+
});
9+
10+
github.authenticate({
11+
type: 'oauth',
12+
token: process.env.GH_TOKEN
13+
});
14+
15+
return changelog({
16+
preset: 'angular'
17+
})
18+
.pipe(through.obj(function(file, enc, cb){
19+
github.releases.createRelease({
20+
owner: 'driftyco',
21+
repo: 'ionic-cli',
22+
target_commitish: 'v2',
23+
tag_name: 'v' + packageJSON.version,
24+
name: packageJSON.version,
25+
body: file.toString(),
26+
prerelease: true,
27+
}, function(err, data){
28+
if (err) console.log('error: ' + err);
29+
console.log(data);
30+
});
31+
}));

0 commit comments

Comments
 (0)