-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts and docs for release notarization on OSX (#298)
Closes #297
- Loading branch information
1 parent
94b6816
commit 5c0b12e
Showing
2 changed files
with
44 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
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'); | ||
const { build } = require('../package.json'); | ||
|
||
exports.default = async function notarizeMacos(context) { | ||
const { electronPlatformName, appOutDir } = context; | ||
if (electronPlatformName !== 'darwin') { | ||
return; | ||
} | ||
|
||
if (!process.env.APPLE_NOTARIZE) { | ||
console.warn( | ||
'Skipping notarizing step. APPLE_NOTARIZE environment variable is not set' | ||
); | ||
return; | ||
} | ||
|
||
if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) { | ||
console.warn( | ||
'Skipping notarizing step. APPLE_ID and APPLE_ID_PASS env variables must be set' | ||
); | ||
return; | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename; | ||
|
||
console.info('Notarizing Apple DMGs'); | ||
|
||
await notarize({ | ||
appBundleId: build.appId, | ||
appPath: `${appOutDir}/${appName}.app`, | ||
appleId: process.env.APPLE_ID, | ||
appleIdPassword: process.env.APPLE_ID_PASS, | ||
}); | ||
}; |