Skip to content

Commit

Permalink
优化:Mac 打包增加自建证书,避免安装提示被损坏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Dec 14, 2024
1 parent ca69c69 commit f90c57a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v0.3.0

- 新增:调试窗口统一管理,方便查看调试信息
- 优化:Mac 打包增加自建证书,避免安装提示被损坏问题
- 优化:跨页面调用方式优化

## v0.2.0
Expand Down
3 changes: 2 additions & 1 deletion electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"type": "development",
"notarize": false,
"darkModeSupport": false,
"hardenedRuntime": false
"hardenedRuntime": false,
"identity": "LinkAndroidKey"
},
"linux": {
"icon": "logo.icns",
Expand Down

0 comments on commit f90c57a

Please sign in to comment.