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β
electron-builder.jsonβ
{
"appId": "com.example.fitfileviewer",
"productName": "Fit File Viewer",
"files": [
"**/*",
"!tests/**"
],
"win": {
"target": ["nsis", "portable", "msi"],
"icon": "icons/favicon.ico"
},
"mac": {
"target": ["dmg", "pkg"],
"icon": "icons/favicon.icns"
},
"linux": {
"target": ["AppImage", "deb", "rpm"],
"icon": "icons/favicon.png"
}
}
package.json Build Settingsβ
{
"build": {
"appId": "com.example.fitfileviewer",
"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 install
- run: npm run build
Release Processβ
1. Update Versionβ
# Update version in package.json
npm version patch # or minor, major
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β
Windowsβ
Requires certificate:
{
"win": {
"certificateFile": "cert.pfx",
"certificatePassword": "${CSC_KEY_PASSWORD}"
}
}
macOSβ
Requires Apple Developer ID:
{
"mac": {
"hardenedRuntime": true,
"gatekeeperAssess": true
}
}
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