From 85659d9eae4c4200c9f2dcb3284a1c284daa4278 Mon Sep 17 00:00:00 2001 From: Daraku-Neko <5214078+darakuneko@users.noreply.github.com> Date: Fri, 29 Mar 2024 19:25:26 +0900 Subject: [PATCH] add: mac notarize --- .gitignore | 1 + entitlements.mac.plist | 12 ++++++++++++ notarize.js | 16 ++++++++++++++++ package.json | 11 +++++++++-- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 entitlements.mac.plist create mode 100644 notarize.js diff --git a/.gitignore b/.gitignore index 7cd27b6..42307e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.env /.idea node_modules /dist diff --git a/entitlements.mac.plist b/entitlements.mac.plist new file mode 100644 index 0000000..273c351 --- /dev/null +++ b/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 + + + \ No newline at end of file diff --git a/notarize.js b/notarize.js new file mode 100644 index 0000000..e572702 --- /dev/null +++ b/notarize.js @@ -0,0 +1,16 @@ +const { notarize } = require("@electron/notarize") +require('dotenv').config() + +exports.default = async function notarizing(context) { + const { electronPlatformName, appOutDir } = context + if (electronPlatformName !== 'darwin') return + const appName = context.packager.appInfo.productFilename + + return await notarize({ + appBundleId: "app.darakuneko.gpk_fwbuilder", + appPath: `${appOutDir}/${appName}.app`, + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_APP_SPECIFIC_PASSWORD, + teamId: process.env.TEAM_ID, + }) +} \ No newline at end of file diff --git a/package.json b/package.json index db301e9..a1a8270 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "email": "tvkids@gmail.com" }, "devDependencies": { - "@electron/rebuild": "3.6.0", "electron": "29.0.0", "electron-builder": "24.12.0", "webpack-cli": "5.1.4" @@ -27,6 +26,7 @@ "@babel/core": "7.23.9", "@babel/preset-env": "7.23.9", "@babel/preset-react": "7.23.3", + "@electron/notarize": "^2.3.0", "@emotion/babel-preset-css-prop": "11.11.0", "@emotion/react": "11.11.3", "@emotion/styled": "11.11.0", @@ -35,6 +35,7 @@ "ansi-to-html": "0.7.2", "axios": "1.6.7", "babel-loader": "9.1.3", + "dotenv": "^16.4.5", "electron-store": "8.1.0", "form-data": "4.0.0", "html-react-parser": "5.1.7", @@ -46,6 +47,7 @@ "build": { "productName": "GPK FWBuilder", "appId": "app.darakuneko.gpk_fwbuilder", + "afterSign": "notarize.js", "npmRebuild": false, "files": [ "public/**/*", @@ -64,7 +66,12 @@ }, "mac": { "target": "dmg", - "icon": "icons/512x512.png" + "icon": "icons/512x512.png", + "hardenedRuntime": true, + "gatekeeperAssess": false, + "category": "public.app-category.productivity", + "entitlements": "entitlements.mac.plist", + "entitlementsInherit": "entitlements.mac.plist" }, "linux": { "target": [