Search code examples
reactjselectroncontinuous-integrationbitbucketelectron-builder

Question about electron-builder auto update and bitbucket pipeline


I'm currently trying to add auto update on a electron app with electron-builder auto update and bitbucket pipeline.

But I have some difficulty to understand what eact part (electron-builder and bitbucket pipeline) have to do.

What is the goal of the bitbucket pipeline in this situation ?

For me, in the pipeline, I have to install the dependancy (with npm install), build the project (with npm build) and make the installer for window (with electron-builder -w -c.extraMetadata.main=build/electron.js). And after this, the configuration in my package.json in my electron application has to take the new installer to install the new update on the application (with the autoUpdater.checkForUpdatesAndNotify() ;).

It is the good method to follow or am I complety wrong ?

Thank for you reading.


Solution

  • If you are willing to simply publish via bitbucket. You don't need to care about the bitbucket pipeline too much.

    In electron-builder there is bitbucket publish option.

    enter image description here

    You should set the publish option in the electron-builder configuration. And this will do everything you want. If you wanna see what's happening behind the pipeline. It is what you know. After installing deps and it will build artifacts and these files will be stored somewhere.

    In your case, you should dig into how to set up the bitbucket env and electron-builder config.

    enter image description here

    ref: https://www.electron.build/configuration/publish.html

    Before publishing, I'd recommend you try to build your app on your local machine at least to make sure everything is working.