Electron app template with installers for Windows, macOS and Linux¶
A desktop app of Electron in TypeScript on Node 24, with the defaults of Electron's security checklist. Every pull request builds its installers on Windows, macOS and Linux and starts the installed app there, and every release carries them, attested like every other asset, with the files from which the installed app updates itself.
Start one¶
uvx --from copier==9.19.1 copier copy --data project_type=electron-app gh:Dennis-Otto/repo-blueprint my-app
cd my-app
python3 .github/blueprint.py create
With uv and the GitHub CLI, as the quick start shows. Copier asks for the name, the owner and the other answers, and create makes the repository on GitHub, applies the settings as code and prints the checklist.
What you get¶
- The example: a window that greets, in three parts, as Electron runs them: the main process in
src/main/, the preload script insrc/preload/index.ctsand the page insrc/renderer/, with code for all of them insrc/shared/. Every page runs in the sandbox of Chromium, with context isolation and without Node, and reaches the app only through the calls ofwindow.appthat the preload script gives it. The pages come fromapp://bundle/rather thanfile://, under a Content Security Policy without inline script, and the app blocks every navigation away, every new window and every permission.npm startruns it. Replace the greeting with the real app; its tests show how to test the main process with fakes of Electron. - The steps of
scripts/check.shfor this kind, the same on your machine and in the CI: those of a Node package, the lock file, Biome, tsc and node:test with every line, branch and function covered, and then App. It builds the app and starts it in Electron withscripts/e2e-app.mjs, which fails when the page reachesrequire,processor anything else of Node, and then runs the end-to-end test of the project,test/e2e.mjs, against its window: the example's greets through it. The entries of the processes,src/**/index.tsand the preload script, which only Electron runs, are what this step covers.npm ci --ignore-scriptsleaves out the download of Electron with the install script of its package, soscripts/fetch-electron.mjsruns that script on purpose, which checks the binary against the checksums of the locked package. - The installers:
scripts/build-installers.shbuilds those of the system that runs it with electron-builder, byelectron-builder.yml: an.exeof NSIS for Windows, a.dmgand the zip of the updates for macOS on Apple silicon and on Intel, and an AppImage for Linux, each with thelatest*.ymlfrom which an installed app learns of a release. They are unsigned until the secrets of a signature are set;docs/releases.mdof the new repository says how to open them and what a signature needs. - Workflows of this kind: Installers (
installers.yml), which builds the installers in every pull request on Windows, macOS and Linux, starts the installed app there and keeps them for a week as artifacts, and the newest Node onmain(newest-node.yml). - The steps of every kind: the text files, the diagrams, the pages in one column, the files of the project, the fragments of the changelog, the accepted advisories, the lock files, the version, the Git hooks, ShellCheck for the shell scripts and the strict build of the website.
- Everything that every repository gets: the PR coach and the fix bot, the release bot, Renovate, the settings as code, the issue assistant, the website in English and German, the security checks and the blueprint bot, as the guide lists them.
The checks that a pull request needs¶
The ruleset Protect main of .github/repository.toml lets a pull request merge once these checks pass:
check (node):scripts/check.shwith the tools of Node, the app started in Electron on Linux included.installers: the installers built on Windows, macOS and Linux, each in a job of its own, and the installed app started there.lint,diagrams,docs,conventional title,codeql,dependency-reviewandgitleaks, which every kind needs: every linter in one job, the pictures of the diagrams, the strict build of the website, the title of the pull request with its entry in the changelog, CodeQL, the review of new dependencies and the secret scan.
Delivery¶
Merging the release pull request publishes the release. Its isolated build builds the installers from the signed tag, each on Windows, macOS and Linux, in jobs with a token that may only read and no secret, and starts the installed app on each. The job that attests the release then takes them, attests them with the SBOMs and the signed provenance of SLSA Build Level 3 and attaches them, and Verify the release checks that an installer of each system is there and that each latest*.yml names the version and installers of the release. An installed app reads them with electron-updater and updates itself: on Windows and Linux unsigned, on macOS only once the app is signed. Harden-Runner records the traffic of the builds on Windows and macOS, where it can't block. Decision 1180 records why.
Once by hand¶
python3 .github/blueprint.py checklist ticks off each step that it can see and names the rest, each with its link: the release app of the owner with its private key, as your own account shows, the token of the issue assistant unless its AI is off, OpenSSF Best Practices, the REUSE API and the social preview.
This kind adds these steps:
- After the first release, try an installer by hand on each system that the app is for; they are unsigned until the secrets of a signature are set, and
docs/releases.mdof the new repository says how each system opens one.
GitHub can't see whether you tried them, so the checklist names it as a step that it can't tick off.
A real repository¶
No public repository of this kind follows the blueprint yet. The Variants workflow of the blueprint makes one from every change of its files and runs its checks with their real tools, and updates one from the latest release as its blueprint bot would.
How the blueprint compares with other templates: the comparison.