Skip to content

Commit d1cb4b8

Browse files
committed
Move forge config into a separate file, to work around env var config issues
1 parent 22cc40b commit d1cb4b8

File tree

2 files changed

+77
-60
lines changed

2 files changed

+77
-60
lines changed

electron-forge.config.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
This file defines the full configuration for electron forge and each of the
3+
packaging tools it configures. It's referenced by config.forge in package.json.
4+
5+
It also makes this configuration dynamic, using env vars to configure
6+
secrets from CI without having to hardcode them. In theory it should be possible
7+
to dynamically configure electron forge with secrets using ELECTRON_FORGE_*
8+
variables, but this doesn't seem to work (see
9+
https://github.com/electron-userland/electron-forge/issues/657) so
10+
we have to do this instead.
11+
*/
12+
13+
const {
14+
ELECTRON_FORGE_ELECTRON_WINSTALLER_CONFIG_CERTIFICATE_PASSWORD
15+
} = process.env;
16+
17+
module.exports = {
18+
"make_targets": {
19+
"win32": [
20+
"squirrel",
21+
"zip"
22+
],
23+
"darwin": [
24+
"dmg",
25+
"zip"
26+
],
27+
"linux": [
28+
"deb",
29+
"zip"
30+
]
31+
},
32+
"electronPackagerConfig": {
33+
"executableName": "httptoolkit",
34+
"packageManager": "npm",
35+
"icon": "./src/icon",
36+
"ignore": [
37+
"certificates"
38+
],
39+
"afterCopy": [
40+
"./src/after-copy.js"
41+
],
42+
"appBundleId": "tech.httptoolkit.desktop",
43+
"appCategoryType": "public.app-category.developer-tools",
44+
"osxSign": {
45+
"keychain": "httptoolkit-build.keychain"
46+
}
47+
},
48+
"electronWinstallerConfig": {
49+
"name": "httptoolkit",
50+
"title": "HTTP Toolkit",
51+
"exe": "httptoolkit.exe",
52+
"iconUrl": "https://httptoolkit.tech/favicon.ico",
53+
"setupIcon": "./src/icon.ico",
54+
"loadingGif": "./src/installing.gif",
55+
"certificateFile": "./certificates/encrypted-win-cert.pfx",
56+
"certificatePassword": ELECTRON_FORGE_ELECTRON_WINSTALLER_CONFIG_CERTIFICATE_PASSWORD
57+
},
58+
"electronInstallerDMG": {
59+
"name": "HTTP Toolkit",
60+
"icon": "src/icon.icns"
61+
},
62+
"electronInstallerDebian": {
63+
"name": "httptoolkit",
64+
"bin": "httptoolkit",
65+
"icon": "src/icon.png",
66+
"homepage": "https://httptoolkit.tech",
67+
"categories": [
68+
"Development",
69+
"Network"
70+
]
71+
},
72+
"github_repository": {
73+
"owner": "httptoolkit",
74+
"name": "httptoolkit-desktop"
75+
},
76+
}

package.json

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,66 +17,7 @@
1717
"author": "Tim Perry",
1818
"license": "Apache-2.0",
1919
"config": {
20-
"forge": {
21-
"make_targets": {
22-
"win32": [
23-
"squirrel",
24-
"zip"
25-
],
26-
"darwin": [
27-
"dmg",
28-
"zip"
29-
],
30-
"linux": [
31-
"deb",
32-
"zip"
33-
]
34-
},
35-
"electronPackagerConfig": {
36-
"executableName": "httptoolkit",
37-
"packageManager": "npm",
38-
"icon": "./src/icon",
39-
"ignore": [
40-
"certificates"
41-
],
42-
"afterCopy": [
43-
"./src/after-copy.js"
44-
],
45-
"appBundleId": "tech.httptoolkit.desktop",
46-
"appCategoryType": "public.app-category.developer-tools",
47-
"osxSign": {
48-
"keychain": "httptoolkit-build.keychain"
49-
}
50-
},
51-
"electronWinstallerConfig": {
52-
"name": "httptoolkit",
53-
"title": "HTTP Toolkit",
54-
"exe": "httptoolkit.exe",
55-
"iconUrl": "https://httptoolkit.tech/favicon.ico",
56-
"setupIcon": "./src/icon.ico",
57-
"loadingGif": "./src/installing.gif",
58-
"certificateFile": "./certificates/encrypted-win-cert.pfx",
59-
"certificatePassword": "password"
60-
},
61-
"electronInstallerDMG": {
62-
"name": "HTTP Toolkit",
63-
"icon": "src/icon.icns"
64-
},
65-
"electronInstallerDebian": {
66-
"name": "httptoolkit",
67-
"bin": "httptoolkit",
68-
"icon": "src/icon.png",
69-
"homepage": "https://httptoolkit.tech",
70-
"categories": [
71-
"Development",
72-
"Network"
73-
]
74-
},
75-
"github_repository": {
76-
"owner": "httptoolkit",
77-
"name": "httptoolkit-desktop"
78-
}
79-
}
20+
"forge": "./electron-forge.config.js"
8021
},
8122
"dependencies": {
8223
"electron-compile": "^6.4.4",

0 commit comments

Comments
 (0)