Skip to content

Commit

Permalink
Set up CI servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell Hentges committed May 14, 2016
1 parent 28e5ba5 commit fea0b69
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 47 deletions.
39 changes: 17 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
sudo: required
dist: trusty
matrix:
include:
- os: osx
language: node_js
node_js:
- '5.1'
- '5.1'
addons:
apt:
packages:
- wine
- icnsutils
- graphicsmagick
script:
- npm --depth Infinity update
- npm run test-ci
before_deploy:
- npm run zip-binaries
deploy:
provider: releases
api_key:
secure: KEDggFkivi1iJbO/G4hicXznWk+bGA7sDuKSd36fBB9pIN/JSr08HlasrmqLmRva/rkHinbEdu+f75k/xh/m0UKll5jXUhmJVgbvNjPWQDtRSeeRM8UjveCL9wTZopkM4bLLxmWD2klyCC8qde5mMOJ1gRi+aPboGBgxEmtD69Bdhq1k3Dd2HTFnqQEh+8al2//+ayhne512Mo+lgwR1+4pLbhE/xK0iV7gQllRzTT2/ifbn5an8vbUkwfmm2NivNhSJTaPD2NndLvOVBKKQVcbIx+37gXO1Hn6F7Wr0MMHeh/ypJzGygxPQ2xZHtCKABw8jFetpFaFzm4xFcbyHsqclQlDLCv9J1e5DMvWk2ay29L9qWXT5dc7tnjaIVFPMEw4ViwIC30ThO44HHm6m+/tQAp3cDAD37uunp83wDAImbyCzZ3UoNLcmWHc39fxaD1s4Fzan3/++QbqSgdB+p4dXraxlRyqFcmKW+O5S+oGFolmdLuRbxPaaeIMMGm9AN7+fmGJgmiRzPU5k3/ao6eHoycXVPcIiuFV+2ZxvJS4ewqT+HiH6cNOFeeHEXx2O0fjEuj7mZG5Jey5GNsOdcq7loPnipcGbDnIHs+wRyqPCQ5aZ+94gQAemjBdtVnDTKd7RSjKHWmbo3Xx260XnwAEsTDtVuUJmyVjpIdCdNAs=
file:
- binaries/James-darwin-x64.zip
- binaries/James-linux-ia32.zip
- binaries/James-linux-x64.zip
- binaries/James-win32-ia32.zip
- binaries/James-win32-x64.zip
skip_cleanup: true
on:
repo: james-proxy/james
tags: true
- npm prune
- npm --depth Infinity update
- npm run test-ci
- npm run dist
cache:
apt: true
directories:
- node_modules
- $HOME/.electron
- node_modules
- "$HOME/.electron"
env:
global:
secure: JGVJJ2FeysfDzsh6sLiZZ4djQPKLA81SpBsph1cvo+FHB9E9fXiLNbIIqVALsq2b3nNgtUD/LFgYOTvfJbHr5P6ZP9oHJzh2Fv3O5WR+bPaaqVkSJKRuY7w1SBTxD0NG2+sZwR6/E0mEk6+TW27FSRccmAYCBjqBcLbpCw7wDBZXmmJ4kB2ziwFKyw7bwRrmW+pTQqYIun08sTCTlu7me4ucVEjqLTOVrYlbNIpmcKKzZs7jK+9SHtFjN2DeSnX8tu2go20M8TitkqESlQF8ztNGjkbdyC+mjRyCnfWvN8tv2SbV5EI62RPswd+bY4jIPM8aqrsMZ+pHc+nNIEc/nELhVfywPx2jfcYf6Egv36AIkVu3LJRUdhny/54cDDn2g7WT3BesX8gy0/rF59SNExdmNJHs8X3/of6ZLn8x9XvTmiKNbTYDjgc+ks3UvSRk//ToqtbziG2FKJ1wTZjKbnxyv7Ll3Z9PyAIc/7qlxvweloV5phTkL1DjU/9wHcn5BW07GXN5AH+FH7h5PyJurmJtBuC4Y9goRX+P78UuBT5rpAD5MXDeg82yb0DLZDKxaaXbzJpelqYGOZ6qUzEwTMZfvfi4YIy3BybU1L4K4j65vF+leve2JHV2poeRDLkOz5zCv596r0WlwE86sdqtO/obXwuwrDJieACkZvhfN3w=
25 changes: 25 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
platform:
- x64

cache:
- node_modules
- '%USERPROFILE%\.electron'

install:
- ps: $commit = git rev-parse HEAD
- ps: $version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
- ps: Update-AppveyorBuild -Version "$version-$commit"
- ps: Install-Product node 5 x64
- npm install
- npm prune
- npm --depth Infinity update

build_script:
- npm run test-ci
- npm run dist:win64

environment:
GH_TOKEN:
secure: HnT2ViVK97gtyZrlPH1C9zM/m3YErp8kY9FtO7wUhcoLG8TZiR1oLiBx+27eCWrX

test: off
30 changes: 10 additions & 20 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const jeditor = require('gulp-json-editor');
const version = require('./package.json').version;

gulp.task('default', ['js', 'css', 'resources']);
gulp.task('dist-prep', ['dist-resources', 'browserify']);

gulp.task('clean', () => {
return del.sync(['build', 'package', 'binaries']);
Expand Down Expand Up @@ -57,7 +58,7 @@ gulp.task('resources', () => {
]);
});

gulp.task('package-resources', ['css'], () => {
gulp.task('dist-resources', ['css'], () => {
const dest = 'package';

return es.merge([
Expand All @@ -72,9 +73,9 @@ gulp.task('package-resources', ['css'], () => {
]);
});

function gulpBrowserify(entry) {
gulp.task('browserify', ['js'], () => {
process.env.NODE_ENV = 'production';
return browserify(entry, {
const opts = {
builtins: false,
commondir: false,
browserField: false,
Expand All @@ -91,38 +92,27 @@ function gulpBrowserify(entry) {
transform: [
'envify'
]
}).bundle();
}
};

gulp.task('package-render', ['js'], () => {
gulpBrowserify('build/index.js')
browserify('build/index.js', opts)
.bundle()
.pipe(source('index.js'))
.pipe(gulp.dest('./package'));
});

gulp.task('package-main', ['js'], () => {
gulpBrowserify('build/electron-app.js')
browserify('build/electron-app.js', opts)
.bundle()
.pipe(source('electron-app.js'))
.pipe(gulp.dest('./package'));
});

gulp.task('package', ['package-resources', 'package-render', 'package-main'], (done) => {
console.log(`Packaging James v${version}...`);

builder.build({
dist: true,
arch: 'all'
}).then(done);
});

gulp.task('watch', ['default'], () => {
gulp.watch('src/**', ['js']);
gulp.watch('style/**', ['css']);
gulp.watch('resource-runtime/**', ['resources']);
});

gulp.task('livereload', ['default'], () => {
var server = electronConnect.create({path: './build'});
const server = electronConnect.create({path: './build'});
server.start();
const reload = () => server.reload();

Expand Down
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
"name": "james",
"version": "1.4.5",
"description": "HTTP/HTTPS proxy built in Electron and ReactJS",
"author": "Julian Hollmann <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/james-proxy/james.git"
},
"main": "electron-app.js",
"scripts": {
"build": "gulp",
"start": "electron ./build",
"watch": "gulp watch",
"development": "gulp livereload",
"package": "gulp clean package",
"zip-binaries": "cd binaries; rm *.zip; for i in *; do zip --symlinks -r \"${i%/}.zip\" \"$i\"; done",
"start": "electron ./build",
"lint": "eslint ./src ./test",
"test": "mocha --reporter dot --recursive -r setup-referee-sinon/globals test/unit --compilers js:babel-core/register",
"test-ci": "npm run lint && npm run test && npm run package"
"test-ci": "npm run lint && npm run test",
"package": "npm run dist",
"dist": "gulp clean dist-prep && build --arch all",
"dist:win64": "gulp clean dist-prep && build --platform win32 --arch x64"
},
"author": "Julian Hollmann <[email protected]>",
"dependencies": {
"hoxy": "^3.2.0",
"james-browser-launcher": "^1.2.1",
Expand Down

0 comments on commit fea0b69

Please sign in to comment.