Now go to the entry point of your app and add two lines of code (yes, just two). You can explore the rest of my package.json as an example, but most of the things there are irrelevant to this article. Now make sure that your Electron project's package.json has a valid name field, a valid version field and a repository field that uses the URL of the public repository you've just created. We will store the binaries in the GitHub Releases tab of this repository and electron-updater will check this repository for the new updates. Next, create an empty GitHub public repository with a readme file (even with just the name of the repository). Oh, I'll use yarn in this tutorial, feel free to use npm instead. Let's install it, run the following command: We need to set up electron-updater so that it checks if there are any updates available in the public GitHub repository. I'm also building everything on macOS, because I couldn't find a way to build macOS binaries on Linux, so in case you are not using macOS, just omit the macOS build configs and steps in this article. To achieve the desired outcome we'll use electron-updater, versiony and good old electron-builder. However, if you want to avoid having an "untrusted developer" popup when installing the macOS app, you have to notarize the app with Apple - I'll show you how to do so later in the article. Apple isn't keen on approving the Electron apps recently, so not using the App Store to distribute the binary can be a good idea. Snapcraft will be the only app store we'll use, only uploading other binaries to the GitHub Releases tab in a public repository. We will build the app for Linux, Windows, macOS and Snapcraft (a fancy linux app store). In case if you don't have Electron app set up with the electron-builder, follow quick start here. I assume that you have a working Electron app already that you want to deploy with one command in the command line and forget about all the troubles. Hi everyone! In this article I'll explain you how to make use of existing tools to deploy an Electron app with the auto-update enabled just like we are doing with the Todorant app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |