notarize the app too

signmacosdesktop
filip mertens 9 months ago
parent 8023951508
commit eaebfe650c
  1. 35
      apps/remixdesktop/notarize.js
  2. 1
      apps/remixdesktop/package.json

@ -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);
}
};

@ -71,6 +71,7 @@
"files": [
"build/**/*"
],
"afterSign": "notarize.js",
"afterAllArtifactBuild": "afterbuild.js",
"publish": [
{

Loading…
Cancel
Save