-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
notarize.js
35 lines (30 loc) · 863 Bytes
/
notarize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* notarize.js
*
* @see https://oldj.net/blog/2019/12/29/electron-builder-sign-and-notarize-for-macos
*/
require('dotenv').config()
const {notarize} = require('electron-notarize')
exports.default = async function notarizing (context) {
const appName = context.packager.appInfo.productFilename
const {electronPlatformName, appOutDir} = context
if (electronPlatformName !== 'darwin') {
return
}
let appPath = `${appOutDir}/${appName}.app`
let {appleId, appBundleId, ascProvider, appleIdPassword} = process.env
if (!appleIdPassword) {
appleIdPassword = `@keychain:Application Loader: ${appleId}`
}
if (!appleId || !appBundleId || !ascProvider || !appleIdPassword) {
console.log('Not notarized.')
return
}
return await notarize({
appBundleId,
appPath,
ascProvider,
appleId,
appleIdPassword
})
}