mirror of
https://github.com/artegoser/pimi-launcher.git
synced 2024-11-22 03:16:21 +03:00
36 lines
898 B
JavaScript
36 lines
898 B
JavaScript
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.pimi-launcher.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}.`)
|
|
}
|