Skip to content

Commit 01f47fa

Browse files
committed
notarizing
1 parent 583b54c commit 01f47fa

File tree

4 files changed

+55
-52
lines changed

4 files changed

+55
-52
lines changed

electron/afterSignHook.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require('dotenv').config()
2+
const fs = require('fs')
3+
const path = require('path')
4+
const electronNotarize = require('electron-notarize')
5+
6+
module.exports = async function (params) {
7+
if (process.platform !== 'darwin') {
8+
return
9+
}
10+
11+
console.log('afterSign hook triggered', params)
12+
13+
const appId = 'com.harris-braun-enterprises.acorn'
14+
15+
const appPath = path.join(
16+
params.appOutDir,
17+
`${params.packager.appInfo.productFilename}.app`
18+
)
19+
if (!fs.existsSync(appPath)) {
20+
console.log('skip')
21+
return
22+
}
23+
24+
console.log(`Notarizing ${appId} found at ${appPath}`)
25+
26+
try {
27+
await electronNotarize.notarize({
28+
appBundleId: appId,
29+
appPath: appPath,
30+
appleId: process.env.APPLE_ID_EMAIL,
31+
appleIdPassword: process.env.APPLE_ID_PASSWORD,
32+
})
33+
} catch (error) {
34+
console.error(error)
35+
}
36+
37+
console.log(`Done notarizing ${appId}`)
38+
}

electron/build/icon.icns

133 KB
Binary file not shown.

electron/package-lock.json

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

electron/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"license": "CAL-1.0",
1717
"build": {
1818
"productName": "Acorn",
19+
"afterSign": "./afterSignHook.js",
1920
"appId": "com.harris-braun-enterprises.acorn",
2021
"copyright": "Copyright © 2021 Harris-Braun Enterprises LLC",
2122
"asarUnpack": "binaries/**/*",
@@ -42,6 +43,7 @@
4243
},
4344
"dependencies": {
4445
"electron-log": "^4.3.5",
46+
"electron-notarize": "^1.0.0",
4547
"split": "^1.0.1"
4648
}
4749
}

0 commit comments

Comments
 (0)