Skip to content

Commit

Permalink
Fix for Catalina (Notarize)
Browse files Browse the repository at this point in the history
  • Loading branch information
momakes3 committed Oct 16, 2019
1 parent bf37388 commit a6e6ef1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Node
node_modules/
.env
*.env
*.log
.DS_Store

Expand Down
8 changes: 8 additions & 0 deletions main/static/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
40 changes: 40 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Source: https://github.com/electron-userland/electron-builder/issues/3870#issuecomment-498786448
* Source: https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/
*/

require('dotenv').config()

const { notarize } = require('electron-notarize')

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context

if (electronPlatformName !== 'darwin') {
return
}

if (!(process.env.APPLE_ID && process.env.APPLE_ID_PASSWORD)) {
console.warn(
'Skipping macOS app notarization.' +
' Missing one or more environment vars (APPLE_ID, APPLE_ID_PASSWORD).'
)
return
}

if (process.env.DEV_BUILD) {
console.warn(
'Skipping macOS app notarization in development build. Do not publish'
)
return
}

const appName = context.packager.appInfo.productFilename

return await notarize({
appBundleId: 'pm.there.desktop',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
})
}

0 comments on commit a6e6ef1

Please sign in to comment.