forked from ethersphere/swarm-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forge.config.js
118 lines (107 loc) · 2.76 KB
/
forge.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
107
108
109
110
111
112
113
114
115
116
117
118
const path = require('path')
const fs = require('fs')
// Taken over from https://github.com/electron/fiddle/blob/main/forge.config.js
if (process.env['WINDOWS_CODESIGN_FILE']) {
const certPath = path.join(__dirname, 'win-certificate.pfx')
const certExists = fs.existsSync(certPath)
if (certExists) {
process.env['WINDOWS_CODESIGN_FILE'] = certPath
}
}
const iconPath = path.resolve(__dirname, 'assets', 'icon')
const config = {
packagerConfig: {
icon: iconPath,
executableName: 'swarm-desktop',
name: 'Swarm Desktop',
appBundleId: 'org.ethswarm.swarmDesktop',
asar: true,
osxSign: {
identity: 'Developer ID Application: Swarm Association (9J9SPHU9RP)',
hardenedRuntime: true,
'gatekeeper-assess': false,
entitlements: 'assets/entitlements.plist',
'entitlements-inherit': 'assets/entitlements.plist',
},
},
electronInstallerDebian: {
bin: 'Swarm Desktop',
},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
name: 'swarm-desktop',
iconUrl: iconPath + '.ico',
setupIcon: iconPath + '.ico',
loadingGif: path.resolve(__dirname, 'assets', 'windows-install.gif'),
certificateFile: process.env['WINDOWS_CODESIGN_FILE'],
certificatePassword: process.env['WINDOWS_CODESIGN_PASSWORD'],
},
},
{
name: '@electron-forge/maker-dmg',
config: {
icon: `${iconPath}.icns`,
format: 'ULFO',
},
},
{
name: '@electron-forge/maker-deb',
config: {
options: {
icon: `${iconPath}.png`,
},
},
},
{
name: '@electron-forge/maker-rpm',
config: {
options: {
icon: `${iconPath}.png`,
},
},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'win32'],
config: {},
},
],
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'ethersphere',
name: 'swarm-desktop',
},
prerelease: true,
draft: false,
},
},
],
}
function notarizeMaybe() {
if (process.platform !== 'darwin') {
return
}
if (!process.env.CI) {
console.log(`Not in CI, skipping notarization`)
return
}
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
console.warn('Should be notarizing, but environment variables APPLE_ID or APPLE_ID_PASSWORD are missing!')
return
}
config.packagerConfig.osxNotarize = {
tool: 'notarytool',
appBundleId: 'org.ethswarm.swarmDesktop',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
ascProvider: '9J9SPHU9RP',
teamId: '9J9SPHU9RP',
}
}
notarizeMaybe()
module.exports = config