-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathelectron-builder-config.js
106 lines (99 loc) · 3.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const getNotarizeOptions = require('./scripts/notarize.macos.js')
const merge = require('lodash.merge')
const { STAGE, getAppName, APP_ID, APP_PROTOCOL, CHANNEL_NAME, APP_ARTIFACT } = require('./product.js')
const prodConfig = () => ({
productName: getAppName(),
artifactName: APP_ARTIFACT,
copyright: 'IOTA Foundation',
directories: { buildResources: './public', output: './out' },
files: ['public/', 'package.json', '!node_modules/@iota/sdk/target/*'],
appId: APP_ID,
asar: true,
protocols: [{ name: `${getAppName()} URL Scheme`, schemes: [APP_PROTOCOL] }],
dmg: {
iconSize: 120,
title: '${productName}',
background: 'public/assets/background/mac/background.png',
sign: false,
contents: [
{ x: 500, y: 250, type: 'link', path: '/Applications' },
{ x: 170, y: 250, type: 'file' },
],
},
nsis: {
oneClick: true,
deleteAppDataOnUninstall: false,
perMachine: true,
include: 'public/installer.nsh',
},
win: {
icon: './public/assets/icons/prod/icon1024x1024.png',
publisherName: 'IOTA Stiftung',
target: 'nsis',
timeStampServer: 'http://timestamp.sectigo.com',
rfc3161TimeStampServer: 'http://timestamp.sectigo.com',
},
linux: {
target: ['AppImage'],
desktop: {
Name: getAppName(),
Comment: 'Desktop wallet for IOTA',
Categories: 'Office;Network;Finance',
MimeType: `x-scheme-handler/${APP_PROTOCOL}`,
},
icon: './public/assets/icons/prod/icon1024x1024.png',
mimeTypes: [`x-scheme-handler/${APP_PROTOCOL}`],
},
mac: {
icon: './public/assets/icons/prod/icon1024x1024.png',
category: 'public.app-category.finance',
target: ['dmg', 'zip'],
entitlements: './entitlements.mac.plist',
entitlementsInherit: './entitlements.mac.plist',
hardenedRuntime: true,
gatekeeperAssess: false,
asarUnpack: ['**/*.node'],
notarize: getNotarizeOptions(),
},
publish: {
provider: 'generic',
url: 'https://dl.firefly.iota.org/',
publishAutoUpdate: true,
channel: CHANNEL_NAME,
},
})
function getIconPaths() {
const PATH = './public/assets/icons'
const NAME = 'icon1024x1024'
const EXTENSION = 'png'
return {
linux: {
icon: `${PATH}/${STAGE}/${NAME}.${EXTENSION}`,
},
mac: {
icon: `${PATH}/${STAGE}/${NAME}.${EXTENSION}`,
},
win: {
icon: `${PATH}/${STAGE}/${NAME}.${EXTENSION}`,
},
}
}
const prereleaseNsisOptions = {
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true,
},
}
const testConfig = () => {
const icons = getIconPaths()
return merge({}, prodConfig(), icons, { appId: APP_ID }, prereleaseNsisOptions)
}
const build = () => {
switch (STAGE) {
case 'prod':
return prodConfig()
default:
return testConfig()
}
}
module.exports = build