Skip to content

Commit c384c37

Browse files
committed
ci(macos): derive signing identity from keychain after cert import
Avoid Tauri mismatch when APPLE_SIGNING_IDENTITY secret differs from the .p12 (e.g. Mac Developer ID vs Developer ID with team). Stop passing APPLE_CERTIFICATE to tauri-action since import-codesign-certs already loads the p12. Made-with: Cursor
1 parent 21d1308 commit c384c37

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,22 @@ jobs:
8787
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
8888
keychain: build
8989

90+
# Identity must match the .p12 exactly. Derive from the keychain after import so it cannot drift from the APPLE_SIGNING_IDENTITY secret (e.g. "Mac Developer ID..." vs "Developer ID ... (TEAM)").
91+
- name: Set APPLE_SIGNING_IDENTITY from imported certificate
92+
if: matrix.platform == 'macos-latest'
93+
run: |
94+
security find-identity -v -p codesigning
95+
ID=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | awk -F'"' '{print $2}')
96+
if [ -z "$ID" ]; then
97+
echo "No Developer ID Application identity found after import."
98+
exit 1
99+
fi
100+
echo "APPLE_SIGNING_IDENTITY=$ID" >> "$GITHUB_ENV"
101+
90102
- uses: tauri-apps/tauri-action@v0
91103
env:
92104
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93-
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
94-
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
95-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
105+
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
96106
APPLE_ID: ${{ secrets.APPLE_ID }}
97107
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
98108
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}

0 commit comments

Comments
 (0)