Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
BitHighlander committed Aug 8, 2024
1 parent 9748add commit faeab12
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
4 changes: 3 additions & 1 deletion packages/keepkey-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"build": {
"appId": "com.keepkey.desktop",
"productName": "KeepKey Desktop",
"afterSign": "./scripts/afterSign.js",
"generateUpdatesFilesForAllChannels": true,
"publish": "github",
"files": [
Expand All @@ -49,6 +48,9 @@
"entitlements": "entitlements.mac.plist",
"entitlementsInherit": "entitlements.mac.plist",
"mergeASARs": false,
"notarize": {
"teamId": "DR57X8Z394"
},
"target": [
{
"target": "dmg",
Expand Down
61 changes: 34 additions & 27 deletions packages/keepkey-desktop/scripts/afterSign.js
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);
}
};

0 comments on commit faeab12

Please sign in to comment.