The application can be packed in several ways. The important thing to note is that depending on the target (windows, linux and mac) there will be different parts involved.
Create a .env
file with the following values:
APPLEID
: Apple ID email used in the Apple developer portal.APPLEIDPASS
: Apple ID password.
These two values are used for notarizing the application: - More info in this Blog and in the Apple Docs
yarn pack-mac-prod
: Packages the app without notarazing it. Useful for testing locally.yarn pack-mac-prod-notarized
: Packages the app and notarizes it using the Apple Services (this is required on >= Mac OS Catalina). It will run theelectron-builder-scripts/notarize.js
after the packaging is complete.
Create a electorn-builder.env
file with the following values:
GH_TOKEN
: This token is required to deploy the application on Github. It can be generated here: https://github.com/settings/tokens/new and the scope must be repository.WIN_CSC_LINK
: Path to the.p12
code signing certificate. This certificate is generated through the CERN CAWIN_CSC_KEY_PASSWORD
: Password for theWIN_CSC_LINK
certificate.
yarn pack-windows-prod
: Packages the application for Windows.
On some Linux distros, --no-sandbox
is needed in order to run the application. We are applying this flag using Docker
after the Linux packages are created. Check the Steps to generate the propper AppImage section for more details.
yarn pack-linux-prod
: Packages the application for Linux.
Next version is an alternative version that allows us to test electron-builder builds and point to diffent backends.
electron-builder-next.json
file is used to pack the application in NEXT
mode.
yarn electron-pack-next
: Generates packages for Mac, Windows and Linux on thedist
dir. SetsREACT_APP_NEXT
to true.yarn publish-next
: Publish the current version of the app in Github releases, but enables the "beta" channel.
From electron-builder docs: https://www.electron.build/tutorials/release-using-channels
The following versions will be distributed to users depending on the channel defined:
Release
: users will get the latest release versionPrerelease
: users will get the latest prerelease version
The deployment of the application must be done in 3 phases, one for each platform.
Imagine that your application is stable and in version 1.0.1
.
If you want to release a beta for the new 1.1.0
version, you only need to publish a prerelease.
When your application is stable enough, you want to release it to all users. For that, you only need to publish it as release.
yarn publish-prod-mac
: Generates packages for Mac (signing and notarizing the app if possible) on thedist
dir and then uploads them to Github as adraft
(Won't be visible to users).yarn publish-prod-win
: Generates packages for Windows (signing the app if possible) on thedist
dir and then uploads them to Github as adraft
(Won't be visible to users).yarn publish-prod-linux
: Generates packages for Linux (adding the --no-sandbox to the binary using docker) on thedist
dir and then uploads them to Github as adraft
(Won't be visible to users).
Run the following command on webapp
folder (this one).
xattr -cr .