Build & Release
How to build FitFileViewer for distribution.
Development Buildβ
Quick Buildβ
# Build for current platform
npm run build
Development Packageβ
# Create unpacked build (faster, for testing)
npm run package
Production Buildβ
Single Platformβ
# Windows
npm run build -- --win
# macOS
npm run build -- --mac
# Linux
npm run build -- --linux
All Platformsβ
# Build for all platforms
npm run build:all
Build Configurationβ
Root Builder Configβ
Packaging is configured from the repository root:
electron-builder.config.cjsowns Electron Builder targets, artifact names, publish settings, and platform options.- The root
package.jsonis the app manifest for version, runtime dependencies, exports, and publish metadata. - Packaged file inclusion is limited to root package metadata and
dist/runtime output.
// electron-builder.config.cjs
const rootPackageFiles = ["dist/**", "package.json"];
module.exports = {
appId: appPackage.appid,
productName: appPackage.productName,
files: rootPackageFiles,
artifactName: "Fit-File-Viewer-${platform}-${arch}-${version}.${ext}",
publish: [{ provider: "github", owner: "Nick2bad4u", repo: "FitFileViewer" }],
};
Output Formatsβ
Windowsβ
| Format | Description |
|---|---|
| NSIS | Standard installer |
| MSI | Windows Installer |
| Portable | No installation |
| Squirrel | Auto-updating |
macOSβ
| Format | Description |
|---|---|
| DMG | Disk image |
| PKG | Installer package |
| ZIP | Archive |
Linuxβ
| Format | Description |
|---|---|
| AppImage | Universal format |
| DEB | Debian/Ubuntu |
| RPM | Fedora/RHEL |
| Snap | Snap package |
CI/CD Pipelineβ
Builds are automated via GitHub Actions:
# .github/workflows/Build.yml
name: Build
on:
push:
branches: [main]
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run build
Release Processβ
1. Update Versionβ
# Update the Electron app version
npm run release:bump-version
2. Update Changelogβ
npm run changelog
3. Create Releaseβ
# Push tag
git push --tags
# GitHub Actions builds and publishes
4. Verify Releaseβ
Check GitHub Releases for:
- All platform builds
- Checksums
- Release notes
Code Signingβ
Run npm run release:check-signing before signed packaging when
REQUIRE_CODE_SIGNING=true. The command reports missing variables before
electron-builder starts.
Local and rehearsal builds are unsigned by default:
npm run package
npm run package:unsigned
Production releases follow the same unsigned-by-default policy. The Build
And Release Electron App workflow exposes a require-code-signing input;
leave it disabled for the established release path and enable it only after the
Windows and macOS signing credentials have been configured.
For a failed run that already created an unpublished version tag, use
reuse-current-version=true only after moving that tag to the exact retry
commit. The workflow validates the package version, tag, and checked-out commit
match before rebuilding, preventing an accidental extra version bump.
Both commands force FFV_FORCE_UNSIGNED_PACKAGE=true,
CSC_IDENTITY_AUTO_DISCOVERY=false, and REQUIRE_CODE_SIGNING=false before
electron-builder starts. Use them for local package validation and release
rehearsals where credentials should not affect the result.
Use the signed path only when the platform signing secrets are available:
npm run package:signed
That command runs npm run release:check-signing:required first, then starts
electron-builder with REQUIRE_CODE_SIGNING=true.
Windowsβ
Signed Windows builds require:
WIN_CSC_LINKorCSC_LINKCSC_KEY_PASSWORD
macOSβ
Signed macOS builds require:
CSC_LINKCSC_KEY_PASSWORDCSC_INSTALLER_LINKCSC_INSTALLER_KEY_PASSWORD
Notarization also requires one of these credential sets:
APPLE_ID,APPLE_APP_SPECIFIC_PASSWORD, andAPPLE_TEAM_IDAPPLE_API_KEY,APPLE_API_KEY_ID, andAPPLE_API_ISSUERAPPLE_KEYCHAIN_PROFILE
For GitHub Actions, store the base64-encoded .p8 key as
APPLE_API_KEY_BASE64, plus APPLE_API_KEY_ID and APPLE_API_ISSUER. The
workflow writes the decoded key to RUNNER_TEMP and exports its path as
APPLE_API_KEY; do not store raw key contents in APPLE_API_KEY, because
electron-builder interprets that variable as a filesystem path.
Linux release builds do not require signing variables. Windows 7 compatibility
is limited to carried-forward legacy release assets from build-win7.yml; the
current app is not rebuilt for Windows 7.
After signed Windows or macOS packaging, run:
npm run release:verify-signing-artifacts
For the full signed release verification path, run:
npm run verify:release:signed
That command runs fast checks, the docs build, audit, Playwright smoke, signed packaging, signature artifact verification, and packaged smoke in order.
The verifier checks Windows .exe and .msi files with
Get-AuthenticodeSignature, checks macOS .app bundles with codesign, and
writes release-dist/signing-verification-report.json. The primary release
workflow uploads that report with the platform artifacts.
Troubleshooting Buildsβ
Common Issuesβ
Build fails on Windows:
# Clear cache
npm cache clean --force
rm -rf node_modules
npm install
macOS signing fails:
- Verify certificate in Keychain
- Check code signing identity
Linux missing dependencies:
# Install build tools
sudo apt-get install build-essential
Related: Development Setup