Template for Electron Builder which includes features like auto updating, appx file build with Electron Windows Store, and other stuff.
Go to file
Korbs f1d5eada42
update
2023-04-24 23:24:44 -04:00
.github/workflows update 2023-04-24 23:24:44 -04:00
build Make pop up occur for AppImage (Linux) 2021-08-16 02:14:29 -04:00
extra Add new example for "extraResources" 2021-08-16 02:14:11 -04:00
.drone.yml update 2023-04-24 23:24:44 -04:00
.gitignore Necessary 2021-08-16 02:13:45 -04:00
.gitlab-ci.yml update 2023-04-24 23:24:44 -04:00
LICENSE Update LICENSE 2022-01-06 02:04:14 -05:00
README.md update 2023-04-24 22:20:41 -04:00
index.html update 2023-04-24 21:55:55 -04:00
main.js update 2023-04-24 22:20:41 -04:00
package-lock.json Bump electron from 16.0.10 to 16.2.6 2022-06-16 23:22:35 +00:00
package.json Update package.json 2022-07-15 23:31:48 -04:00

Update of April 24th, 2023:

I'm currently working on add more workflow files for other CI/CDs like Drone, GitLab, Woodpecker, and more!


Electron Builder Sample

Previews

Application

Application Preview Windows Installer macOS Installer

Documentation

It's probably best that you read documentation from the official website at electron.build.

Building Flatpak for Linux

This is not in Electron Builder's documentations for some reason, but if you're wanting to build a .flatpak file, it's possible with Electron Builder.

First, you'll need to install Flatpak Builder:

sudo dnf install flatpak-builder #or use "apt" if you're using debian/ubuntu
flatpak --user remote-add --from flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --user install flathub org.gnome.Platform//3.38 org.gnome.Sdk//3.38

Then use flatpak as the target for Linux.

Publish

I'm only aware with how GitHub and self-hosting works, when it comes to including auto-updates.

For other options like S3 or Amazon, go to the offiical website at electron.build.

GitHub

"publish": [
    {
    "provider": "github",
    "owner": "username",
    "repo": "repo_name",
    "releaseType": "draft"
    }
]

If you plan to not use the GitHub Actions included with this template, you'll need to either set your GitHub Token in the environment or add it manually to the configuration(not recommended).

To set GitHub Token in the enviroment on Windows, run Powershell as admin and run:

[Environment]::SetEnvironmentVariable("GITHUB_TOKEN","<YOUR_TOKEN_HERE>","User")

macOS/Linux:

export GH_TOKEN="<GITHUB_TOKEN_HERE>"

To set it manually, just add "token": "<GITHUB_TOKEN_HERE>" to the publish configuration, which is not recommended.

The template includes a publish command, seen in package.json, which can be run by using:

npm run publish

Self-Hosted

"publish": [
    {
    "provider": "generic",
    "url": "https://example.com/update/",
    "channel": "latest"
    }
]

Make sure the URL contains the latest-OS.yml file, if you're including auto-updates with the application.

NOTE: Don't use Node 16.x with Electron Builder, there seems to be an error with macOS.

Using with GitHub Actions

This template includes workflow file already prepared to build for Windows, macOS, and Linux. Go to the Actions tab, select "Build Executable Files", then under "Run workflow" click Run. After the Action is completed, you can download the files from the Summary of the action. GitHub Actions only supports x64 systems.