From a923e36f9ba28872d3384c3750e80ea567f8ac48 Mon Sep 17 00:00:00 2001 From: ceddybi Date: Wed, 31 Jan 2024 18:35:00 -0500 Subject: [PATCH] sign osx --- .gitignore | 3 +++ forge.config.ts | 21 ++++++++++++++++++++- package.json | 5 +++-- yarn.lock | 5 +++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7f1b1bc..c309336 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,6 @@ typings/ out/ user_data/ + +*keys +/keys \ No newline at end of file diff --git a/forge.config.ts b/forge.config.ts index 40e91c1..b2ab1f0 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -1,3 +1,5 @@ +import 'dotenv/config'; + import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives'; import type { ForgeConfig } from '@electron-forge/shared-types'; import { MakerRpm } from '@electron-forge/maker-rpm'; @@ -9,6 +11,12 @@ import packageJson from './package.json'; import { rendererConfig } from './webpack.renderer.config'; const config: ForgeConfig = { + // hooks: { + // packageAfterCopy: async (forgeConfig, build_path) => { + // console.log(`\nBuild Path: ${build_path}`); + // await minify(build_path + '/src'); + // }, + // }, packagerConfig: { name: packageJson.productName, icon: './src/assets/icon', @@ -18,7 +26,18 @@ const config: ForgeConfig = { "name": packageJson.productName, "schemes": [packageJson.name] } - ] + ], + osxSign: { + identity: process.env.SIGN_ID, + }, // object must exist even if empty + osxNotarize: { + appleId: process.env.APPLE_ID || "", + appleIdPassword: process.env.APPLE_PASSWORD || "", + teamId: process.env.APPLE_TEAM_ID || "" + // appleApiKey: process.env.APPLE_API_KEY || "", + // appleApiKeyId: process.env.APPLE_API_KEY_ID || "", + // appleApiIssuer: process.env.APPLE_API_ISSUER || "" + } }, rebuildConfig: {}, makers: [new MakerSquirrel({}), new MakerZIP({}, ['darwin']), new MakerRpm({}), diff --git a/package.json b/package.json index 7348793..d6cc402 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "scripts": { "start": "APP_DEV=true electron-forge start", "package": "electron-forge package", - "make": "electron-forge make", - "publish": "electron-forge publish", + "make": "DEBUG=electron-osx-sign* electron-forge make --arch=x64 --platform=darwin", + "publish": "electron-forge publish --arch=x64 --platform=darwin", "lint": "eslint --ext .ts,.tsx ." }, "keywords": [], @@ -37,6 +37,7 @@ "@vercel/webpack-asset-relocator-loader": "1.7.3", "autoprefixer": "^10.4.17", "css-loader": "^6.0.0", + "dotenv": "^16.4.1", "electron": "28.2.0", "eslint": "^8.0.1", "eslint-plugin-import": "^2.25.0", diff --git a/yarn.lock b/yarn.lock index 48343f3..c0ab433 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2752,6 +2752,11 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" +dotenv@^16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.1.tgz#1d9931f1d3e5d2959350d1250efab299561f7f11" + integrity sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ== + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"