diff --git a/gulpfile.js b/gulpfile.js index 89c636890d..4157ba71e8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,3 +1,4 @@ +var GithubApi = require('github'); var gulp = require('gulp'); var path = require('canonical-path'); var pkg = require('./package.json'); @@ -229,10 +230,10 @@ gulp.task('release-tweet', function(done) { var client = new twitter(oauth); client.statuses( 'update', - { - status: argv.test ? - 'This is a test.' : - buildConfig.releaseMessage() + { + status: argv.test ? + 'This is a test.' : + buildConfig.releaseMessage() }, oauth.accessToken, oauth.accessTokenSecret, @@ -255,6 +256,30 @@ gulp.task('release-irc', function(done) { }); }); +gulp.task('release-github', function(done) { + var github = new GithubApi({ + version: '3.0.0' + }); + github.authenticate({ + type: 'oauth', + token: process.env.GH_TOKEN + }); + makeChangelog({ + standalone: true + }) + .then(function(log) { + var version = 'v' + pkg.version; + github.releases.createRelease({ + owner: 'driftyco', + repo: 'ionic', + tag_name: version, + name: version + ' "' + pkg.codename + '"', + body: log + }, done); + }) + .fail(done); +}); + gulp.task('release-discourse', function(done) { var oldPostUrl = buildConfig.releasePostUrl; var newPostUrl; @@ -270,11 +295,11 @@ gulp.task('release-discourse', function(done) { form: { api_key: process.env.DISCOURSE_TOKEN, api_username: 'Ionitron', - title: argv.test ? + title: argv.test ? ('This is a test. ' + Date.now()) : 'v' + pkg.version + ' "' + pkg.codename + '" released!', raw: argv.test ? - ('This is a test. Again! ' + Date.now()) : + ('This is a test. Again! ' + Date.now()) : content } }); diff --git a/package.json b/package.json index adacbd927f..ea33822b3f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "node-uuid": "^1.4.1", "js-yaml": "^3.0.2", "protractor": "^0.23.1", - "q": "^1.0.1" + "q": "^1.0.1", + "github": "^0.2.1" }, "licenses": [ { diff --git a/scripts/circle/deploy.sh b/scripts/circle/deploy.sh index 254c38659a..301d2d2768 100755 --- a/scripts/circle/deploy.sh +++ b/scripts/circle/deploy.sh @@ -35,6 +35,8 @@ function run { # Push release to ionic repo: release only if [[ "$IS_RELEASE" == "true" ]]; then ./scripts/release/publish.sh + node_modules/.bin/gulp release-discourse + node_modules/.bin/gulp release-github node_modules/.bin/gulp release-tweet node_modules/.bin/gulp release-irc fi diff --git a/scripts/release/publish.sh b/scripts/release/publish.sh index 4b415a25d2..a24538527b 100755 --- a/scripts/release/publish.sh +++ b/scripts/release/publish.sh @@ -34,7 +34,7 @@ function run { git add -A git commit -am "release: v$VERSION \"$CODENAME\"" - git tag -f -m v$VERSION v$VERSION + git tag -f v$VERSION git push -q origin master git push -q origin v$VERSION