-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
9748add
commit faeab12
Showing
2 changed files
with
37 additions
and
28 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 |
---|---|---|
@@ -1,31 +1,38 @@ | ||
require('dotenv').config() | ||
const { notarize } = require('@electron/notarize') | ||
require('dotenv').config(); | ||
const { notarize } = require('@electron/notarize'); | ||
|
||
// const isSet = value => value && value !== 'false' | ||
|
||
// electron-build hook to be used in electron-build pipeline in the future | ||
// =========================================================================== | ||
// Note: for now we don't use this at the moment. | ||
// Run ./notarize-cli.js instead | ||
exports.default = async function notarizing(context) { | ||
const { electronPlatformName, appOutDir } = context | ||
if (electronPlatformName !== 'darwin') return | ||
// skip notarization if secrets are not present in env | ||
if (!process.env.APPLE_ID_PASSWORD || !process.env.APPLE_ID) { | ||
console.log('Skipping notarizing, since secrets are not present in env.') | ||
return | ||
const { electronPlatformName, appOutDir } = context; | ||
if (electronPlatformName !== 'darwin') return; | ||
|
||
console.log('Starting notarization process...'); | ||
console.log('Environment Variables:'); | ||
console.log('APPLE_ID:', process.env.APPLE_ID ? 'present' : 'missing'); | ||
console.log('APPLE_APP_SPECIFIC_PASSWORD:', process.env.APPLE_APP_SPECIFIC_PASSWORD ? 'present' : 'missing'); | ||
|
||
if (!process.env.APPLE_ID || !process.env.APPLE_APP_SPECIFIC_PASSWORD) { | ||
console.log('Skipping notarizing, since secrets are not present in env.'); | ||
return; | ||
} | ||
|
||
const appName = context.packager.appInfo.productFilename | ||
const appPath = `${appOutDir}/${appName}.app` // Correct the path based on actual output directory | ||
console.log('app path:', appPath) | ||
console.log('cwd', __dirname) | ||
return notarize({ | ||
appBundleId: 'com.keepkey.desktop', | ||
appPath, | ||
appleId: process.env.APPLE_ID, | ||
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, | ||
tool: 'notarytool', | ||
teamId: 'DR57X8Z394', | ||
}) | ||
} | ||
const appName = context.packager.appInfo.productFilename; | ||
const appPath = `${appOutDir}/${appName}.app`; | ||
|
||
console.log('App Name:', appName); | ||
console.log('App Path:', appPath); | ||
console.log('Current Working Directory:', __dirname); | ||
|
||
try { | ||
await notarize({ | ||
appBundleId: 'com.keepkey.desktop', | ||
appPath, | ||
appleId: process.env.APPLE_ID, | ||
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, | ||
tool: 'notarytool', | ||
teamId: 'DR57X8Z394', | ||
}); | ||
console.log('Notarization successful'); | ||
} catch (error) { | ||
console.error('Error during notarization:', error); | ||
} | ||
}; |