2021-04-13 13:31:17 +10:00
|
|
|
require('dotenv').config()
|
2022-12-08 01:23:50 +11:00
|
|
|
const { notarize } = require('@electron/notarize')
|
2021-04-13 13:31:17 +10:00
|
|
|
const useNotarize = true
|
|
|
|
exports.default = async function notarizing(context) {
|
|
|
|
const { electronPlatformName, appOutDir } = context
|
|
|
|
if (electronPlatformName !== 'darwin' || !useNotarize) return
|
|
|
|
const appName = context.packager.appInfo.productFilename
|
|
|
|
console.log(`start notarize: ${appOutDir}/${appName}.app`)
|
|
|
|
try {
|
|
|
|
return await notarize({
|
|
|
|
appBundleId: 'top.thedesk',
|
|
|
|
appPath: `${appOutDir}/${appName}.app`,
|
|
|
|
appleId: process.env.APPLEID,
|
|
|
|
appleIdPassword: process.env.APPLEIDPASS,
|
|
|
|
})
|
|
|
|
} catch (e) {
|
|
|
|
throw console.log(e)
|
|
|
|
}
|
2022-12-08 01:23:50 +11:00
|
|
|
}
|