From e1f049194c7c9e2accd81961e2e27c868b91af1a Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Tue, 22 Oct 2024 10:13:11 -0700 Subject: [PATCH] Add back missing assets --- .gitignore | 1 + .../electron/build/entitlements.mac.plist | 12 +++++++ .../core/assets/electron/build/notarize.cjs | 34 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 packages/core/assets/electron/build/entitlements.mac.plist create mode 100644 packages/core/assets/electron/build/notarize.cjs diff --git a/.gitignore b/.gitignore index f197e1c..85a2a56 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ node_modules # Builds build +!packages/core/assets/** dist **/*.spec diff --git a/packages/core/assets/electron/build/entitlements.mac.plist b/packages/core/assets/electron/build/entitlements.mac.plist new file mode 100644 index 0000000..38c887b --- /dev/null +++ b/packages/core/assets/electron/build/entitlements.mac.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + + diff --git a/packages/core/assets/electron/build/notarize.cjs b/packages/core/assets/electron/build/notarize.cjs new file mode 100644 index 0000000..acbb124 --- /dev/null +++ b/packages/core/assets/electron/build/notarize.cjs @@ -0,0 +1,34 @@ + +const { notarize } = require('@electron/notarize') + +module.exports = async (context) => { + if (process.platform !== 'darwin') return + + const envVariables = ['APPLE_TEAM_ID', 'APPLE_ID', 'APPLE_ID_PASSWORD'] + + if (!envVariables.every((key) => !!process.env[key])) { + console.log(`\nSkipping notarization: ${envVariables.join(' + ')} env variables must be set.\n`) + return + } + + const { appOutDir, packager } = context + + const { appInfo } = packager + + const { productFilename, productName, info } = appInfo + + const { appId, mac } = info._configuration + + if (mac.identity === null) return // Code-signing was not performed + + const appPath = `${appOutDir}/${productFilename}.app` + console.log(`\nNotarizing ${productName} (${appId})`) + + await notarize({ + teamId: process.env.APPLE_TEAM_ID, + appPath, + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_ID_PASSWORD + }) + .catch(e => console.error(`\nFailed to notarize: ${e}`)) +}