Skip to content

Commit 8cd2e78

Browse files
authored
Merge pull request #24 from niivue/fix-codesign-macos
Fix codesign macos
2 parents e9d5c38 + fc6ece6 commit 8cd2e78

File tree

3 files changed

+51
-30
lines changed

3 files changed

+51
-30
lines changed

forge.config.js

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
1+
const osxSign = {
2+
identity: process.env.APPLE_IDENTITY // usually looks like: "Developer ID Application: Your Name (XXXXXXXXXX)"
3+
}
4+
5+
const osxNotarize = {
6+
tool: 'notarytool',
7+
appleId: process.env.APPLE_ID, // your apple id email address
8+
appleIdPassword: process.env.APPLE_APP_PASSWORD, // your app specific password
9+
teamId: process.env.APPLE_TEAM_ID // your apple team id (usually the code in parentheses next to your name)
10+
}
11+
12+
const packagerConfig = {
13+
osxSign: osxSign,
14+
osxNotarize: osxNotarize,
15+
ignore: [
16+
/\.git/,
17+
/\.vscode/,
18+
// do allow minimist, express, and cors
19+
// minimist is used to parse command line arguments
20+
// express is used to to serve files to niivue
21+
// cors is used to allow cross origin requests (not strictly necessary since this code was taken from another app)
22+
/node_modules\/(?!(minimist|express|cors)).*/,
23+
/docs/,
24+
/dist/,
25+
/\.gitignore/,
26+
/README\.md/,
27+
/LICENSE\.md/
28+
],
29+
icon: "./niivue",
30+
}
31+
32+
// sign and notarise by default, but allow disabling with an environment variable
33+
// e.g. `NIIVUE_NO_SIGN=1 npm run make:macArm`
34+
if (process.env.NIIVUE_NO_SIGN === '1') {
35+
delete packagerConfig.osxSign
36+
// if not signing, then notarization is not possible
37+
delete packagerConfig.osxNotarize
38+
}
39+
40+
// e.g. `NIIVUE_NO_NOTARIZE=1 npm run make:macArm`
41+
// or both: `NIIVUE_NO_SIGN=1 NIIVUE_NO_NOTARIZE=1 npm run make:macArm`
42+
if (process.env.NIIVUE_NO_NOTARIZE === '1') {
43+
delete packagerConfig.osxNotarize
44+
}
45+
46+
147
module.exports = {
2-
packagerConfig: {
3-
// osxSign: {
4-
// identity: process.env.APPLE_IDENTITY
5-
// },
6-
// osxNotarize: {
7-
// tool: 'notarytool',
8-
// appleApiKey: process.env.APPLE_API_KEY,
9-
// appleApiKeyId: process.env.APPLE_API_KEY_ID,
10-
// appleApiIssuer: process.env.APPLE_API_ISSUER
11-
// },
12-
ignore: [
13-
/\.git/,
14-
/\.vscode/,
15-
// do allow minimist, express, and cors
16-
// minimist is used to parse command line arguments
17-
// express is used to to serve files to niivue
18-
// cors is used to allow cross origin requests (not strictly necessary since this code was taken from another app)
19-
/node_modules\/(?!(minimist|express|cors)).*/,
20-
/docs/,
21-
/dist/,
22-
/\.gitignore/,
23-
/README\.md/,
24-
/LICENSE\.md/
25-
],
26-
icon: "./niivue",
27-
},
48+
packagerConfig: packagerConfig,
2849
rebuildConfig: {},
2950
makers: [
3051
{

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "niivue-desktop",
3-
"productName": "NiiVue",
4-
"version": "0.2.0",
3+
"productName": "Niivue",
4+
"version": "0.2.1",
55
"description": "A medical image viewer with a focus on neuroimaging",
66
"main": "src/electron/index.js",
77
"scripts": {

0 commit comments

Comments
 (0)