mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(travis): add irc task, simplify tweet task
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
var pkg = require('../package.json');
|
||||
|
||||
module.exports = {
|
||||
dist: 'dist',
|
||||
distJs: 'dist/js',
|
||||
@@ -93,5 +95,16 @@ module.exports = {
|
||||
'dist/js/angular/angular-sanitize.js',
|
||||
'dist/js/angular-ui/angular-ui-router.js',
|
||||
'dist/js/ionic-angular.js'
|
||||
]
|
||||
],
|
||||
|
||||
exclamations: [
|
||||
"Aah","Ah","Aha","All right","Aw","Ay","Aye","Bah","Boy","By golly","Boom","Cheerio","Cheers","Come on","Crikey","Dear me","Egads","Fiddle-dee-dee","Gadzooks","Gangway","G'day","Gee whiz","Gesundheit","Get outta here","Gosh","Gracious","Great","Gulp","Ha","Ha-ha","Hah","Harrumph","Hey","Hooray","Hurray","Huzzah","I say","Look","Look here","Long time","Lordy","Most certainly","My my","My word","Oh","Oh-oh","Oh no","Okay","Okey-dokey","Ooh","Oye","Phew","Quite","Ready","Right on","Roger that","Rumble","Say","See ya","Snap","Sup","Ta-da","Take that","Tally ho","Thanks","Toodles","Touche","Tut-tut","Very nice","Very well","Voila","Vroom","Well done","Well, well","Whoa","Whoopee","Whew","Word up","Wow","Wuzzup","Ya","Yea","Yeah","Yippee","Yo","Yoo-hoo","You bet","You don't say","You know","Yow","Yum","Yummy","Zap","Zounds","Zowie"
|
||||
],
|
||||
|
||||
releaseMessage: function() {
|
||||
return this.exclamations[Math.floor(Math.random()*this.exclamations.length)] + '! ' +
|
||||
'Just released @IonicFramework v' + pkg.version + ' "' + pkg.codename + '"! ' +
|
||||
'https://github.com/driftyco/ionic/releases/tag/v' + pkg.version;
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
35
gulpfile.js
35
gulpfile.js
@@ -12,9 +12,11 @@ var connect = require('connect');
|
||||
var dgeni = require('dgeni');
|
||||
var es = require('event-stream');
|
||||
var htmlparser = require('htmlparser2');
|
||||
var irc = require('ircb');
|
||||
var lunr = require('lunr');
|
||||
var marked = require('marked');
|
||||
var mkdirp = require('mkdirp');
|
||||
var twitter = require('node-twitter-api');
|
||||
var yaml = require('js-yaml');
|
||||
|
||||
var http = require('http');
|
||||
@@ -31,7 +33,6 @@ var rename = require('gulp-rename');
|
||||
var sass = require('gulp-sass');
|
||||
var stripDebug = require('gulp-strip-debug');
|
||||
var template = require('gulp-template');
|
||||
var twitter = require('gulp-twitter');
|
||||
var uglify = require('gulp-uglify');
|
||||
var gutil = require('gulp-util');
|
||||
|
||||
@@ -200,20 +201,36 @@ gulp.task('version', function() {
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('tweet', function() {
|
||||
gulp.task('release-tweet', function(done) {
|
||||
var oauth = {
|
||||
consumerKey: process.env.TWITTER_CONSUMER_KEY,
|
||||
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
|
||||
accessToken: process.env.TWITTER_ACCESS_TOKEN,
|
||||
accessTokenSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET
|
||||
};
|
||||
var exclamations = ["Aah","Ah","Aha","All right","Aw","Ay","Aye","Bah","Boy","By golly","Boom","Cheerio","Cheers","Come on","Crikey","Dear me","Egads","Fiddle-dee-dee","Gadzooks","Gangway","G'day","Gee whiz","Gesundheit","Get outta here","Good golly","Good job","Gosh","Gracious","Great","Gulp","Ha","Ha-ha","Hah","Hallelujah","Harrumph","Hey","Hooray","Hot dog","Hurray","Huzza","I say","La-di-dah","Look","Look here","Long time","Lordy","Most certainly","My my","My word","Oh","Oho","Oh-oh","Oh no","Okay","Okey-dokey","Ooh","Oye","Phew","Quite","Ready","Right on","Roger that","Rumble","Say","See ya","Snap","Sup","Ta-da","Take that","Tally ho","Thanks","Toodles","Touche","Tut-tut","Very nice","Very well","Voila","Vroom","Well done","Well, well","Whoa","Whoopee","Whew","Word up","Wow","Wuzzup","Ya","Yea","Yeah","Yippee","Yo","Yoo-hoo","You bet","You don't say","You know","Yow","Yum","Yummy","Zap","Zounds","Zowie"];
|
||||
if(IS_RELEASE_BUILD && argv.codeversion && argv.codename) {
|
||||
var tweet = exclamations[Math.floor(Math.random()*exclamations.length)]+'! Just released @IonicFramework '+argv.codename+' v'+argv.codeversion+' https://github.com/driftyco/ionic/releases/tag/v'+argv.codeversion;
|
||||
console.log(tweet);
|
||||
return gulp.src('package.json')
|
||||
.pipe(twitter(oauth, tweet));
|
||||
}
|
||||
var client = new twitter(oauth);
|
||||
client.statuses(
|
||||
'update',
|
||||
{ status: buildConfig.releaseMessage() },
|
||||
oauth.accessToken,
|
||||
oauth.accessTokenSecret,
|
||||
done
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('release-irc', function(done) {
|
||||
var client = irc({
|
||||
host: 'irc.freenode.net',
|
||||
secure: true,
|
||||
nick: 'ionitron',
|
||||
username: 'ionitron',
|
||||
realName: 'ionitron',
|
||||
channels: ['#ionic']
|
||||
}, function() {
|
||||
client.say('#ionic', buildConfig.releaseMessage(), function() {
|
||||
client.quit('', done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('docs-index', function() {
|
||||
|
||||
@@ -45,8 +45,9 @@
|
||||
"event-stream": "3.1.0",
|
||||
"gulp-strip-debug": "^0.3.0",
|
||||
"gulp-footer": "^1.0.4",
|
||||
"gulp-twitter": "0.0.3",
|
||||
"marked": "^0.3.2"
|
||||
"marked": "^0.3.2",
|
||||
"ircb": "^0.3.1",
|
||||
"node-twitter-api": "^1.2.2"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ function run {
|
||||
|
||||
echo "-- v$VERSION \"$CODENAME\" pushed to $RELEASE_REMOTE/master successfully!"
|
||||
|
||||
gulp tweet --release --codeversion "$VERSION" --codename "$CODENAME"
|
||||
gulp release-tweet release-irc
|
||||
}
|
||||
|
||||
source $(dirname $0)/../utils.inc
|
||||
|
||||
Reference in New Issue
Block a user