Skip to content

Commit d9680b9

Browse files
committed
chore(travis): add irc task, simplify tweet task
1 parent 920dc59 commit d9680b9

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

config/build.config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var pkg = require('../package.json');
2+
13
module.exports = {
24
dist: 'dist',
35
distJs: 'dist/js',
@@ -93,5 +95,16 @@ module.exports = {
9395
'dist/js/angular/angular-sanitize.js',
9496
'dist/js/angular-ui/angular-ui-router.js',
9597
'dist/js/ionic-angular.js'
96-
]
98+
],
99+
100+
exclamations: [
101+
"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"
102+
],
103+
104+
releaseMessage: function() {
105+
return this.exclamations[Math.floor(Math.random()*this.exclamations.length)] + '! ' +
106+
'Just released @IonicFramework v' + pkg.version + ' "' + pkg.codename + '"! ' +
107+
'https://github.com/driftyco/ionic/releases/tag/v' + pkg.version;
108+
},
109+
97110
};

gulpfile.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ var connect = require('connect');
1212
var dgeni = require('dgeni');
1313
var es = require('event-stream');
1414
var htmlparser = require('htmlparser2');
15+
var irc = require('ircb');
1516
var lunr = require('lunr');
1617
var marked = require('marked');
1718
var mkdirp = require('mkdirp');
19+
var twitter = require('node-twitter-api');
1820
var yaml = require('js-yaml');
1921

2022
var http = require('http');
@@ -31,7 +33,6 @@ var rename = require('gulp-rename');
3133
var sass = require('gulp-sass');
3234
var stripDebug = require('gulp-strip-debug');
3335
var template = require('gulp-template');
34-
var twitter = require('gulp-twitter');
3536
var uglify = require('gulp-uglify');
3637
var gutil = require('gulp-util');
3738

@@ -200,20 +201,36 @@ gulp.task('version', function() {
200201
.pipe(gulp.dest('dist'));
201202
});
202203

203-
gulp.task('tweet', function() {
204+
gulp.task('release-tweet', function(done) {
204205
var oauth = {
205206
consumerKey: process.env.TWITTER_CONSUMER_KEY,
206207
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
207208
accessToken: process.env.TWITTER_ACCESS_TOKEN,
208209
accessTokenSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET
209210
};
210-
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"];
211-
if(IS_RELEASE_BUILD && argv.codeversion && argv.codename) {
212-
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;
213-
console.log(tweet);
214-
return gulp.src('package.json')
215-
.pipe(twitter(oauth, tweet));
216-
}
211+
var client = new twitter(oauth);
212+
client.statuses(
213+
'update',
214+
{ status: buildConfig.releaseMessage() },
215+
oauth.accessToken,
216+
oauth.accessTokenSecret,
217+
done
218+
);
219+
});
220+
221+
gulp.task('release-irc', function(done) {
222+
var client = irc({
223+
host: 'irc.freenode.net',
224+
secure: true,
225+
nick: 'ionitron',
226+
username: 'ionitron',
227+
realName: 'ionitron',
228+
channels: ['#ionic']
229+
}, function() {
230+
client.say('#ionic', buildConfig.releaseMessage(), function() {
231+
client.quit('', done);
232+
});
233+
});
217234
});
218235

219236
gulp.task('docs-index', function() {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
"event-stream": "3.1.0",
4646
"gulp-strip-debug": "^0.3.0",
4747
"gulp-footer": "^1.0.4",
48-
"gulp-twitter": "0.0.3",
49-
"marked": "^0.3.2"
48+
"marked": "^0.3.2",
49+
"ircb": "^0.3.1",
50+
"node-twitter-api": "^1.2.2"
5051
},
5152
"licenses": [
5253
{

scripts/travis/release-new-version.sh

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

5555
echo "-- v$VERSION \"$CODENAME\" pushed to $RELEASE_REMOTE/master successfully!"
5656

57-
gulp tweet --release --codeversion "$VERSION" --codename "$CODENAME"
57+
gulp release-tweet release-irc
5858
}
5959

6060
source $(dirname $0)/../utils.inc

0 commit comments

Comments
 (0)