Overview
GitHub Desktop uses a multi-stage build pipeline combining webpack, electron-packager, and platform-specific packaging tools. This document outlines the build process for all supported platforms.Build Pipeline
Webpack Configuration
Configuration Files
GitHub Desktop uses webpack to transpile and bundle application resources. Configuration files are located inapp/:
app/webpack.common.ts- Base configuration and shared settingsapp/webpack.development.ts- Development mode overridesapp/webpack.production.ts- Production mode optimizations
Build Targets
Webpack organizes source files into these output targets:Build-Time Replacements
Webpack replaces platform-specific placeholders during compilation:Additional Processing
1
SCSS compilation
Stylesheets under
app/styles/ are transpiled to CSS and emitted.2
Source map generation
Source maps correlate runtime errors to TypeScript source.
3
Output to /out
Compiled assets are written to the
out/ directory (ignored in git).Version Management
Canonical Version
The version number displayed in About GitHub Desktop comes from:This
version attribute in app/package.json is the single source of truth for the application version.Changelog
Thechangelog.json file tracks user-facing changes:
- New features
- Bug fixes
- Improvements
- Removed features
Build Script
script/build.ts
After webpack compilation,script/build.ts handles:
1
Resource merging
Moves additional static resources into the output directory.
2
License generation
Creates a license bundle from project dependencies, accessible from About GitHub Desktop.
3
License metadata
Generates license metadata from choosealicense.com for the “Add license” feature.
4
Electron packaging
Launches electron-packager to merge app resources with Electron runtime.
Code Signing (macOS)
electron-packager performs code-signing on macOS during the build stage.
Package Script
Platform-Specific Packaging
Fromscript/package.ts:38:
macOS Packaging
Archive Creation
Fromscript/package.ts:53:
1
Application bundle ready
The previous build step created a signed
.app bundle.2
Compress to ZIP
The app is compressed using
ditto, reducing download size by ~60%.3
Ready for distribution
No additional packaging needed for macOS.
Windows Packaging
Dual Installer Strategy
Desktop useselectron-winstaller to generate two installers:
Squirrel Installer - User-level installation without elevated permissionsWindows Installer (MSI) - Administrator-level installation for enterprise deployment
script/package.ts:63:
Installation Targets
Squirrel Installer (.exe)- Installs to
%LOCALAPPDATA% - No administrator rights required
- Automatic updates supported
- Preferred for individual users
- Can be deployed by administrators
- Still uses
%LOCALAPPDATA%when users run the app - See #1086 for ongoing discussion
Code Signing (Windows)
Fromscript/package.ts:108:
electron-winstaller handles installer code-signing during the packaging process.
Delta Packages
Squirrel supports delta packages representing differences between versions, reducing update download sizes.
script/package.ts:100:
- Downloads the previous version
- Computes binary diff
- Creates smaller update packages
- Only unchanged bytes are downloaded
NuGet Package Renaming
Fromscript/package.ts:132:
Linux Packaging
Linux packaging is maintained in the
shiftkey/desktop fork.Refer to that repository for:.debpackage creation.rpmpackage creation- AppImage distribution
- Snap packaging
Publishing
script/publish.ts
The publish script:1
Upload artifacts
Uploads packaging artifacts to S3 bucket.
2
Verification
Artifacts are verified before release.
3
Distribution
Build is made available to users after verification.
Bundle Size Tracking
Fromscript/package.ts:47:
Development Commands
Build for Development
webpack.development.ts configuration:
- Source maps enabled
- No minification
- Fast build times
Build for Production
webpack.production.ts configuration:
- Minification enabled
- Optimized bundle sizes
- Production replacements
Package Application
- Clean output directory
- Run webpack build
- Execute build script
- Run package script
Troubleshooting
Build Failures
Missing dependenciesCode Signing Issues
macOS: No identity found- Install valid Apple Developer certificate
- Verify in Keychain Access
- Set
CSC_NAMEenvironment variable
- Check Azure Code Signing configuration
- Verify certificate is valid
- Ensure proper permissions in CI/CD
Package Errors
electron-packager fails- Check Electron version compatibility
- Verify all dependencies are installed
- Ensure output directory is writable
- Check icon file exists and is valid .ico
- Verify splash screen GIF is present
- Ensure sufficient disk space