Code Signing and Notarization
This guide explains how to prepare trusted desktop releases for Windows and macOS.
Goal:
- Windows installer signed with a valid code-signing certificate.
- macOS app signed and notarized with Apple Developer ID.
- Release artifacts published with checksums and build provenance.
Current CI Integration
KuaDashboard release automation is configured in .github/workflows/electron-build.yml and uses:
CSC_LINK/CSC_KEY_PASSWORDfor Windows signing.APPLE_TEAM_ID/APPLE_API_KEY/APPLE_API_KEY_ID/APPLE_API_ISSUERfor macOS notarization.
The Electron build config is in package.json, and notarization is handled by electron/notarize.js.
Windows: Generate and Export Certificate
Use a CA-issued code-signing certificate (OV or EV).
Important:
- EV generally gets SmartScreen reputation faster.
- OV works correctly, but SmartScreen trust may take longer to build.
1. Receive certificate from CA
Follow your CA process (DigiCert, Sectigo, GlobalSign, etc.) and install the certificate in Windows Certificate Store or import the provided .pfx file.
2. Export PFX (if needed)
If your certificate is installed in Windows certificate store:
- Open
certmgr.msc. - Go to
Personal->Certificates. - Find your code-signing certificate.
- Right-click ->
All Tasks->Export. - Choose
Yes, export the private key. - Choose
Personal Information Exchange - PKCS #12 (.PFX). - Set a strong password.
- Save file, for example:
kuadashboard-codesign.pfx.
3. Convert PFX to base64 for GitHub Secret
PowerShell:
[Convert]::ToBase64String([IO.File]::ReadAllBytes(".\kuadashboard-codesign.pfx")) | Set-Content -NoNewline .\codesign-pfx-base64.txtUse the content of codesign-pfx-base64.txt as the value for CSC_LINK.
Set CSC_KEY_PASSWORD to the PFX export password.
macOS: Prepare Signing and Notarization
Prerequisites:
- Apple Developer Program membership.
Developer ID Applicationcertificate.- Access to App Store Connect API key for notarization.
Do these steps on your Mac.
1. Create or import Developer ID certificate
In Keychain Access:
- Import your
Developer ID Applicationcertificate. - Ensure private key is present under the certificate.
2. Export certificate as P12
- Open Keychain Access.
- Select your
Developer ID Applicationcertificate and private key. - Right-click ->
Export 2 items.... - Save as
.p12and set export password.
3. Convert P12 to base64 for CI
On macOS terminal:
base64 -i kuadashboard-developer-id.p12 | tr -d '\n' > apple-cert-base64.txtYou can use this value as CSC_LINK in GitHub Secrets if your workflow signs macOS using the same variable.
Note:
- If Windows and macOS use different cert materials, run platform-specific signing jobs or inject secrets by matrix/platform.
4. Create App Store Connect API key
In App Store Connect:
- Users and Access -> Keys.
- Create a new API key.
- Download
.p8file once. - Record:
- Key ID
- Issuer ID
- Team ID (from your Apple account).
5. Prepare GitHub secrets for notarization
Set:
APPLE_API_KEY= full.p8content (raw text including BEGIN/END lines).APPLE_API_KEY_ID= key ID.APPLE_API_ISSUER= issuer ID.APPLE_TEAM_ID= your Apple Team ID.
GitHub Repository Secrets Setup
In GitHub -> Settings -> Secrets and variables -> Actions, add:
CSC_LINKCSC_KEY_PASSWORDAPPLE_TEAM_IDAPPLE_API_KEYAPPLE_API_KEY_IDAPPLE_API_ISSUER
Recommended:
- Use environment-level secrets (for example
production) and required reviewers. - Restrict release workflow to protected tags.
Release Validation Checklist
Before tagging:
- Confirm certs are valid and not expired.
- Confirm all required secrets are present.
- Build test release from a temporary tag.
- Verify signatures:
- Windows: check signer in executable properties.
- macOS: run
codesign --verify --deep --strict --verbose=2 /Applications/KuaDashboard.app. - macOS: run
spctl -a -vv /Applications/KuaDashboard.app.
- Confirm
SHA256SUMS.txtis attached to release. - Confirm release attestation is available.
Troubleshooting
SmartScreen still warns on Windows
Possible causes:
- Certificate is valid, but SmartScreen reputation is still warming up.
- Product name or publisher changed between versions.
- Binary was modified after signing.
macOS app not opening after install
Possible causes:
- Notarization did not run due to missing Apple secrets.
- Certificate or API key belongs to another team.
- Build artifact got re-packed after signing/notarization.
GitHub Action says secret context invalid
In-editor warnings can appear when secrets are not defined in local metadata. This does not block runtime if secrets exist in repository settings.
