-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { notarize } = require('@electron/notarize'); | ||
|
||
module.exports = async (context) => { | ||
if (process.platform !== 'darwin') { | ||
return; | ||
} | ||
console.info('AfterSign hook triggered. Starting notarization step.'); | ||
if (!process.env.CI) { | ||
console.warn('Skipping notarizing, not running in CI.'); | ||
return; | ||
} | ||
if (!('APPLE_ID' in process.env && 'APPLE_APP_SPECIFIC_PASSWORD' in process.env)) { | ||
console.warn( | ||
'Skipping notarizing step. APPLE_ID and APPLE_APP_SPECIFIC_PASSWORD env variables must be set.' | ||
); | ||
return; | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename; | ||
const { appOutDir } = context; | ||
try { | ||
await notarize({ | ||
tool: 'notarytool', | ||
appPath: `${appOutDir}/${appName}.app`, | ||
appleId: process.env.APPLE_ID, | ||
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, | ||
teamId: process.env.APPLE_TEAM_ID | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
|
||
console.log(`Done notarizing.`); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters