fix: CI 证书解码去除换行 + openssl 预校验

printf + tr -d 去除 base64 中可能的 \r\n,
openssl pkcs12 -noout 在签名前验证 .p12 格式和密码正确。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
7418andClaude Sonnet 4.6 committed 2026-03-03 01:14:42 +08:00
1 parent 261d17c059
commit 8749adaeb9
1 file changed
+4 -1
+4 -1
View File
@@ -74,7 +74,10 @@ jobs:
if: ${{ env.HAS_CERT == 'true' }}
env:
MAC_CERT_P12_BASE64: ${{ secrets.MAC_CERT_P12_BASE64 }}
run: echo "$MAC_CERT_P12_BASE64" | base64 --decode > /tmp/cert.p12
MAC_CERT_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }}
run: |
printf '%s' "$MAC_CERT_P12_BASE64" | tr -d '\r\n' | base64 --decode > /tmp/cert.p12
openssl pkcs12 -in /tmp/cert.p12 -passin pass:"$MAC_CERT_PASSWORD" -noout
- name: Package for macOS (x64 + arm64)
env: