Skip to content

Commit

Permalink
Notarize configuration, refs #50
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Sep 3, 2021
1 parent b5d2d0c commit 8f027a4
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 1 deletion.
90 changes: 90 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@
"build": {
"appId": "io.datasette.app",
"mac": {
"category": "public.app-category.developer-tools"
"category": "public.app-category.developer-tools",
"hardenedRuntime" : true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist",
"binaries": [
"./dist/mac/Datasette.app/Contents/Resources/python/bin/python3.9",
"./dist/mac/Datasette.app/Contents/Resources/python/lib/python3.9/lib-dynload/xxlimited.cpython-39-darwin.so",
"./dist/mac/Datasette.app/Contents/Resources/python/lib/python3.9/lib-dynload/_testcapi.cpython-39-darwin.so"
]
},
"afterSign": "scripts/notarize.js",
"extraResources": [
{
"from": "python",
Expand All @@ -34,6 +44,7 @@
"devDependencies": {
"electron": "^13.2.1",
"electron-builder": "^22.11.7",
"electron-notarize": "^1.1.1",
"mocha": "^9.1.0",
"spectron": "^15.0.0"
},
Expand Down
19 changes: 19 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Based on https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ */

const { notarize } = require("electron-notarize");

exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== "darwin") {
return;
}

const appName = context.packager.appInfo.productFilename;

return await notarize({
appBundleId: "io.datasette.app",
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
});
};

0 comments on commit 8f027a4

Please sign in to comment.