I have a repository that utilizes electron-updater for auto update. The weird thing is, it has no any code whatsoever pointing where the release updates are stored (I store it in GitHub releases), but somehow the autoUpdater.checkForUpdatesAndNotify() still works. There is github remote origin but I doubt it's being used by electron-updater to find the repository. I don't use any GitHub token either.
The way I release update:
- Increase the
versioninpackage.json - Run
electron-builder, producing.AppImage - Create new release draft in my repository's GitHub releases
- Upload the
.AppImagefile to the draft's assets and modify the draft's tag - Download the previous release, and then open it
- Voila! The update works. But how?
It's worth mentioning that if latest-linux.yml is missing from the latest release's asset, it will throw 404 error and refuse to update despite knowing the latest version's tag.
Here's the repository I'm talking about: https://github.com/SnekNOTSnake/fresh-update/releases
Also, is this how normal people release their electron app? I tried the electron-builder --publish way, but it's troublesome compared to the manual steps above.
Thanks to Caramiriel in the comment section above for the enlightenment.
How
electron-updaterknows where to find the repository is fromresources/app-update.ymlinside the produced.AppImagefile.The
app-update.ymlfile is produced byelectron-builderusing the information fromgit remote get-url origin(if available).I proved it by changing the
origin's url tohttps://github.com/SnekNOTSnake/tofu-tracker.gitand build the AppImage, and (surprisingly enough) therepo's value becametofu-tracker.