Skip to content

Commit 6e6baf4

Browse files
committed
Merge pull request #39 from parallaxinc/release
travis deploy to github releases upon tag - ref #30
2 parents 1dc838c + 7c307ec commit 6e6baf4

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ node_modules
2828
.lock-wscript
2929

3030
.DS_Store
31+
32+
# Generated files
3133
bundle.js
34+
dist/

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ before_install:
1010
- tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2
1111
- export PATH=$PWD:$PATH
1212
script: npm run ci
13+
# whenever a tag is pushed, we deploy to github releases
14+
before_deploy: npm run release
15+
deploy:
16+
provider: releases
17+
api_key: $GH_TOKEN
18+
file: "dist/chromeide.zip"
19+
skip_cleanup: true
20+
on:
21+
tags: true
22+
node: '0.10'
23+
all_branches: true

gulpfile.babel.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22

33
const path = require('path');
44

5+
const del = require('del');
56
const gulp = require('gulp');
67
const chalk = require('chalk');
8+
const zip = require('gulp-zip');
79
const gutil = require('gulp-util');
810
const webpack = require('webpack');
911

1012
const shouldWatch = (process.argv.indexOf('--watch') !== -1);
1113

14+
const files = {
15+
release: [
16+
'manifest.json',
17+
'index.html',
18+
'bundle.js',
19+
'background.js',
20+
'_locales/**',
21+
'icons/**'
22+
]
23+
};
24+
1225
const webpackConfig = {
1326
entry: './client.js',
1427
output: {
@@ -65,4 +78,20 @@ function js(cb){
6578
});
6679
}
6780

81+
function release(){
82+
return gulp.src(files.release, { base: __dirname })
83+
.pipe(zip('chromeide.zip'))
84+
.pipe(gulp.dest('dist'));
85+
}
86+
87+
function postinstall(cb){
88+
// .pem files cause Chrome to show a bunch of warnings
89+
// so we remove them on postinstall
90+
del('node_modules/**/*.pem', cb);
91+
}
92+
93+
gulp.task(release);
94+
gulp.task(postinstall);
95+
96+
gulp.task('gh-release', gulp.series(js, release));
6897
gulp.task('default', gulp.parallel(js));

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
"browser-serialport": "git://github.com/garrows/browser-serialport#update",
2727
"chalk": "^1.0.0",
2828
"css-loader": "^0.9.1",
29+
"del": "^1.1.1",
2930
"expect": "git://github.com/phated/expect",
3031
"gulp": "git://github.com/gulpjs/gulp#4.0",
3132
"gulp-util": "^3.0.4",
33+
"gulp-zip": "^2.0.3",
3234
"html-loader": "^0.2.3",
3335
"json-loader": "^0.5.1",
3436
"level-js": "^2.1.6",
@@ -41,7 +43,9 @@
4143
"scripts": {
4244
"test": "zuul test/*.js --local --open",
4345
"ci": "zuul test/*.js --phantom",
44-
"build": "gulp"
46+
"build": "gulp",
47+
"release": "gulp gh-release",
48+
"postinstall": "gulp postinstall"
4549
},
4650
"repository": {
4751
"type": "git",

0 commit comments

Comments
 (0)