-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.js
96 lines (89 loc) · 2.29 KB
/
build.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
const builder = require("electron-builder");
const Platform = builder.Platform;
/**
* @type {import('electron-builder').Configuration}
*/
const options = {
appId: "com.app.id",
productName: "极物圈",
// protocols: {
// name: 'Your deeplink',
// - Don't forget to set `MimeType: "x-scheme-handler/deeplink"` for `linux.desktop` entry!
// schemes: ['deeplink']
// },
// - Electron auto-updater config
publish: [
{
provider: "github",
owner: "eternalc0der",
repo: "极物圈",
releaseType: "release",
},
],
// "store" | "normal" | "maximum" - For testing builds, use 'store' to reduce build time significantly.
compression: "store",
removePackageScripts: true,
nodeGypRebuild: false,
buildDependenciesFromSource: false,
directories: {
output: "electron-dist",
},
// windows
win: {
// eslint-disable-next-line no-template-curly-in-string
artifactName: "${productName}-${version}.${ext}",
target: [
{
target: "nsis",
arch: ["x64", "ia32"],
},
],
icon: "./public/logo.png",
},
mac: {
category: "public.app-category.entertainment",
hardenedRuntime: false,
gatekeeperAssess: false,
target: [
{
target: "default",
arch: ["x64", "arm64"],
},
],
icon: "./public/logo.png",
},
linux: {
maintainer: "极物圈",
desktop: {
StartupNotify: "false",
Encoding: "UTF-8",
MimeType: "x-scheme-handler/deeplink",
},
target: ["AppImage", "rpm", "deb"],
icon: "./public/logo.png",
},
nsis: {
oneClick: false,
guid: "idea",
perMachine: true,
allowElevation: true,
allowToChangeInstallationDirectory: true,
installerIcon: "./public/logo.png",
uninstallerIcon: "./public/logo.png",
installerHeaderIcon: "./public/logo.png",
createDesktopShortcut: true,
createStartMenuShortcut: true,
shortcutName: "idea",
},
};
const platform = "WINDOWS"; // "MAC" | "LINUX" | "WINDOWS" - Change this to build for other platforms
builder
.build({
targets: Platform[platform].createTarget(),
config: options,
})
.then((result) => {
console.log("----------------------------");
console.log("Platform:", platform);
console.log("Output:", JSON.stringify(result, null, 2));
});