forked from ionic-team/ionic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.js
More file actions
37 lines (34 loc) · 1000 Bytes
/
release.js
File metadata and controls
37 lines (34 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* This script will create a new github release using the verion
* specified from within the package.json file. The output from
* the changelog command will be the body of the tag. The name
* is the package.JSON.version
*/
var changelog = require('conventional-changelog');
var GithubApi = require('github');
var packageJSON = require('../package.json');
var through = require('through2');
var github = new GithubApi({
version: '3.0.0'
});
github.authenticate({
type: 'oauth',
token: process.env.GH_TOKEN
});
return changelog({
preset: 'angular'
})
.pipe(through.obj(function(file) {
github.releases.createRelease({
owner: 'driftyco',
repo: 'ionic-cli',
target_commitish: 'v2', // eslint-disable-line camelcase
tag_name: 'v' + packageJSON.version, // eslint-disable-line camelcase
name: packageJSON.version,
body: file.toString(),
prerelease: true
}, function(err, data) {
if (err) console.log('error: ' + err);
console.log(data);
});
}));