How to create release channels with electronic / electronic builder?

I have an Electron application where I want to introduce parallel release channels: stable , next (for early users) and dev (for testing the latest build).

They will each have a branch, and new functions appear first in dev , moving on to next for beta testing and finally moving to stable .

I use electron-builder to make these release packages, and I want everyone to have their own automatic updates, so when I publish a new next release of all the users with whom it receives the update.

I want the applications to be independent - the user can have two channels installed and run both at the same time. They will have different names and different badges.

I can manually install them in the branches, but in fact I want to automate this as much as possible - publishing from the next branch should use the correct name, icons, identifiers and updates without risking the wrong channel.

Is there a way to do this with an electronic or electronic builder?

+6
source share
1 answer

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 
+5
source

Source: https://habr.com/ru/post/1012626/


All Articles