Most CI/CD blogs talk about deploying web apps β and those are relatively simple.
You push code, run tests, build, deploy to cloud, done.
But Electron desktop apps are a different world.
Youβre dealing with:
- Windows, macOS, and Linux
- OS-level permissions
- Signing certificates
- Private storage
- Installers
- Auto-update logic
Six months ago, I built a complete secure update pipeline for a multi-OS Electron app, and I recently remembered the journey. So I decided to write it down properly in case someone else goes through the same struggle.
π§© The Problem
Shipping a desktop app is not like shipping a website.
Web β backend downtime = API solves
Desktop β user already downloaded the binary
Every version matters. Every URL matters. And security matters even more.
So the goal was:
Build once β package for all OS β upload securely β users get auto-update reliably β without exposing storage URLs.
π The CI/CD Flow (High-Level)
PR β Validation (ENV + Tests) β Merge to Main
β Matrix Build (Windows + macOS + Linux)
β Upload to Azure Blob (Versioned)
β Update Metadata
β CDN sync
β Auto-Update Notifies Users
βοΈ Step 1 PR Validation
When a PR was raised, the pipeline first ensured:
- All required
.envvariables exist - All tests pass
- Nothing breaks before hitting
main
Only after that merging was allowed.
π§° Step 2 Parallel Matrix Build (Not Sequential)
Sequential builds were slow and OS dependencies broke each other.
So I switched to a matrix build strategy each OS built in parallel:
| OS | Output |
|---|---|
| Windows |
.exe + latest.yml
|
| macOS |
.dmg / .zip
|
| Linux |
.AppImage / .deb
|
Because some OS requirements were heavy (signing certificates, Linux package dependencies, Windows secrets), parallel execution reduced overall build time massively.
π¦ Step 3 Dual Blob Storage Strategy
Inside Azure I maintained two storage accounts:
| Storage | Purpose |
|---|---|
| Recent | Always contains the latest build |
| Archive | Contains version history forever |
Folder structure example
/recent/windows/app.latest.exe
/recent/mac-linux/app.latest.AppImage
/archive/1.11/windows/app-1.11.exe
/archive/1.11/mac-linux/app-1.11.AppImage
So:
- CDN always pointed to
/recent/β¦/app.latest.exe - But rollback was still possible via
/archive/<version>/
Users always saw:
Installing app.latest.exe
instead of app-1.11.exe β but latest still internally had version info.
π Step 4 Secure CDN instead of Direct Blob Links
We never exposed Azure Blob URLs (security risk).
So CDN was placed in front of the Blob and configured with:
- CORS restricted to metadata URL only
- No public blob token exposure
- Cache invalidation triggered on every deployment
When a new version deployed:
- Only
/recent/β¦/app.latest.exegot replaced - Metadata file got updated
- CDN refreshed
Users never had to think about version numbers.
π Step 5 Auto-Update Validation with Hash Logic
This was one of the most important security parts.
The Electron app did not blindly download the file.
Instead:
- App sends request to CDN (after 10s)
- Metadata returns latest version + hash
- App converts its own version β hash
- If both hashes match β allow update
- If mismatch β reject (prevents malicious uploads)
Even if someone somehow replaced the installer,
no existing user could be affected because they donβt know the hashing logic.
π― Final Result
| Requirement | Achieved |
|---|---|
| Multi-OS build | βοΈ |
| Fast builds | βοΈ (matrix strategy) |
| Secure storage | βοΈ |
| Easy rollback | βοΈ |
| Auto-update without exposing URLs | βοΈ |
| Hash-based integrity | βοΈ |
| Smooth user experience | βοΈ |
Users open the app β 10 seconds later β βA new version is availableβ β download starts β install done.
No version numbers, no confusion β just app.latest.exe.
π₯² Closing Thoughts
This wasnβt like CI/CD for a web API.
It took debugging OS permissions, signing certificates, platform secrets, and update logic.
Electron CI/CD looks simple in documentation until you actually do it.
But once itβs set up, the delivery becomes:
- Scalable
- Secure
- Fully automated
If you're building a production grade Electron app, you need to think like a software distributor, not just a developer.
I hope this write-up helps someone facing the same headaches I had six months ago. π
Top comments (1)
Thanks for sharing Haripriya!