Skip to content

Commit 4fa1df3

Browse files
committed
chore(release): add release-discourse, release-github tasks
1 parent 50ee677 commit 4fa1df3

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

gulpfile.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var GithubApi = require('github');
12
var gulp = require('gulp');
23
var path = require('canonical-path');
34
var pkg = require('./package.json');
@@ -229,10 +230,10 @@ gulp.task('release-tweet', function(done) {
229230
var client = new twitter(oauth);
230231
client.statuses(
231232
'update',
232-
{
233-
status: argv.test ?
234-
'This is a test.' :
235-
buildConfig.releaseMessage()
233+
{
234+
status: argv.test ?
235+
'This is a test.' :
236+
buildConfig.releaseMessage()
236237
},
237238
oauth.accessToken,
238239
oauth.accessTokenSecret,
@@ -255,6 +256,30 @@ gulp.task('release-irc', function(done) {
255256
});
256257
});
257258

259+
gulp.task('release-github', function(done) {
260+
var github = new GithubApi({
261+
version: '3.0.0'
262+
});
263+
github.authenticate({
264+
type: 'oauth',
265+
token: process.env.GH_TOKEN
266+
});
267+
makeChangelog({
268+
standalone: true
269+
})
270+
.then(function(log) {
271+
var version = 'v' + pkg.version;
272+
github.releases.createRelease({
273+
owner: 'driftyco',
274+
repo: 'ionic',
275+
tag_name: version,
276+
name: version + ' "' + pkg.codename + '"',
277+
body: log
278+
}, done);
279+
})
280+
.fail(done);
281+
});
282+
258283
gulp.task('release-discourse', function(done) {
259284
var oldPostUrl = buildConfig.releasePostUrl;
260285
var newPostUrl;
@@ -270,11 +295,11 @@ gulp.task('release-discourse', function(done) {
270295
form: {
271296
api_key: process.env.DISCOURSE_TOKEN,
272297
api_username: 'Ionitron',
273-
title: argv.test ?
298+
title: argv.test ?
274299
('This is a test. ' + Date.now()) :
275300
'v' + pkg.version + ' "' + pkg.codename + '" released!',
276301
raw: argv.test ?
277-
('This is a test. Again! ' + Date.now()) :
302+
('This is a test. Again! ' + Date.now()) :
278303
content
279304
}
280305
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"node-uuid": "^1.4.1",
5454
"js-yaml": "^3.0.2",
5555
"protractor": "^0.23.1",
56-
"q": "^1.0.1"
56+
"q": "^1.0.1",
57+
"github": "^0.2.1"
5758
},
5859
"licenses": [
5960
{

scripts/circle/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function run {
3535
# Push release to ionic repo: release only
3636
if [[ "$IS_RELEASE" == "true" ]]; then
3737
./scripts/release/publish.sh
38+
node_modules/.bin/gulp release-discourse
39+
node_modules/.bin/gulp release-github
3840
node_modules/.bin/gulp release-tweet
3941
node_modules/.bin/gulp release-irc
4042
fi

scripts/release/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function run {
3434

3535
git add -A
3636
git commit -am "release: v$VERSION \"$CODENAME\""
37-
git tag -f -m v$VERSION v$VERSION
37+
git tag -f v$VERSION
3838

3939
git push -q origin master
4040
git push -q origin v$VERSION

0 commit comments

Comments
 (0)