Closed benbucksch closed 3 weeks ago
@jermy-c thanks for the PR #154, which implements the idea 1 "Separate repo" above.
Rename latest.yam to latest-parula.yaml and latest-mustang.yaml
@jermy-c Could you please investigate whether that is possible? Is the "latest" configurable? If not, can you make a PR for electron-builder and electron-update to support that?
It's not possible to rename the update files because electron-builder
relies on the naming to determine the channel, os and architecture. The latest
is only configurable through changing the channels.
To support renaming files would take a lot of changes because the electron-builder
and electron-updater
. It uses the format {channel}{os}{architecture}.yml
generate and search for the correct update file.
Should I continue with it?
Using channels (release, beta, alpha) might be an option? Does that result in different filenames? Are the channel names configurable?
Yes, it does change the fileanme. If you set
publish:
- provider: github
protocol: https
releaseType: release
channel: parula
It creates:
parula.yml
parula-mac.yml
parula-linux.yml
Oh, perfect! Can we do that for Mustang as well? Can you test it and make a PR? This looks great! Exactly what I had hoped for! Well done!
Works beautifully, at least the files: https://github.com/mustang-im/mustang/releases/tag/v0.5.7
Unfortunately, the updater still uses "latest" as filename: Error: Error: Cannot find latest-linux.yml in the latest release artifacts (https://github.com/mustang-im/mustang/releases/download/v0.5.8/latest-linux.yml): HttpError: 404
The update client still uses the old filename "latest".
Given that already the file fetch fails (which is before mac signature verification), and we have the correct files on the server, you should be able to test locally. you just need to lower the version number of your local build to 0.5.1. It should find and download the update. If it fails to verify the signature, then we're a step further. make sure that the automated release builds then create the build like this.
(property) AppUpdater.channel: string | null Get the update channel. Not applicable for GitHub. Doesn't return channel from the update configuration, only if was previously set. Set the update channel. Not applicable for GitHub. Overrides channel in the update configuration.
Setting the channel doesn't change the channel in the GitHubProvider
update fetcher. It's available in electron-builder.yml
but only sets the filename for the latest.yml
but it doesn't nothing in the AppUpdater
.
Can you make a PR to fix it, please? getCustomChannelName() sounds promising.
Ok, will do.
I created an Issue and another dev made a PR for the issue. https://github.com/electron-userland/electron-builder/issues/8388
Auto-update is still not working. The update is downloaded but it is not installed when all windows are closed or when the app is quit. I'm not sure if it's supposed to install when the app is quit or when all windows are closed. If the condition to install the update when the all windows are closed it may be because the backend is still running. But the notification message says it will install when the app is quit.
The update is downloaded
Did you check both Parula and Mustang? Is the right version being downloaded? If so, then it means that this bug is fixed.
I've re-opened #142 for the other issue, to be debugged.
The updater is downloading the wrong version i.e. it is downloading the windows version.
Files downloaded:
Download dir: ~/Library/Caches/mustang-updater
The root cause might be the incorrect OS version.
Ah, that's funny. Of course that wouldn't work.
Does it fetch mustang.yml (which is Windows - that would explain the bug) or mustang-mac.yml (correct) or something else to find the latest version?
My bad. We just need to update the electron-updater
package to 6.3.3
which includes the custom channel feature for GitHub. We're currently still on the stable version 6.2.1
. That's going to fix it.
@jermy-c That's great! I've just upgraded it. Let's see whether this fixes it.
Part of #142 Please see #147 for background.
Problem
Given that we have Mustang and Parula brands, in the same repo, during a release, both are trying to write the latest.yml files. Whoever is last wins and overwrites the other one.
Artifacts
Here are the 2 versions: latest-linux.yml before re-run latest-linux.yml after re-run
Solution idea
Separate repo for Parula release
One option would be that we make another repo for parula, called mustang-im/parula, and add the Parula GitHub actions there, and set it up so that either:
Either way, we need to make sure that electron-updater uses the right repo for Parula.
This option is rather cumbersome.
Merge files
Somehow find a way to write the contents of both files together into the same file. This is assuming that the auto-update is smart enough to know its own app name and picks the right entries from the file.
Given that the upload is automatic and part of electron-builder, it might need some trickery to merge the files.
Other idea
Maybe you have other, even simpler ideas how to fix it?