This is possible with electron-builder
. I would have several build configurations and tell electron-builder
to be used during creation.
For example, create a config/beta.json
with the following setting:
{ "appId": "com.company.beta", "productName": "App Beta", "directories": { "buildResources": "build/beta" // directory containing your build-specific assets (eg, beta icons - icon.icns, icon.ico & background.png) }, "mac": { "category": "public.app-category.finance" }, "win": { "target": [ "nsis" ] }, "nsis": { "perMachine": false }, "publish": [ { "provider": "s3", "bucket": "com-app-beta" // dedicated S3 bucket for each build } ], }
And duplicate config/beta.json
for next.json
and current.json
(do not forget to edit the settings accordingly).
Add the following build scripts to package.json
(note --em.name=app-beta
to rewrite package.json
"name"):
{ "scripts": { "build": "build -owl --x64 --config ./config/current.json -p always --em.name=app", "build-beta": "build -owl --x64 --config ./config/beta.json -p always --em.name=app-beta", "build-next": "build -owl --x64 --config ./config/next.json -p always --em.name=app-next" } }
Run the build script when ready for deployment:
npm run build-beta
source share