-
Notifications
You must be signed in to change notification settings - Fork 9
/
forge.config.js
68 lines (62 loc) · 2.08 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
const gitRef = process.env.GITHUB_REF || ''
// By default, the version number is the GH Actions build number
// This will not change if you re-run an exact build.
// (I wanted to use the commit SHA, but Windows version numbers must be decimal)
let appVersion = process.env.GITHUB_RUN_NUMBER
// However, if there's a git tag of the form "v1.2.3", use that instead
// It's assumed power users will prefer manually tagging vesrions.
if (gitRef.lastIndexOf("/") != -1) {
// A Windows version number must only be Semver-like numbers
// The "+2" skips past the "v", and the regex ensures number-ness
// TODO: Do Windows version numbers allow suffixes like "-beta"?
let version = gitRef.substring(gitRef.lastIndexOf("/") + 2)
if (/^[0-9.]*$/.test(version)) {
appVersion = version
}
}
console.log(appVersion)
module.exports = {
packagerConfig: {
name: process.env.APP_NAME,
executableName: process.env.APP_NAME,
appVersion: appVersion,
buildVersion: appVersion,
icon: "./icons/icon",
osxSign: {
entitlements: './entitlements.plist',
'entitlements-inherit': './entitlements.plist',
'gatekeeper-assess': false,
hardenedRuntime: true,
identity: process.env['CERTIFICATE_NAME']
},
osxNotarize: {
appleId: process.env['APPLE_ID'],
appleIdPassword: process.env['APPLE_ID_PASSWORD'],
}
},
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {
name: "test_electron_forge",
certificateFile: process.env['WINDOWS_PFX_FILE'],
certificatePassword: process.env['WINDOWS_PFX_PASSWORD']
}
},
{
name: "@electron-forge/maker-zip",
platforms: ["darwin"]
},
{
name: "@electron-forge/maker-deb",
config: {}
},
{
name: "@electron-forge/maker-rpm",
config: {}
}
]
}
if (process.env["APPLE_PROVIDER"]) {
module.exports.packagerConfig.osxNotarize.ascProvider = process.env["APPLE_PROVIDER"]
}