forked from ionic-team/ionic-app-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-github-release.js
More file actions
33 lines (26 loc) · 938 Bytes
/
Copy pathcreate-github-release.js
File metadata and controls
33 lines (26 loc) · 938 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
var path = require('path');
var execSync = require('child_process').execSync;
var GithubApi = require('github');
var changelogCommand = './node_modules/.bin/conventional-changelog -p angular';
var packageJsonPath = path.join(__dirname, '..', 'package.json');
var packageJson = require(packageJsonPath);
var github = new GithubApi({ version: '3.0.0'});
github.authenticate({ type: 'oauth', token: process.env.GH_TOKEN });
var changelogContent = execSync(changelogCommand).toString();
github.releases.createRelease({
owner: 'driftyco',
repo: 'ionic-app-scripts',
target_commitish: 'master',
tag_name: 'v' + packageJson.version,
name: packageJson.version,
body: changelogContent,
prerelease: false
}, function(err, result) {
if (err) {
console.log('[create-github-release] An error occurred: ' + err.message);
process.exit(1);
}
else {
console.log('[create-github-release]: Process succeeded');
}
});