packaging: add a build task for rpi with compatible electron (#336)

This commit is contained in:
jean-emmanuel 2018-07-25 19:40:49 +02:00
parent f9632ffac3
commit 2b248fd3a0
4 changed files with 11 additions and 3 deletions

View file

@ -21,6 +21,7 @@ deploy:
before_deploy:
- export VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json)
- npm run package
- npm run package-rpi
- npm run deb32
- npm run deb64
- npm run debarm

View file

@ -58,6 +58,7 @@
"start": "cd app && npm start --",
"build": "npm run build-css && npm run build-js && echo 'JS and CSS assets built. To build the binary package, run \"npm run package\".'",
"package": "npm run build-css && npm run build-launcher-js && npm run build-browser-js -- --prod && node scripts/package.js",
"package-rpi": "npm run build-css && npm run build-launcher-js && npm run build-browser-js -- --prod && node scripts/package.js --rpi",
"deb32": "electron-installer-debian --src dist/open-stage-control-linux-ia32/ --arch i386 --dest dist/open-stage-control-linux-ia32/ --icon resources/images/logo.png",
"deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png",
"debarm": "electron-installer-debian --src dist/open-stage-control-linux-armv7l/ --arch armv7l --dest dist/open-stage-control-linux-armv7l/ --icon resources/images/logo.png",

View file

@ -114,6 +114,9 @@ export ARCH=TARGET_ARCH
npm run package
# For raspberry-pi / armv7l, run this instead
npm run package-rpi
# Do one of the following if you want a deb package for debian/ubuntu
npm run deb32
npm run deb64

View file

@ -3,15 +3,18 @@ const packager = require('electron-packager'),
appData = require('../app/package.json'),
safeFFMPEG = require('electron-packager-plugin-non-proprietary-codecs-ffmpeg').default
var rpi = process.argv.includes('--rpi')
packager({
dir: path.resolve(__dirname + '/../app'),
name: appData.name,
platform: process.env.PLATFORM,
arch: process.env.ARCH,
platform: rpi ? 'linux' : process.env.PLATFORM,
arch: rpi ? 'armv7l' : process.env.ARCH,
electronVersion: rpi ? '1.7.11' : undefined,
overwrite: true,
out: path.resolve(__dirname + '/../dist'),
icon: path.resolve(__dirname + '/../resources/images/logo'),
ignore: /node_modules\/(serialport|uws)/,
afterExtract: [safeFFMPEG],
prune: false
}, ()=>{})
}).then(()=>{})