Skip to content

Commit

Permalink
notarizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Connoropolous committed May 7, 2021
1 parent 583b54c commit 01f47fa
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 52 deletions.
38 changes: 38 additions & 0 deletions electron/afterSignHook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require('dotenv').config()
const fs = require('fs')
const path = require('path')
const electronNotarize = require('electron-notarize')

module.exports = async function (params) {
if (process.platform !== 'darwin') {
return
}

console.log('afterSign hook triggered', params)

const appId = 'com.harris-braun-enterprises.acorn'

const appPath = path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
)
if (!fs.existsSync(appPath)) {
console.log('skip')
return
}

console.log(`Notarizing ${appId} found at ${appPath}`)

try {
await electronNotarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID_EMAIL,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
})
} catch (error) {
console.error(error)
}

console.log(`Done notarizing ${appId}`)
}
Binary file added electron/build/icon.icns
Binary file not shown.
67 changes: 15 additions & 52 deletions electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "CAL-1.0",
"build": {
"productName": "Acorn",
"afterSign": "./afterSignHook.js",
"appId": "com.harris-braun-enterprises.acorn",
"copyright": "Copyright © 2021 Harris-Braun Enterprises LLC",
"asarUnpack": "binaries/**/*",
Expand All @@ -42,6 +43,7 @@
},
"dependencies": {
"electron-log": "^4.3.5",
"electron-notarize": "^1.0.0",
"split": "^1.0.1"
}
}

0 comments on commit 01f47fa

Please sign in to comment.