Skip to content

An Electron app ships its installers in its release

  • Status: accepted
  • Date: 2026-11-29

Context

The blueprint had nine kinds of projects and none for a desktop app. An app of Electron is one: TypeScript that fits the stack of Node, in a window of Chromium on Windows, macOS and Linux. Three things set it apart from the other kinds:

  • Its users install it from an installer of their system, not from a registry: an .exe for Windows, a .dmg for macOS, an AppImage for Linux. electron-builder builds each only on its own system: a .dmg needs macOS, an installer of NSIS without Wine needs Windows, and the binaries of Electron differ for each.
  • An installed app updates itself, with electron-updater, from the latest*.yml that electron-builder writes beside the installers, which name the version, the files and their sha512.
  • Its page runs the code of a browser in a program that can reach the files of its user. Electron's security checklist keeps a flaw of a page from becoming one of the system: a sandbox, context isolation, no Node in the page, a protocol of its own in place of file://, and no navigation, window or permission that the app didn't ask for.

The release of every kind is built in build-release.yml, whose job release assets attests every asset in one job on Linux, which blocks every host that it doesn't need, so that the provenance names the isolated build (SLSA Build Level 3). Harden-Runner blocks only on Linux. Signing an installer needs a certificate of Apple, which costs a yearly fee, and one of Windows, which today lives in a hardware module or a service; macOS installs an update only into a signed app.

Options

  1. Leave it to each app: a project of the kind node-package builds its installers with scripts/release-assets.sh, which runs only on Linux.
  2. A kind whose installers a workflow of its own builds after the release and uploads to it: the release would be public before its installers, and an immutable release takes no more assets.
  3. A kind whose isolated build builds the installers on Windows, macOS and Linux, in jobs that may only read, and hands them to release assets, which attests and attaches them with the rest of the draft.

Decision

Option 3, unsigned at first.

  • The kind electron-app takes the tools of Node: the same check (node), Biome and tsc, on its own lock file in stacks/electron/ with Electron, electron-builder, electron-updater and playwright-core, whose shared tools keep the versions of stacks/node/. The example is a window that greets, with the main process, the preload script and the page apart, and the defaults of the security checklist. electron-builder.yml belongs to the project; scripts/build-installers.sh, scripts/e2e-app.mjs, scripts/fetch-electron.mjs and scripts/copy-static.mjs to the blueprint.
  • The checks: the unit tests cover the main process with fakes of Electron, with every line, branch and function; the entries of the processes, which only Electron runs, are what the new step App covers, which starts the app in Electron and fails when its page reaches require or process. npm ci --ignore-scripts stays the only install; scripts/fetch-electron.mjs runs the install script of Electron on purpose, which checks the binary against the checksums of the locked package. On Ubuntu 24.04 the CI lets the namespaces that the sandbox of Electron needs and gives it the virtual screen of xvfb.
  • The installers in every pull request: the workflow Installers builds them on windows-2025, macos-15 and ubuntu-24.04 with scripts/build-installers.sh and starts the installed app on each; the job installers, which sums up the three, is a required check, so a change that breaks an installer fails before it merges, not in the build of a release.
  • The installers in every release: the job installers of the release of build-release.yml builds them the same way from the signed tag, after it checked that the tag stands at the commit of the release, with a token that may only read, no secret and no cache, and starts the installed app. release assets takes them, attests them with the rest and attaches them to the draft; it refuses an asset of scripts/release-assets.sh with the name of an installer. Verify the release checks an installer of each system and that each latest*.yml names the version and installers of the release. Harden-Runner records the traffic of these jobs, as it can block only on Linux; they hold nothing that may write.
  • Unsigned at first. electron-builder signs when it finds the secrets of a signature; a later release of the blueprint passes them from the environment signing, as for a Nextcloud app (decision 0114). docs/releases.md of each app says how each system opens an unsigned installer and that macOS installs no update until then.

Consequences

An Electron app of the blueprint has installers for three systems in every release, built from the signed tag and attested as SLSA Build Level 3 asks, and its installed app updates itself on Windows and Linux. Every pull request takes three more runners, one of them macOS, free for a public repository, a few minutes each. The installers are unsigned, so Windows warns and macOS asks for a right-click, until the owner buys the certificates; a release that passes the secrets of a signature to the build makes that job one that holds secrets, which SECURITY.md then names with its reason, since Harden-Runner can't block on Windows and macOS.