Add code signing config for Windows (Azure Artifact Signing) and macOS (Apple notarization)
CI workflows now support code signing when secrets are configured: - macOS: Apple Developer certificate + App Store Connect API key for notarization - Windows: Azure Artifact Signing via signtool + dlib - Both are no-ops when secrets aren't set (backwards-compatible) - Add Entitlements.plist (mic, network) and Info.plist (NSMicrophoneUsageDescription) - Add SIGNING.md with full setup guide for both platforms Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,27 @@ jobs:
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Setup code signing
|
||||
env:
|
||||
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
|
||||
APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY_CONTENT }}
|
||||
run: |
|
||||
if [ -n "${APPLE_API_KEY_CONTENT}" ]; then
|
||||
echo "Setting up notarization API key..."
|
||||
mkdir -p ~/private_keys
|
||||
echo "${APPLE_API_KEY_CONTENT}" > ~/private_keys/AuthKey_${APPLE_API_KEY}.p8
|
||||
else
|
||||
echo "No signing secrets configured, skipping code signing setup"
|
||||
fi
|
||||
|
||||
- name: Build Tauri app
|
||||
env:
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
|
||||
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
|
||||
APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
|
||||
run: npm run tauri build
|
||||
|
||||
- name: Upload to release
|
||||
@@ -91,3 +111,6 @@ jobs:
|
||||
"${REPO_API}/releases/${RELEASE_ID}/assets?name=${encoded_name}")
|
||||
echo "Upload response: HTTP ${HTTP_CODE}"
|
||||
done
|
||||
|
||||
- name: Cleanup signing artifacts
|
||||
run: rm -rf ~/private_keys
|
||||
|
||||
@@ -46,8 +46,45 @@ jobs:
|
||||
shell: powershell
|
||||
run: npm ci
|
||||
|
||||
- name: Setup Azure Artifact Signing
|
||||
shell: powershell
|
||||
env:
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
AZURE_SIGNING_ENDPOINT: ${{ secrets.AZURE_SIGNING_ENDPOINT }}
|
||||
AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }}
|
||||
AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }}
|
||||
run: |
|
||||
if (-not $env:AZURE_CLIENT_ID) {
|
||||
Write-Host "No Azure signing secrets configured, skipping code signing setup"
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "Setting up Azure Artifact Signing..."
|
||||
|
||||
# Install Artifact Signing client tools
|
||||
nuget install Microsoft.ArtifactSigning.Client -x -OutputDirectory .\signing-tools
|
||||
$dlibPath = (Resolve-Path ".\signing-tools\Microsoft.ArtifactSigning.Client*\bin\x64\Azure.CodeSigning.Dlib.dll").Path
|
||||
|
||||
# Write metadata.json
|
||||
@{
|
||||
Endpoint = $env:AZURE_SIGNING_ENDPOINT
|
||||
CodeSigningAccountName = $env:AZURE_SIGNING_ACCOUNT
|
||||
CertificateProfileName = $env:AZURE_CERT_PROFILE
|
||||
} | ConvertTo-Json | Out-File -Encoding UTF8 metadata.json
|
||||
$metadataPath = (Resolve-Path "metadata.json").Path
|
||||
|
||||
# Inject signCommand into tauri.conf.json for this build
|
||||
$conf = Get-Content src-tauri\tauri.conf.json -Raw | ConvertFrom-Json
|
||||
$signCmd = "signtool.exe sign /v /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib `"$dlibPath`" /dmdf `"$metadataPath`" %1"
|
||||
$conf.bundle.windows | Add-Member -NotePropertyName "signCommand" -NotePropertyValue $signCmd -Force
|
||||
$conf | ConvertTo-Json -Depth 10 | Set-Content src-tauri\tauri.conf.json -Encoding UTF8
|
||||
|
||||
- name: Build Tauri app
|
||||
shell: powershell
|
||||
env:
|
||||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
|
||||
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
|
||||
run: npm run tauri build
|
||||
|
||||
- name: Upload to release
|
||||
|
||||
Reference in New Issue
Block a user