A minimal Electron demo that compiles, packages, and runs through a GitHub Actions multi-platform build pipeline.
The goal is not to carry business logic, but to preserve the core engineering structure of hagicode-desktop and serve as a fast lane for validating Electron build, packaging, and release workflows.
src/main— Electron main processsrc/preload— Context bridgesrc/renderer— React + Vite home pagescripts— Packaging helpers, MSIX assembly, signing verification, and smoke tests.github/workflows— PR checks, entry orchestration workflow, platform reuse workflow, and Release Drafter
npm ci
npm run dev
npm run build:prod
npm run build:linux
npm run build:linux:deb
npm run build:linux:rpm
npm run build:win
npm run build:win:appx
npm run build:win:msix
npm run build:mac:x64
npm run build:mac:arm64pr-checks.yml— Install, type check, production build, and Linux dir packaging self-checkbuild.yml— Parallel matrix builds across Linux / Windows / macOS by OS + package format- Linux targets include
AppImage,deb,rpm,tar.gz, andzip - Windows targets include
portable,nsis,appx, andmsix - Tag releases enter the
productionenvironment and upload assets progressively to an already-created GitHub Release as each matrix job finishes - Manual triggers with
production_build=truealso run production builds; they follow production signing checks and only upload workflow artifacts without creating a GitHub Release - For production builds:
- The Windows job uses
windows-2025runners;.exeand.appxartifacts are strictly signed via Azure Artifact Signing v2, andappx/msixpackage manifests readPublisherfromWINDOWS_PACKAGE_PUBLISHERso it can match the signing certificate subject - If Azure Artifact Signing fails for
msix, the signedwin-msixartifact is skipped and onlywin-msix-unsignedis retained - macOS artifacts produce both signed and unsigned packages when signing materials are available; if the production environment lacks signing or notarization credentials, it automatically falls back to unsigned-only builds without blocking the release pipeline
- Signed Windows / macOS packages are retained alongside their unsigned counterparts; unsigned artifacts are suffixed with
-unsignedand appear in both workflow artifacts and tag releases
- The Windows job uses
Production tag releases and manual triggers with production_build=true require the following secrets in the repository or production environment:
- Windows signing:
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_ID,AZURE_CODESIGN_ENDPOINT,AZURE_CODESIGN_ACCOUNT_NAME,AZURE_CODESIGN_CERTIFICATE_PROFILE_NAME,WINDOWS_PACKAGE_PUBLISHERWINDOWS_PACKAGE_PUBLISHERmust exactly match the Azure Trusted Signing certificate subject because bothappxandmsixmanifests use it as thePublishervalue
- macOS signing certificates:
CSC_LINK,CSC_KEY_PASSWORD- If missing, production falls back to unsigned-only macOS builds
- macOS notarization:
- Recommended API key approach:
APPLE_API_KEY,APPLE_API_KEY_ID,APPLE_API_ISSUER - Or Apple ID approach:
APPLE_ID,APPLE_APP_SPECIFIC_PASSWORD,APPLE_TEAM_ID
- Recommended API key approach:
appx and msix are included in the Windows release matrix and uploaded as release artifacts. The workflow injects WINDOWS_PACKAGE_PUBLISHER into both packaging paths so the manifest Publisher matches the signing certificate subject. For msix, production signing is still attempted via Azure Artifact Signing v2, but if that step fails only the unsigned win-msix-unsigned artifact is kept.
Manual production build example: run Build Electron Demo from the Actions page with production_build set to true. This binds to the production environment, executes production-level signing pre-checks, and preserves artifacts in workflow artifacts. Tag-driven releases now assume the GitHub Release already exists and each matrix job uploads its assets directly with gh release upload --clobber.