diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 523de508..4e1f9011 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -33,6 +33,35 @@ jobs: run: | brew install python-setuptools + - name: Cert Prepare (macOS) + if: runner.os == 'macOS' + env: + MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} + MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} + run: | + echo "find-identity" + security find-identity -p codesigning + echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 + security create-keychain -p "" build.keychain + security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign + security list-keychains -s build.keychain + security set-keychain-settings -t 3600 -u build.keychain + security unlock-keychain -p "" build.keychain + echo "find-identity" + security find-identity -v -p codesigning build.keychain + echo "find-identity" + security find-identity -p codesigning + echo "set-key-partition-list" + security set-key-partition-list -S apple-tool:,apple: -s -k "" -l "LinkAndroidKey" -t private build.keychain + echo "find-certificate" + security find-certificate -a -c "LinkAndroidKey" -p + echo "export" + security export -k build.keychain -t certs -f x509 -p -o certificate.cer + echo "add-trusted-cert" + sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certificate.cer + echo "find-identity" + security find-identity -p codesigning + - name: Install Dependencies run: npm install diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 176ecaf1..a3dd7c8c 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -33,6 +33,35 @@ jobs: run: | brew install python-setuptools + - name: Cert Prepare (macOS) + if: runner.os == 'macOS' + env: + MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} + MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} + run: | + echo "find-identity" + security find-identity -p codesigning + echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12 + security create-keychain -p "" build.keychain + security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign + security list-keychains -s build.keychain + security set-keychain-settings -t 3600 -u build.keychain + security unlock-keychain -p "" build.keychain + echo "find-identity" + security find-identity -v -p codesigning build.keychain + echo "find-identity" + security find-identity -p codesigning + echo "set-key-partition-list" + security set-key-partition-list -S apple-tool:,apple: -s -k "" -l "LinkAndroidKey" -t private build.keychain + echo "find-certificate" + security find-certificate -a -c "LinkAndroidKey" -p + echo "export" + security export -k build.keychain -t certs -f x509 -p -o certificate.cer + echo "add-trusted-cert" + sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certificate.cer + echo "find-identity" + security find-identity -p codesigning + - name: Install Dependencies run: npm install diff --git a/changelog.md b/changelog.md index 7f4773d7..8d9394d4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ ## v0.3.0 - 新增:调试窗口统一管理,方便查看调试信息 +- 优化:Mac 打包增加自建证书,避免安装提示被损坏问题 - 优化:跨页面调用方式优化 ## v0.2.0 diff --git a/electron-builder.json5 b/electron-builder.json5 index 49b4c171..fabe8ac9 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -97,7 +97,8 @@ "type": "development", "notarize": false, "darkModeSupport": false, - "hardenedRuntime": false + "hardenedRuntime": false, + "identity": "LinkAndroidKey" }, "linux": { "icon": "logo.icns",