Skip to content

Commit

Permalink
fix: add macos notarization
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjoeoui committed Dec 1, 2023
1 parent 6806437 commit 7f64e08
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: com.electron.app
appId: ai.flojoy.studio
productName: flojoy-studio

directories:
Expand All @@ -16,6 +16,8 @@ extraResources:
- pyproject.toml
- poetry.lock

afterSign: ./scripts/notarize.js

win:
executableName: flojoy-studio
nsis:
Expand Down
35 changes: 35 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require('dotenv').config();
const fs = require('fs');
const path = require('path');
var electron_notarize = require('@electron/notarize');

/**
*
* @param {import('electron-builder').AfterPackContext} params
* @returns
*/
module.exports = async function (params) {
if (process.platform !== 'darwin') {
return;
}

let appId = 'ai.flojoy.studio';

let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);

if (!fs.existsSync(appPath)) {
console.error(`skipping notarizing as ${appPath} doens't exist`);
return;
}

console.log(`Notarizing ${appId} found at ${appPath}`);

return await electron_notarize.notarize({
tool: 'notarytool',
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID,
teamId: process.env.APPLE_TEAM_ID,
appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD
});
};

0 comments on commit 7f64e08

Please sign in to comment.