mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(release): add release-discourse, release-github tasks
This commit is contained in:
37
gulpfile.js
37
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
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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": [
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user