Skip to content

Commit

Permalink
chore(project): build distro via Travis
Browse files Browse the repository at this point in the history
* build distributions on Travis CI
* publish to GitHub releases

Related to #787
  • Loading branch information
nikku committed Jul 18, 2018
1 parent dbafbef commit 4af5756
Show file tree
Hide file tree
Showing 8 changed files with 543 additions and 41 deletions.
73 changes: 69 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
language: node_js
node_js: 'node'
cache:
directories:
- node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder

script:
- npm run all
jobs:
include:
- stage: test
node_js: node
language: node_js
script: "npm run all"
- stage: "distro [windows+linux]"
os: linux
services: docker
language: generic
script:
- |
docker run --rm \
--env-file <(env | grep -E 'DEBUG|NODE_|ELECTRON_|NPM_|CI|TRAVIS|WIN_CSC_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "npm i && npm run build -- --win --linux --publish"
- stage: "distro [macos]"
os: osx
osx_image: xcode9
node_js: node
language: node_js
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
script: npm run build -- --mac --publish
- stage: "nightly build [windows+linux]"
os: linux
services: docker
language: generic
script:
- |
docker run --rm \
--env-file <(env | grep -E 'DEBUG|NODE_|ELECTRON_|NPM_|CI|TRAVIS|WIN_CSC_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "npm i && npm run build -- --win --linux --nightly --no-publish"
- stage: "nightly build [macos]"
os: osx
osx_image: xcode9
node_js: node
language: node_js
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
script: npm run build -- --mac --nightly --no-publish

before_cache:
- rm -rf $HOME/.cache/electron-builder/wine

stages:
- test
- name: "distro [windows+linux]"
if: tag =~ ^v\d
- name: "distro [macos]"
if: tag =~ ^v\d
- name: "nightly build [windows+linux]"
if: type IN (cron)
- name: "nightly build [macos]"
if: type IN (cron)
4 changes: 2 additions & 2 deletions client/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ module.exports = function(grunt) {

grunt.registerTask('auto-test', [ 'karma:unit' ]);

grunt.registerTask('build-client', [
grunt.registerTask('build', [
'browserify:client',
'less',
'copy'
]);

grunt.registerTask('default', [
'test',
'build-client'
'build'
]);

grunt.registerTask('auto-build', [
Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"test": "cross-env NODE_ENV=test grunt test",
"auto-test": "cross-env NODE_ENV=test grunt auto-test",
"all": "cross-env NODE_ENV=production grunt",
"build": "cross-env NODE_ENV=production grunt build",
"dev": "cross-env NODE_ENV=development grunt auto-build"
},
"dependencies": {
Expand Down
12 changes: 3 additions & 9 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"appId": "com.camunda.CamundaModeler",
"productName": "Camunda Modeler",
"directories": {
"output": "distro"
},
"extraFiles": [
{
"from": "resources/platform/base",
"to": ".",
"filter": [ "**/*" ]
}
],
"files": [
{
"filter": [
Expand All @@ -34,7 +28,7 @@
]
},
"linux": {
"category": "Education",
"category": "Development",
"target": [
{
"target": "tar.gz",
Expand Down
Loading

0 comments on commit 4af5756

Please sign in to comment.