Skip to content

Standard: Managing signing keys and secrets ​

Applies to ​

  • Keys and tokens used to build, sign and distribute PlayPets.
  • Secrets the app handles while running.
  • Wherever they are kept or used: the maintainer's local machine, GitHub repository secrets (Settings → Secrets and variables → Actions) and CI workflows.
  • Not covered: contributors' development and testing.
    • pnpm test, pnpm run test:e2e, pnpm run dist:mac and pnpm run dist:windows need no keys.
    • Without keys, only signing and update file generation are skipped.

Rules ​

Where each key is stored and where it is used.

Key or secretUsed forStored inLocal useCI secretLifetime
Updater signing private keySigns update files. Installed apps verify them with the public keyMaintainer machine ~/.tauri/playpets-updater.key + offline backupFile contents in TAURI_SIGNING_PRIVATE_KEYTAURI_SIGNING_PRIVATE_KEY, TAURI_SIGNING_PRIVATE_KEY_PASSWORDDoes not expire. If lost, existing users cannot get updates
Updater signing public keyVerification inside the appplugins.updater.pubkey in the repository's src-tauri/tauri.conf.jsonAlready in the configNoneChanges with the private key
Apple Developer ID certificate (.p12)macOS signingMaintainer keychain + offline backupThe build finds it in the keychain, or APPLE_SIGNING_IDENTITYAPPLE_CERTIFICATE (base64), APPLE_CERTIFICATE_PASSWORD, APPLE_SIGNING_IDENTITYUntil the Apple certificate expires
Apple notarization accountmacOS notarizationApp-specific password on the maintainer's Apple accountAPPLE_ID, APPLE_PASSWORD, APPLE_TEAM_IDSame namesUntil the app-specific password is deleted or changed
WINGET_TOKENSubmits PRs to winget-pkgsGitHub token (scope: public_repo, on the account that has the winget-pkgs fork)Not usedWINGET_TOKENToken expiry date
HOMEBREW_TAP_TOKENPushes to <account>/homebrew-tapGitHub token (contents write on that one repository)Not usedHOMEBREW_TAP_TOKENToken expiry date
GITHUB_TOKENRelease drafts, uploading filesIssued by GitHub for each runNot usedAutomaticFor the run
Store application keyAuthenticates the dedicated Entra application's Store API requestsProtected microsoft-store environment Secret; optional backup in the maintainer's password managerNot used for normal buildsSTORE_CLIENT_SECRET (Key value, not Client ID or key identifier)Entra key expiry date; record it privately and rotate before expiry
MSIX test certificateSigns the test MSIXThe private key in the playpets-msix-key Docker volume (the build creates it if missing); only the public PlayPets-test.cer goes to release/windows/msix-test/. A key an older build left there is moved into the volumeUsed by pnpm run dist:windowsNoneDisposable. After docker volume rm playpets-msix-key the next build makes a new one, and testers trust the new certificate again
Agent bridge tokenAuthenticates requests the agent CLI sends to the running appbridge.json in the user data folderThe app creates a new one at each launchNoneWhile the app runs
The user's AI API keyAI connectionOS secure storage (macOS Keychain, Windows Credential Manager, Linux Secret Service)Handled by the appNoneUntil the user deletes it

Storing keys ​

  • Do not commit private keys, certificates or tokens to the repository.
  • Keep them only outside the repository (~/.tauri/) or in the ignored .credentials/ folder.
  • Never keep them in release/ (packages are handed off from there) or scratch/.
  • Git also ignores .env* files and key and certificate files (*.key, *.pem, *.p12, *.p8, *.pfx).
  • Back up the updater signing private key in at least two places: the maintainer machine and one offline store (for example a password manager).
  • If it is lost, apps already installed can never get updates again.
  • The updater signing key has a password. Store the password next to the key in the password manager, and give it to CI as the TAURI_SIGNING_PRIVATE_KEY_PASSWORD secret.

Store and Apple values ​

  • Store identity values (MSIX_IDENTITY_NAME, MSIX_PUBLISHER, MSIX_PUBLISHER_DISPLAY_NAME) are public metadata, supplied together to the local Docker build.
  • They are not signing keys or Store submission API credentials (Store and Apple signing guide).
  • Store API identifiers (STORE_APP_ID, STORE_TENANT_ID, STORE_CLIENT_ID) are environment variables.
  • The Store key stays in an environment Secret behind required approval.
  • The repository variable STORE_SUBMISSION_ENABLED=true turns on the Store submission of each published release.
  • STORE_PUBLISH_MODE=Immediate lets certification publish the submission.
  • Only the submit job of store.yml receives the key.
  • Apple release signing needs all six APPLE_* values together. A partial set fails the macOS release build.
  • Keep the exported Apple certificate password-protected and outside the checkout.

Workflows and tokens ​

  • Workflows pass a secret as an environment variable only when the secret exists (the Build step in release.yml follows this pattern).
  • An empty value makes tools fail when they try to read an empty certificate.
  • Create GitHub tokens with the narrowest scope and an expiry date (one year or less).
  • Create a new token and replace the secret before the old one expires.
  • If a key is lost or a leak is suspected, follow When the updater signing key is lost or leaked.

Commands ​

Build update files locally (macOS):

  • The first two lines ask for the key password without showing it and keep it out of the shell history (zsh and bash).
  • The signed PlayPets.app.tar.gz and .sig appear in src-tauri/target/release/bundle/macos/.
bash
printf 'Key password: '; read -rs TAURI_SIGNING_PRIVATE_KEY_PASSWORD; echo
export TAURI_SIGNING_PRIVATE_KEY_PASSWORD
TAURI_SIGNING_PRIVATE_KEY="$(cat ~/.tauri/playpets-updater.key)" pnpm exec tauri build --bundles app --config '{"bundle":{"createUpdaterArtifacts":true}}'

Create a new key:

  1. Run the command below. It asks for a password; set one.
  2. Put the contents of ~/.tauri/playpets-updater.key.pub into pubkey in tauri.conf.json.
bash
pnpm exec tauri signer generate -w ~/.tauri/playpets-updater.key

Recommendations ​

Follow these when you can. When you cannot, say why in the PR.

  • Turn on the repository's secret scanning and push protection (GitHub secret scanning, push protection).

Exceptions ​

WhenHow
Releasing without secretsAllowed. Only signing and update files are skipped; note it under known limitations in the release notes
Someone other than the maintainer needs to signDo not hand over the private key. Put only the secrets in the repository so CI signs

Rationale ​

Automated checks ​

  • .gitignore excludes .credentials/, key and certificate files, release/, scratch/ and .env*; tests/repository-config.test.mjs checks it.
  • tests/distribute.test.mjs checks the update settings: the public key exists, and the update address matches the repository in package.json.
  • The repository's own tests do not check secret scanning and push protection. The maintainer turns them on in the repository settings (Settings → Advanced Security).

Change history ​

  • 2026-10-01 First version
  • 2026-10-06 The updater key has a password; the local build asks for it instead of passing it on the command line. Secret scanning is turned on in Settings → Advanced Security

Free and open source under the MIT license. Not affiliated with OpenAI; ChatGPT and Codex are trademarks of OpenAI.