forked from klembot/twinejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectron-builder.config.js
54 lines (51 loc) · 1.5 KB
/
electron-builder.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const child_process = require('child_process');
const pkg = require('./package.json');
const isPreview =
/alpha|beta|pre/.test(pkg.version) || process.env.FORCE_PREVIEW;
module.exports = {
afterSign(context) {
// This step is necessary to ad hoc sign the app. Otherwise, on Apple
// Silicon you get repeated prompts for file access.
//
// If/when we are able to sign the app for real, this must be removed.
//
// This was cribbed from https://github.com/alacritty/alacritty/issues/5840.
if (context.packager.platform.name === 'mac') {
console.log('Ad hoc signing Mac app...');
child_process.execSync(
'codesign --force --deep --sign - dist/electron/mac-universal/Twine.app'
);
}
},
directories: {
output: 'dist/electron'
},
extraMetadata: {
main: 'electron-build/main/src/electron/main-process/index.js'
},
files: ['electron-build/**/*', 'node_modules/**/*'],
extraResources: [
{
from: 'public/dictionaries',
to: 'dictionaries'
}
],
linux: {
artifactName: `Twine-${pkg.version}-Linux-\${arch}.zip`,
target: [{arch: ['arm64', 'ia32', 'x64'], target: 'zip'}]
},
mac: {
artifactName: `Twine-${pkg.version}-macOS.dmg`,
icon: `icons/app-${isPreview ? 'preview' : 'release'}.png`,
target: {arch: ['universal'], target: 'dmg'}
},
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true
},
win: {
artifactName: `Twine-${pkg.version}-Windows.exe`,
icon: `icons/app-${isPreview ? 'preview' : 'release'}.ico`,
target: {arch: ['x64'], target: 'nsis'}
}
};