Skip to content

Commit

Permalink
Release-it | Push release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
onaliugo committed Oct 9, 2015
1 parent a1b74af commit 8833252
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions release-it/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ async.waterfall([
require('./commit/create'),
require('./tag/push'),
require('./commit/push'),
require('./release/publish'),
require('./release/push')
]);
13 changes: 13 additions & 0 deletions release-it/release/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var opts = require('../opts');
var log = require('../tools/log');
var exec = require('child_process').exec;

module.exports = function (cb) {
var cmd = 'curl --data \'{"tag_name": "' + opts.nextRelease.name + '","target_commitish": "master","name": "' + opts.nextRelease.name + '","body": "Release body","draft": true,"prerelease": false}\' https://api.github.com/repos/Wisembly/Tapestry/releases?access_token=' + opts.env.access_token;

exec(cmd, function (err, data) {
if (err) return false;
log('Release published ✓');
return cb(null);
});
};
4 changes: 1 addition & 3 deletions release-it/release/push.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
var opts = require('../opts');
var log = require('../tools/log');
var exec = require('child_process').exec;

module.exports = function (cb) {
var cmd = 'curl --data \'{"tag_name": "' + opts.nextRelease.name + '","target_commitish": "master","name": "' + opts.nextRelease.name + '","body": "Release body","draft": true,"prerelease": false}\' https://api.github.com/repos/Wisembly/Tapestry/releases?access_token=' + opts.env.access_token;
var cmd = 'git push origin master';

exec(cmd, function (err, data) {
if (err) return false;
log('Release published ✓');
return cb(null);
});
};

0 comments on commit 8833252

Please sign in to comment.