Release engineering · GitHub Actions
Shipping a desktop app to three operating systems, alone
How a single git tag becomes five DiskGrove installers: the release pipeline, checksums, unsigned builds, Linux packaging and uninstallers that ask first.
One tag, five installers
DiskGrove v1.0.0 shipped as five files: a Windows NSIS installer, macOS DMGs for Apple silicon and Intel (both in beta), a Linux AppImage and a .deb for Debian and Ubuntu.
Each one has to be built on its own operating system, so a laptop can't produce a release. Pushing a version tag does it instead, in GitHub Actions. Locally, npm run pack builds an unpacked app and npm run dist an installer for the current platform.
A release pipeline with as few keys as possible
The release workflow is built around one idea: the code that builds the app should not be the code that can publish it.
- Set the version in
package.json(npm version <version> --no-git-tag-versionupdates the lockfile too) and commit it. - Tag the commit
v<version>and push the tag. A repository ruleset lets only the admin create, move or deletev*tags. - The workflow checks that the tag matches
package.jsonand creates a draft release with generated notes. - The installers are built with a read-only token.
- A separate job, which runs no npm code at all, attaches each installer with its
.sha256file. - I smoke-test the installers, edit the notes and publish the draft.
While a release is a draft, rerunning the workflow replaces its files. Once published it is immutable: files and tag can no longer change, so a bad release is fixed with a new version, never by quietly swapping a binary. Dependabot also waits seven days before proposing a new dependency version, except for security updates, so a compromised package release has time to be noticed before it reaches a build.
Checksums, and what they don't prove
Every installer has a checksum beside it:
# Linux
sha256sum -c DiskGrove-1.0.0-linux-x86_64.AppImage.sha256
# macOS
shasum -a 256 -c DiskGrove-1.0.0-mac-arm64.dmg.sha256
# Windows (PowerShell): compare with the .sha256 file
Get-FileHash DiskGrove-1.0.0-win-x64.exeBecause the checksums are published next to the installers, they only detect a corrupted download, not a tampered one. The builds are also not code-signed, so Windows SmartScreen and macOS Gatekeeper warn before the first launch. The README walks through both rather than pretending the warning isn't there.
Linux is really three platforms
The AppImage needs FUSE 2, which Ubuntu 22.04 and later no longer install by default: libfuse2t64 on 24.04 and later, libfuse2 on 22.04. Without it, APPIMAGE_EXTRACT_AND_RUN=1 unpacks the app to a temporary folder on each launch.
Chromium's process sandbox needs unprivileged user namespaces. Where they are unavailable, the AppImage launcher falls back to --no-sandbox. The .deb can do better because it installs as root: it makes chrome-sandbox setuid root and, on Ubuntu 24.04 and later, installs an AppArmor profile that allows DiskGrove user namespaces. It installs to /opt/DiskGrove and adds a diskgrove command.
Uninstallers that ask first
Uninstalling is part of shipping. Every uninstaller asks whether to remove settings and recent scans as well; caches always go.
Windows uses electron-builder's NSIS uninstaller, extended by a small installer.nsh. The macOS app and the AppImage have no installer, so they carry a uninstall.sh instead. It lists what it will delete and asks before deleting, refuses to run unattended without -y, keeps settings unless --delete-app-data is passed, removes an app bundle only if its Info.plist carries DiskGrove's bundle identifier, and never removes the .deb itself; it tells you to run apt remove.
The script is POSIX sh, because Linux runs it with dash. A test runs it against a temporary home directory with stand-ins for uname, pgrep, pkill, defaults and dpkg-query, on the Linux and macOS CI jobs. The NSIS hooks have no automated coverage, so they are tested by hand, including silent uninstalls with /S and /S --delete-app-data.
Licences as a build step
npm run build writes a THIRD_PARTY_LICENSES.txt from every npm package that reaches the renderer bundle, and electron-builder ships it inside the app. A package without a licence file fails the build unless it is MIT, whose text can be reproduced from its package.json. Code copied into the repository, such as the shadcn/ui components, gets its notice in THIRD_PARTY_NOTICES.md by hand.
The part that stays manual
Automated tests mock the operating system's shell and dialogs and never touch real user files. That keeps CI fast and safe, and it means installers, previews, permissions and Trash behaviour still need a person on each OS before a release.
The smoke test is a written checklist against a disposable fixture folder: nested folders, two identical files and a pair that differ, a filename with quotes or HTML characters, and one file of every preview type. Scan it, cancel and rescan, search during the scan, find duplicates, export and check the escaping, cancel the native prompts, trash a file and restore it, then repeat with the packaged app. It is tedious, and it covers exactly the things the automated tests can't.
- Release engineering
- GitHub Actions
- Linux
- DiskGrove