build deb and appImage separately

this is to unsure that the afterpack hook is not called when building
the app deb package
pull/1804/head
Audric Ackermann 4 years ago
parent 8ab8444222
commit 57b22cbdda
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -76,7 +76,7 @@ jobs:
- name: Build linux production binaries - name: Build linux production binaries
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: $(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --publish=never --config.directories.output=release run: yarn build-release
- name: Remove unpacked files - name: Remove unpacked files
run: | run: |

@ -10,21 +10,21 @@ module.exports = async function(context) {
if (process.platform !== 'linux') { if (process.platform !== 'linux') {
return; return;
} }
const isAppImage = context.targets.find(target => target.name === 'appImage'); const isAppImage = context.targets.name === 'appImage';
console.log( console.log(
'targets', 'targets',
context.targets.map(target => target.name) context.targets.map(target => target.name)
); );
console.log('AppImage', isAppImage.options); console.log('AppImage', isAppImage);
if (!isAppImage) { if (!isAppImage) {
console.log('afterPack hook not triggered', context); console.log('afterPack hook not triggered as this is not an appImage build:', context);
return; return;
} }
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('afterPack hook triggered', context); // console.log('afterPack hook triggered', context);
const executableName = context.packager.executableName; const executableName = context.packager.executableName;
const sourceExecutable = path.join(context.appOutDir, executableName); const sourceExecutable = path.join(context.appOutDir, executableName);

@ -21,7 +21,11 @@
"grunt": "grunt", "grunt": "grunt",
"grunt:dev": "yarn clean-transpile; yarn grunt dev --force", "grunt:dev": "yarn clean-transpile; yarn grunt dev --force",
"generate": "yarn grunt --force", "generate": "yarn grunt --force",
"build-release": "cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release", "build-release": "run-script-os",
"build-release-non-linux": "cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release",
"build-release:win32": "yarn build-release-non-linux",
"build-release:macos": "yarn build-release-non-linux",
"build-release:linux": "cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release && yarn sedtoAppImage && cross-env SIGNAL_ENV=production electron-builder --config.extraMetadata.environment=production --publish=never --config.directories.output=release; yarn sedtoDeb",
"build-module-protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long", "build-module-protobuf": "pbjs --target static-module --wrap commonjs --out ts/protobuf/compiled.js protos/*.proto && pbts --out ts/protobuf/compiled.d.ts ts/protobuf/compiled.js --force-long",
"clean-module-protobuf": "rimraf ts/protobuf/compiled.d.ts ts/protobuf/compiled.js", "clean-module-protobuf": "rimraf ts/protobuf/compiled.d.ts ts/protobuf/compiled.js",
"build-protobuf": "yarn build-module-protobuf", "build-protobuf": "yarn build-module-protobuf",
@ -40,7 +44,9 @@
"transpile:watch": "tsc -w", "transpile:watch": "tsc -w",
"clean-transpile": "rimraf 'ts/**/*.js ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;", "clean-transpile": "rimraf 'ts/**/*.js ts/*.js' 'ts/*.js.map' 'ts/**/*.js.map' && rimraf tsconfig.tsbuildinfo;",
"ready": "yarn clean-transpile; yarn grunt && yarn lint-full && yarn test", "ready": "yarn clean-transpile; yarn grunt && yarn lint-full && yarn test",
"build:webpack:sql-worker": "cross-env NODE_ENV=production webpack -c webpack-sql-worker.config.ts" "build:webpack:sql-worker": "cross-env NODE_ENV=production webpack -c webpack-sql-worker.config.ts",
"sedtoAppImage": "sed -i 's/\"target\": \"deb\"/\"target\": \"AppImage\"/g' package.json",
"sedtoDeb": "sed -i 's/\"target\": \"AppImage\"/\"target\": \"deb\"/g' package.json"
}, },
"dependencies": { "dependencies": {
"@reduxjs/toolkit": "^1.4.0", "@reduxjs/toolkit": "^1.4.0",
@ -200,6 +206,7 @@
"postinstall-prepare": "^1.0.1", "postinstall-prepare": "^1.0.1",
"prettier": "1.19.0", "prettier": "1.19.0",
"qs": "6.5.1", "qs": "6.5.1",
"run-script-os": "^1.1.6",
"sinon": "9.0.2", "sinon": "9.0.2",
"spectron": "^10.0.0", "spectron": "^10.0.0",
"ts-loader": "4.1.0", "ts-loader": "4.1.0",
@ -263,10 +270,7 @@
"StartupWMClass": "Session" "StartupWMClass": "Session"
}, },
"asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries", "asarUnpack": "node_modules/spellchecker/vendor/hunspell_dictionaries",
"target": [ "target": "deb",
"deb",
"AppImage"
],
"icon": "build/icon.icns" "icon": "build/icon.icns"
}, },
"asarUnpack": [ "asarUnpack": [

@ -8135,6 +8135,11 @@ run-async@^2.2.0:
dependencies: dependencies:
is-promise "^2.1.0" is-promise "^2.1.0"
run-script-os@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/run-script-os/-/run-script-os-1.1.6.tgz#8b0177fb1b54c99a670f95c7fdc54f18b9c72347"
integrity sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==
rx-lite-aggregates@^4.0.8: rx-lite-aggregates@^4.0.8:
version "4.0.8" version "4.0.8"
resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be"

Loading…
Cancel
Save