diff --git a/apps/remixdesktop/notarize.js b/apps/remixdesktop/notarize.js index 141ecae255..570b16f0f2 100644 --- a/apps/remixdesktop/notarize.js +++ b/apps/remixdesktop/notarize.js @@ -1,6 +1,7 @@ const { notarize } = require('@electron/notarize'); const fs = require('fs'); +const { exec } = require('child_process'); // Import the exec function exports.default = async function notarizing(context) { const { electronPlatformName, appOutDir } = context; // Provided by electron-builder @@ -25,13 +26,29 @@ exports.default = async function notarizing(context) { teamId: process.env.APPLE_TEAM_ID, // Your Apple Developer team ID (optional) }) - const r = await notarize({ - appBundleId: 'org.ethereum.remix-ide', // Your app's bundle ID - appPath: `${appOutDir}/${appName}.app`, // Path to your .app - appleId: process.env.APPLE_ID, // Your Apple ID - appleIdPassword: process.env.APPLE_ID_PASSWORD, // App-specific password - teamId: process.env.APPLE_TEAM_ID, // Your Apple Developer team ID (optional) - }); - - console.log(r); + try { + const r = await notarize({ + appBundleId: 'org.ethereum.remix-ide', // Your app's bundle ID + appPath: `${appOutDir}/${appName}.app`, // Path to your .app + appleId: process.env.APPLE_ID, // Your Apple ID + appleIdPassword: process.env.APPLE_ID_PASSWORD, // App-specific password + teamId: process.env.APPLE_TEAM_ID, // Your Apple Developer team ID (optional) + }); + + console.log(r); + + // Stapling the app + console.log('STAPLING'); + const appPath = `${appOutDir}/${appName}.app`; + exec(`xcrun stapler staple "${appPath}"`, (error, stdout, stderr) => { + if (error) { + console.error(`exec error: ${error}`); + return; + } + console.log(`Stapling output: ${stdout}`); + console.error(`Stapling errors: ${stderr}`); + }); + } catch (error) { + console.error('Error during notarization:', error); + } }; \ No newline at end of file diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index 8503500db6..aa63523a02 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -71,6 +71,7 @@ "files": [ "build/**/*" ], + "afterSign": "notarize.js", "afterAllArtifactBuild": "afterbuild.js", "publish": [ {