Skip to content

Commit

Permalink
新增:MacOS 打包使用官方证书
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Jan 19, 2025
1 parent e50f7a0 commit d99548c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,23 @@ jobs:
echo "find-identity"
security find-identity -p codesigning
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
security import certificate.p12 -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
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 "Developer ID Application: Xi'an Yanyi Information Technology Co., Ltd (Q96H3H33RK)" -t private build.keychain
echo "find-certificate"
security find-certificate -a -c "Developer ID Application: Xi'an Yanyi Information Technology Co., Ltd (Q96H3H33RK)" -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
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,23 @@ jobs:
echo "find-identity"
security find-identity -p codesigning
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
security import certificate.p12 -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
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 "Developer ID Application: Xi'an Yanyi Information Technology Co., Ltd (Q96H3H33RK)" -t private build.keychain
echo "find-certificate"
security find-certificate -a -c "Developer ID Application: Xi'an Yanyi Information Technology Co., Ltd (Q96H3H33RK)" -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
Expand Down

0 comments on commit d99548c

Please sign in to comment.