From dd8c2d960c6906f0b3eaa987fac1ddd8257fcd09 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Mon, 2 Mar 2026 23:20:24 +0800 Subject: [PATCH] chore(ci): use electron-builder default to have notarization tool --- .github/workflows/release-tamagotchi.yml | 6 +-- .../electron-builder.config.ts | 52 +++++++++---------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release-tamagotchi.yml b/.github/workflows/release-tamagotchi.yml index d6476f87a..0e84ede50 100644 --- a/.github/workflows/release-tamagotchi.yml +++ b/.github/workflows/release-tamagotchi.yml @@ -147,9 +147,9 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} CSC_CONTENT: ${{ secrets.CSC_CONTENT }} CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - APPLE_DEVELOPER_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }} - APPLE_DEVELOPER_APPLE_ID: ${{ secrets.APPLE_DEVELOPER_APPLE_ID }} - APPLE_DEVELOPER_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APPLE_APP_SPECIFIC_PASSWORD }} + APPLE_ID: ${{ secrets.APPLE_DEVELOPER_APPLE_ID }} + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_DEVELOPER_APPLE_APP_SPECIFIC_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }} - name: Build (Linux Only) # Linux if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' diff --git a/apps/stage-tamagotchi/electron-builder.config.ts b/apps/stage-tamagotchi/electron-builder.config.ts index 870ad326f..0b4077c72 100644 --- a/apps/stage-tamagotchi/electron-builder.config.ts +++ b/apps/stage-tamagotchi/electron-builder.config.ts @@ -3,9 +3,7 @@ import type { Configuration } from 'electron-builder' import { execSync } from 'node:child_process' -import { env } from 'node:process' -import { notarize } from '@electron/notarize' import { isMacOS } from 'std-env' function hasXcode26OrAbove() { @@ -44,30 +42,30 @@ export default { output: 'dist', buildResources: 'build', }, - // For self-publishing, testing, and distribution after modified the code without access to - // an Apple Developer account, comment and uncomment the following 4 lines. - // Later on when you obtained one, you can set up the necessary certificates and provisioning - // profiles to enable these security features. - // - // https://www.bigbinary.com/blog/code-sign-notorize-mac-desktop-app - // https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ - afterSign: async (context) => { - const { electronPlatformName, appOutDir } = context - if (electronPlatformName !== 'darwin') - return - if (env.CI !== 'true') { - console.warn('Skipping notarizing step. Packaging is not running in CI') - return - } + // // For self-publishing, testing, and distribution after modified the code without access to + // // an Apple Developer account, comment and uncomment the following lines. + // // Later on when you obtained one, you can set up the necessary certificates and provisioning + // // profiles to enable these security features. + // // + // // https://www.bigbinary.com/blog/code-sign-notorize-mac-desktop-app + // // https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/ + // afterSign: async (context) => { + // const { electronPlatformName, appOutDir } = context + // if (electronPlatformName !== 'darwin') + // return + // if (env.CI !== 'true') { + // console.warn('Skipping notarizing step. Packaging is not running in CI') + // return + // } - const appName = context.packager.appInfo.productFilename - await notarize({ - appPath: `${appOutDir}/${appName}.app`, - teamId: env.APPLE_DEVELOPER_TEAM_ID!, - appleId: env.APPLE_DEVELOPER_APPLE_ID!, - appleIdPassword: env.APPLE_DEVELOPER_APPLE_APP_SPECIFIC_PASSWORD!, - }) - }, + // const appName = context.packager.appInfo.productFilename + // await notarize({ + // appPath: `${appOutDir}/${appName}.app`, + // teamId: env.APPLE_DEVELOPER_TEAM_ID!, + // appleId: env.APPLE_DEVELOPER_APPLE_ID!, + // appleIdPassword: env.APPLE_DEVELOPER_APPLE_APP_SPECIFIC_PASSWORD!, + // }) + // }, files: [ 'out/**', 'resources/**', @@ -119,14 +117,14 @@ export default { NSCameraUsageDescription: 'AIRI requires camera access for vision understanding', }, ], - // We have customized the notarization step in the `afterSign` hook. - notarize: false, // For self-publishing, testing, and distribution after modified the code without access to // an Apple Developer account, comment and uncomment the following 4 lines. // Later on when you obtained one, you can set up the necessary certificates and provisioning // profiles to enable these security features. // hardenedRuntime: false, hardenedRuntime: true, + // notarize: false, + notarize: true, executableName: 'airi', icon: useIconFormattedMacAppIcon ? 'icon.icon' : 'icon.icns', },