From fea0b6912f7bd10268452ac87dc75f72e140d73c Mon Sep 17 00:00:00 2001 From: Mitchell Hentges Date: Sat, 14 May 2016 16:31:50 +0200 Subject: [PATCH] Set up CI servers --- .travis.yml | 39 +++++++++++++++++---------------------- appveyor.yml | 25 +++++++++++++++++++++++++ gulpfile.js | 30 ++++++++++-------------------- package.json | 16 +++++++++++----- 4 files changed, 63 insertions(+), 47 deletions(-) create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml index 2d4c3eaa..309e9810 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 \ No newline at end of file + - 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= \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..de8e1a68 --- /dev/null +++ b/appveyor.yml @@ -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 \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0246e696..ca911e2b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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']); @@ -57,7 +58,7 @@ gulp.task('resources', () => { ]); }); -gulp.task('package-resources', ['css'], () => { +gulp.task('dist-resources', ['css'], () => { const dest = 'package'; return es.merge([ @@ -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, @@ -91,30 +92,19 @@ 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']); @@ -122,7 +112,7 @@ gulp.task('watch', ['default'], () => { }); gulp.task('livereload', ['default'], () => { - var server = electronConnect.create({path: './build'}); + const server = electronConnect.create({path: './build'}); server.start(); const reload = () => server.reload(); diff --git a/package.json b/package.json index c1595fc8..624dda9e 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,25 @@ "name": "james", "version": "1.4.5", "description": "HTTP/HTTPS proxy built in Electron and ReactJS", + "author": "Julian Hollmann ", + "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 ", "dependencies": { "hoxy": "^3.2.0", "james-browser-launcher": "^1.2.1",