How Forge takes your app code from development to distribution.
Once your app is ready to be released, Electron Forge can handle the rest to make sure it gets into your users' hands. The complete build flow for Electron Forge can be broken down into three smaller steps:
Forge's build flow
Each one of these steps is a separate command exposed through Forge's
electron-forgecommand line interface, and is usually mapped to a script in your package.json file.
This step also performs a few supporting tasks:
- Rebuilds native node add-ons for your app's Electron version.
By default, running the Package step will only create a packaged application for your machine's platform and architecture.
Forge's Make step takes the bundled executable output from the previous Package step and creates "distributables" from it. Distributables refer to any output format that you want to distribute to users, whether it be an OS-specific installer (e.g.
.msi) or a simple compressed archive (e.g.
.zip) of the bundle.
By default, running the Make step will only run Makers targeting your machine's platform and architecture.
Forge's Publish step takes the distributable build artifacts from the Make step and uploads for distribution to your app's end users (e.g. to GitHub Releases or AWS S3 static storage). Publishing is an optional step in the Electron Forge pipeline, since the artifacts from the Make step are already in their final format.
Your Electron application might have custom build needs that aren't handled with the most basic Forge pipeline described above. To solve this issue, Electron Forge exposes callback hooks at various points in the build process.
By default, Electron Forge will only build your app for the operating system it's running on. Targeting a different operating system (e.g. building a Windows app from macOS) has many caveats.
If you don't have access to Windows, macOS, and Linux machines, we highly recommend creating a build pipeline on a Continuous Integration platform that supports all these platforms (e.g. CircleCI or GitHub Actions). For an example of CI builds in action, see Electron Fiddle's GitHub Actions pipeline.