You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
892 B
37 lines
892 B
1 month ago
|
const { notarize } = require('electron-notarize')
|
||
|
|
||
|
module.exports = async (context) => {
|
||
|
if (process.platform !== 'darwin') return
|
||
|
|
||
|
console.log('aftersign hook triggered, start to notarize app.')
|
||
|
|
||
|
if (!process.env.CI) {
|
||
|
console.log(`skipping notarizing, not in CI.`)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
|
||
|
console.warn('skipping notarizing, APPLE_ID and APPLE_ID_PASS env variables must be set.')
|
||
|
return
|
||
|
}
|
||
|
|
||
|
const appId = 'com.electron.app'
|
||
|
|
||
|
const { appOutDir } = context
|
||
|
|
||
|
const appName = context.packager.appInfo.productFilename
|
||
|
|
||
|
try {
|
||
|
await notarize({
|
||
|
appBundleId: appId,
|
||
|
appPath: `${appOutDir}/${appName}.app`,
|
||
|
appleId: process.env.APPLE_ID,
|
||
|
appleIdPassword: process.env.APPLEIDPASS
|
||
|
})
|
||
|
} catch (error) {
|
||
|
console.error(error)
|
||
|
}
|
||
|
|
||
|
console.log(`done notarizing ${appId}.`)
|
||
|
}
|