Browse Source

build(release): auto release on ci

Integrate electron-builder with our ci process so that electron builds
are created and published to a github release draft automatically.
renovate/lint-staged-8.x
Tom Kirkpatrick 7 years ago
parent
commit
1ac527117d
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 48
      .travis.yml
  2. 19
      appveyor.yml
  3. 93
      package.json
  4. 0
      resources/icons/icon.icns
  5. 0
      resources/icons/icon.ico
  6. 0
      resources/icons/icon.png

48
.travis.yml

@ -5,13 +5,14 @@ language: node_js
env: env:
global: global:
- DEBUG=electron-builder - DEBUG=electron-builder
matrix:
- TEST=lint-ci os:
- TEST=test-ci - linux
- osx
node_js: node_js:
- node - node
- 8 - lts/*
cache: cache:
apt: true apt: true
@ -24,14 +25,14 @@ cache:
addons: addons:
apt: apt:
packages: packages:
- icnsutils - xvfb
- graphicsmagick
- xz-utils
- xorriso
install: install:
- yarn - yarn
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" - |
if [ $TRAVIS_OS_NAME == "linux" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
fi
before_script: before_script:
- export DISPLAY=:99.0 - export DISPLAY=:99.0
@ -39,4 +40,31 @@ before_script:
- sleep 3 - sleep 3
script: script:
- "travis_wait 30 yarn $TEST" - yarn lint-ci || travis_terminate 1
- yarn build || travis_terminate 1
- yarn test-ci || travis_terminate 1
- yarn coveralls || travis_terminate 1
jobs:
include:
- stage: deploy
name: Deploy to Github
script: skip
deploy:
skip_cleanup: true
provider: script
script: yarn release
on:
repo: LN-Zap/zap-desktop
branch: master
- os: osx
name: Deploy to Github
script: skip
deploy:
skip_cleanup: true
provider: script
script: yarn release
on:
repo: LN-Zap/zap-desktop
branch: master

19
appveyor.yml

@ -1,13 +1,17 @@
os: unstable os: unstable
environment: environment:
DEBUG: electron-builder
matrix: matrix:
- nodejs_version: 10 - nodejs_version: STABLE
- nodejs_version: 8 publish_build: true
- nodejs_version: LTS
cache: cache:
- '%APPDATA%\npm-cache'
- "%LOCALAPPDATA%/Yarn" - "%LOCALAPPDATA%/Yarn"
- node_modules -> package.json - node_modules -> package.json
- flow-typed
- app/node_modules -> app/package.json - app/node_modules -> app/package.json
matrix: matrix:
@ -27,8 +31,9 @@ install:
- yarn - yarn
test_script: test_script:
- node --version - yarn lint-ci
- yarn lint - yarn build
- yarn package - yarn test-ci
- yarn test
- yarn test-e2e deploy_script:
- cmd: powershell if (($env:appveyor_repo_name -eq 'LN-Zap/zap-desktop') -and ($env:appveyor_repo_branch -eq 'master') -and ($env:publish_build)) { yarn release }

93
package.json

@ -10,6 +10,8 @@
"build-renderer": "webpack --require babel-register --config webpack.config.renderer.prod.js --progress", "build-renderer": "webpack --require babel-register --config webpack.config.renderer.prod.js --progress",
"build-grpc": "rimraf app/node_modules/grpc/src/node && build install-app-deps", "build-grpc": "rimraf app/node_modules/grpc/src/node && build install-app-deps",
"clean": "rimraf node_modules app/node_modules dll app/dist", "clean": "rimraf node_modules app/node_modules dll app/dist",
"coverage": "open coverage/index.html",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"dev": "cross-env START_HOT=1 npm run start-renderer-dev", "dev": "cross-env START_HOT=1 npm run start-renderer-dev",
"fetch-lnd": "node ./internals/scripts/fetch-lnd-for-packaging.js", "fetch-lnd": "node ./internals/scripts/fetch-lnd-for-packaging.js",
"flow": "flow", "flow": "flow",
@ -23,23 +25,18 @@
"lint-styles-fix-base": "npm run lint-styles-base -- --fix", "lint-styles-fix-base": "npm run lint-styles-base -- --fix",
"lint-styles-fix": "npm run lint-styles-fix-base -- $npm_package_config_style_paths", "lint-styles-fix": "npm run lint-styles-fix-base -- $npm_package_config_style_paths",
"lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check", "lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"lint-ci": "npm run lint && npm run lint-styles && npm run flow", "lint-ci": "npm run lint && npm run lint-styles",
"package": "npm run build && rimraf app/node_modules/grpc/src/node && npm run fetch-lnd && build --publish never", "package": "npm run build && npm run fetch-lnd && build",
"package-mac": "npm run package -- --platform mac --arch all && npm run build-grpc", "release": "npm run package -- --publish onTagOrDraft",
"package-win": "npm run package -- --platform win --arch all && npm run build-grpc",
"package-linux": "npm_config_target_libc=glibc npm run package -- --platform linux --arch all && npm run build-grpc",
"package-all": "npm run package-mac && npm run package-win && npm run package-linux",
"postinstall": "concurrently --raw \"npm:flow-typed\" \"npm:build-dll\" \"build install-app-deps\" \"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"", "postinstall": "concurrently --raw \"npm:flow-typed\" \"npm:build-dll\" \"build install-app-deps\" \"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json\"",
"prestart": "npm run build", "prestart": "npm run build",
"start": "cross-env NODE_ENV=production electron ./app/", "start": "cross-env NODE_ENV=production electron ./app/",
"start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r babel-register ./app/main.dev", "start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r babel-register ./app/main.dev",
"start-renderer-dev": "node --trace-warnings -r babel-register ./node_modules/webpack-serve/lib/cli.js --config webpack.config.renderer.dev.js", "start-renderer-dev": "node --trace-warnings -r babel-register ./node_modules/webpack-serve/lib/cli.js --config webpack.config.renderer.dev.js",
"test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js", "test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js",
"test-ci": "npm run package && npm run test-e2e && npm run test && npm run coveralls", "test-ci": "npm run test && npm run test-e2e",
"test-all": "npm run lint && npm run lint-styles && npm run flow && npm run build && npm run test-e2e && npm run test", "test-all": "npm run lint && npm run lint-styles && npm run flow && npm run build && npm run test && npm run test-e2e",
"test-e2e": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js e2e", "test-e2e": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings ./test/runTests.js e2e"
"coverage": "open coverage/index.html",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
}, },
"config": { "config": {
"style_paths": "app/styles/*.scss app/components/**/*.scss", "style_paths": "app/styles/*.scss app/components/**/*.scss",
@ -58,8 +55,9 @@
"yarn": ">=0.21.3" "yarn": ">=0.21.3"
}, },
"build": { "build": {
"productName": "Zap", "productName": "ZapDesktop",
"appId": "org.develar.ZapDesktop", "appId": "org.develar.ZapDesktop",
"generateUpdatesFilesForAllChannels": true,
"files": [ "files": [
"dist/", "dist/",
"node_modules/", "node_modules/",
@ -67,8 +65,31 @@
"main.prod.js.map", "main.prod.js.map",
"package.json" "package.json"
], ],
"directories": {
"buildResources": "resources",
"output": "release"
},
"extraResources": [
"resources/lnd.conf",
"resources/rpc.proto",
{
"from": "resources/bin/${os}/${arch}",
"to": "bin",
"filter": [
"lnd*"
]
}
],
"artifactName": "${productName}-${platform}-${arch}-v${version}.${ext}",
"mac": {
"category": "public.app-category.finance",
"icon": "resources/icons/icon.icns",
"target": [
"dmg",
"zip"
]
},
"dmg": { "dmg": {
"icon": "./resources/icon.icns",
"contents": [ "contents": [
{ {
"x": 130, "x": 130,
@ -83,33 +104,37 @@
] ]
}, },
"win": { "win": {
"icon": "./resources/icon.ico", "icon": "resources/icons/icon.ico",
"target": [ "target": [
"nsis" {
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
] ]
}, },
"linux": { "linux": {
"category": "Utility", "category": "Finance",
"icon": "resources/icons/icon.png",
"target": [ "target": [
"deb", {
"AppImage" "target": "deb",
"arch": [
"x64",
"ia32"
]
},
{
"target": "AppImage",
"arch": [
"x64",
"ia32"
]
}
] ]
}, }
"directories": {
"buildResources": "resources",
"output": "release"
},
"extraResources": [
"resources/lnd.conf",
"resources/rpc.proto",
{
"from": "resources/bin/${os}/${arch}",
"to": "bin",
"filter": [
"lnd*"
]
}
]
}, },
"repository": { "repository": {
"type": "git", "type": "git",

0
resources/icon.icns → resources/icons/icon.icns

0
resources/icon.ico → resources/icons/icon.ico

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 263 KiB

0
resources/icon.png → resources/icons/icon.png

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save