-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathforge.config.js
118 lines (109 loc) · 2.9 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 { version } = require('./package.json');
const iconDir = path.resolve(__dirname, 'assets', 'icons');
const commonLinuxConfig = {
icon: {
scalable: path.resolve(iconDir, 'icon.svg'),
},
};
const config = {
packagerConfig: {
name: 'ezy',
executableName: 'ezy',
asar: true,
icon: path.resolve(__dirname, 'assets', 'icons', 'icon'),
appBundleId: 'com.getezy.ezy',
appCategoryType: 'public.app-category.developer-tools',
},
makers: [
{
name: '@electron-forge/maker-squirrel',
platforms: ['win32'],
config: (arch) => ({
name: 'ezy',
exe: 'ezy.exe',
noMsi: true,
iconUrl: 'https://raw.githubusercontent.com/getezy/ezy/master/assets/icons/icon.ico',
setupIcon: path.resolve(iconDir, 'icon.ico'),
setupExe: `ezy-${version}-win32-${arch}-setup.exe`,
}),
},
{
name: '@electron-forge/maker-dmg',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
platforms: ['linux'],
config: commonLinuxConfig,
},
{
name: '@electron-forge/maker-rpm',
platforms: ['linux'],
config: commonLinuxConfig,
},
],
plugins: [
{
name: '@electron-forge/plugin-webpack',
config: {
devContentSecurityPolicy: `default-src 'self' 'unsafe-inline' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline' data:`,
mainConfig: './webpack.main.config.js',
renderer: {
config: './webpack.renderer.config.js',
entryPoints: [
{
html: './src/app/index.html',
js: './src/app/renderer.tsx',
name: 'main_window',
preload: {
js: './src/main/preload.ts',
},
},
],
},
},
},
],
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: 'getezy',
name: 'ezy',
},
draft: true,
prerelease: false,
},
},
],
};
function macOsSignAndNotarize() {
if (process.platform !== 'darwin') {
return;
}
if (!process.env.APPLE_ID || !process.env.APPLE_ID_PASSWORD) {
// eslint-disable-next-line no-console
console.warn(
'Should be signed and notarized, but environment variables APPLE_ID or APPLE_ID_PASSWORD are missing!'
);
return;
}
config.packagerConfig.osxSign = {
identity: 'Developer ID Application: Alexey Vasyukov (956U3Y3QV9)',
optionsForFile: () => ({
hardenedRuntime: true,
entitlements: 'static/entitlements.plist',
signatureFlags: 'library',
}),
};
config.packagerConfig.osxNotarize = {
appBundleId: 'com.getezy.ezy',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
ascProvider: '956U3Y3QV9',
};
}
macOsSignAndNotarize();
module.exports = config;