name: app-packaging-signing
description: Packages and signs a desktop application (Electron, Tauri, or a native bundle) for Windows, macOS, and Linux, producing installers, an auto-update feed, and a signing and notarisation checklist. Use when shipping a desktop build, setting up code signing, or fixing an installer that is blocked by SmartScreen or Gatekeeper.
license: MIT
metadata:
author: community-list
version: "1.0.0"
created: "2026-11-22"
App Packaging and Signing
Produces installable, signed artefacts for each target OS, plus the update metadata an
auto-updater needs. Signing is the part that most often blocks a release, so it is treated
as a first-class step, not an afterthought.
When to use
- First desktop release of an Electron or Tauri app.
- Users report "Windows protected your PC" or "app is damaged and can't be opened".
- Setting up auto-update.
- Adding a new target platform.
Inputs
| Input |
Required |
Notes |
| Framework |
yes |
Electron, Tauri, or native |
| Targets |
yes |
win-x64, win-arm64, mac-arm64, mac-x64, linux-x64, etc. |
| Signing identity |
conditional |
Required for distribution; absence changes the plan |
| Update strategy |
no |
GitHub Releases, S3, or self-hosted |
Workflow
1. Establish the release contract
Write down: product name, app ID (reverse-DNS), version, publisher name, and the update
channel. These appear in the installer, the registry/uninstall entry, and the update feed —
changing them later breaks upgrades.
2. Prepare build configuration
Electron — use electron-builder or electron-forge. Set in config:
appId, productName, directories.output
files allowlist (never ship node_modules wholesale; use asar and an explicit
files list)
asarUnpack for native modules that must live on disk
- Per-target
target entries (nsis, dmg, AppImage, deb)
Tauri — configure bundle.targets and bundle.identifier in tauri.conf.json; keep
the productName stable across releases.
3. Build reproducibly
- Pin the toolchain version and lockfile; commit both.
- Build each target on its native OS or a matching CI runner. Cross-compiling macOS from
Linux cannot be notarised.
- Record the exact command per target in
RELEASE.md.
4. Sign
| Platform |
What is required |
Verification |
| Windows |
Authenticode certificate (OV or EV) or Azure Trusted Signing; timestamp the signature |
signtool verify /pa /v <file> |
| macOS |
Developer ID Application certificate; hardened runtime; entitlements.plist; notarisation via notarytool; staple the ticket |
codesign --verify --deep --strict, spctl -a -vv, xcrun stapler validate |
| Linux |
Optional GPG signing of packages and the AppImage; publish the public key |
gpg --verify |
Rules:
- Secrets come from the CI secret store or the OS keychain. Never from a file in the repo.
- Always timestamp Windows signatures; an untimestamped signature expires with the cert.
- macOS: notarise the
.dmg/.zip you actually distribute, then staple it.
- Do not disable Gatekeeper or instruct users to bypass SmartScreen as a "fix".
5. Produce the update feed
Generate the metadata your updater expects (latest.yml for electron-builder, or
latest.json for the Tauri updater) with: version, file URL, SHA-512 hash, and release
date. Publish the hash alongside the binary — the updater must reject a hash mismatch.
6. Verify the artefact, not the build
Install from the produced installer on a clean machine or VM:
- Fresh install succeeds and the app launches.
- Uninstall removes the app and leaves no orphaned service.
- Upgrade from the previous version preserves user data and settings.
- Signature is valid on a machine that has never seen the certificate.
- Auto-update from N-1 to N succeeds and the version string updates.
Rules
- Never commit certificates, keystores, passwords, or notarisation credentials.
- Never ship a build with devtools enabled in production, source maps, or a localhost API URL.
- Never silently change the app ID or publisher; it breaks upgrades and trust prompts.
- Report the SHA-256 of every artefact in the release notes.
Output format
dist/<target>/<artefact>
dist/latest.yml | latest.json
RELEASE.md # commands, signing identities used (names only), verification results
SHA256SUMS.txt
Error handling
| Condition |
Action |
| No signing certificate available |
Produce unsigned artefacts, label them "development only", and write the exact steps to obtain signing |
| Notarisation fails |
Capture the notarytool log ID and the specific entitlement or binary at fault; do not retry blindly |
| Native module fails to load from asar |
Add it to asarUnpack and rebuild |
| SmartScreen still warns after signing |
Explain reputation warming; do not suggest disabling protections |
Example
Input: Electron app, win-x64 + mac-arm64, GitHub Releases.
Output: NSIS installer and notarised DMG, latest.yml with SHA-512, SHA256SUMS.txt,
and RELEASE.md listing signtool verify and spctl results from a clean VM.
1---2name: app-packaging-signing3description: Packages and signs a desktop application (Electron, Tauri, or a native bundle) for Windows, macOS, and Linux, producing installers, an auto-update feed, and a s4---5---6name: app-packaging-signing7description: Packages and signs a desktop application (Electron, Tauri, or a native bundle) for Windows, macOS, and Linux, producing installers, an auto-update feed, and a signing and notarisation checklist. Use when shipping a desktop build, setting up code signing, or fixing an installer that is blocked by SmartScreen or Gatekeeper.8license: MIT9metadata:10 author: community-list11 version: "1.0.0"12 created: "2026-11-22"13---1415# App Packaging and Signing1617Produces installable, signed artefacts for each target OS, plus the update metadata an18auto-updater needs. Signing is the part that most often blocks a release, so it is treated19as a first-class step, not an afterthought.2021## When to use2223- First desktop release of an Electron or Tauri app.24- Users report "Windows protected your PC" or "app is damaged and can't be opened".25- Setting up auto-update.26- Adding a new target platform.2728## Inputs2930| Input | Required | Notes |31|-------|----------|-------|32| Framework | yes | Electron, Tauri, or native |33| Targets | yes | win-x64, win-arm64, mac-arm64, mac-x64, linux-x64, etc. |34| Signing identity | conditional | Required for distribution; absence changes the plan |35| Update strategy | no | GitHub Releases, S3, or self-hosted |3637## Workflow3839### 1. Establish the release contract4041Write down: product name, app ID (reverse-DNS), version, publisher name, and the update42channel. These appear in the installer, the registry/uninstall entry, and the update feed —43changing them later breaks upgrades.4445### 2. Prepare build configuration4647**Electron** — use `electron-builder` or `electron-forge`. Set in config:4849- `appId`, `productName`, `directories.output`50- `files` allowlist (never ship `node_modules` wholesale; use `asar` and an explicit51 `files` list)52- `asarUnpack` for native modules that must live on disk53- Per-target `target` entries (`nsis`, `dmg`, `AppImage`, `deb`)5455**Tauri** — configure `bundle.targets` and `bundle.identifier` in `tauri.conf.json`; keep56the `productName` stable across releases.5758### 3. Build reproducibly5960- Pin the toolchain version and lockfile; commit both.61- Build each target on its native OS or a matching CI runner. Cross-compiling macOS from62 Linux cannot be notarised.63- Record the exact command per target in `RELEASE.md`.6465### 4. Sign6667| Platform | What is required | Verification |68|----------|------------------|--------------|69| Windows | Authenticode certificate (OV or EV) or Azure Trusted Signing; timestamp the signature | `signtool verify /pa /v <file>` |70| macOS | Developer ID Application certificate; hardened runtime; `entitlements.plist`; notarisation via `notarytool`; staple the ticket | `codesign --verify --deep --strict`, `spctl -a -vv`, `xcrun stapler validate` |71| Linux | Optional GPG signing of packages and the AppImage; publish the public key | `gpg --verify` |7273Rules:74- Secrets come from the CI secret store or the OS keychain. Never from a file in the repo.75- Always timestamp Windows signatures; an untimestamped signature expires with the cert.76- macOS: notarise the `.dmg`/`.zip` you actually distribute, then staple it.77- Do not disable Gatekeeper or instruct users to bypass SmartScreen as a "fix".7879### 5. Produce the update feed8081Generate the metadata your updater expects (`latest.yml` for electron-builder, or82`latest.json` for the Tauri updater) with: version, file URL, SHA-512 hash, and release83date. Publish the hash alongside the binary — the updater must reject a hash mismatch.8485### 6. Verify the artefact, not the build8687Install from the produced installer on a clean machine or VM:88891. Fresh install succeeds and the app launches.902. Uninstall removes the app and leaves no orphaned service.913. Upgrade from the previous version preserves user data and settings.924. Signature is valid on a machine that has never seen the certificate.935. Auto-update from N-1 to N succeeds and the version string updates.9495## Rules9697- Never commit certificates, keystores, passwords, or notarisation credentials.98- Never ship a build with devtools enabled in production, source maps, or a localhost API URL.99- Never silently change the app ID or publisher; it breaks upgrades and trust prompts.100- Report the SHA-256 of every artefact in the release notes.101102## Output format103104```105dist/<target>/<artefact>106dist/latest.yml | latest.json107RELEASE.md # commands, signing identities used (names only), verification results108SHA256SUMS.txt109```110111## Error handling112113| Condition | Action |114|-----------|--------|115| No signing certificate available | Produce unsigned artefacts, label them "development only", and write the exact steps to obtain signing |116| Notarisation fails | Capture the `notarytool` log ID and the specific entitlement or binary at fault; do not retry blindly |117| Native module fails to load from asar | Add it to `asarUnpack` and rebuild |118| SmartScreen still warns after signing | Explain reputation warming; do not suggest disabling protections |119120## Example121122**Input:** Electron app, win-x64 + mac-arm64, GitHub Releases.123**Output:** NSIS installer and notarised DMG, `latest.yml` with SHA-512, `SHA256SUMS.txt`,124and `RELEASE.md` listing `signtool verify` and `spctl` results from a clean VM.