-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
GithubPublisher does not respect detectUpdateChannel
setting
#8589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ah, I see now. I'm not sure how to approach this though as enabling update channel detection on github would be a breaking change. It's already default true, so this would change the behavior of every updater in the electron-builder ecosystem. |
I'd say the obvious choice is to accept that this is a breaking change and release it in the next major version, with prominent documentation. Otherwise, it be done in a two-phase way. The Github provider could emit a warning message like " |
It already defaults true electron-builder/packages/app-builder-lib/src/options/PlatformSpecificBuildOptions.ts Lines 168 to 172 in c848430
|
Yes, and since that’s not respected downstream, you may as well retcon the behavior as “default: false for github, true for other providers”. |
Tbh, I don't want to make this change. It's a hefty breaking change for current publish logic, which is a highly sensitive area (along with electron-updater) Instead, I've put together a
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Not stale |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Still not stale |
I provided you a patch-package to supply this functionality for your personal project. As it currently stands, I'm not implementing this in electron-builder unless more devs request this functionality. |
Thanks! As much as I'd expect and want this to be default, I appreciate the sense of direction. Much better to have the issue closed as "not planned" rather than closed as stale. I'll submit a PR to update the docs. |
Let me know if you need a patch-package for the latest v26.x.x electron-builder 🙂 |
I don't - The hardest part with this issue was figuring out what was happening and why. My coworker said "I followed the instructions to set up release channels" and in particular was misled by this statement in the docs:
Since I'm using import packageJson from './package.json' with { type: 'json' };
import { prerelease } from 'semver';
function getReleaseChannel() {
let result = prerelease(packageJson.version)?.[0] ?? 'latest';
if (!['beta', 'dev', 'latest'].includes(result)) {
console.warn(
`⚠️ Inferred release channel "${result}" is not recognized. Defaulting to "dev"`,
);
return 'dev';
}
return result;
}
publish: {
provider: 'github',
channel: getReleaseChannel(),
}, |
Uh oh!
There was an error while loading. Please reload this page.
N/A
I'm using
electron-builder
withdetectUpdateChannel = true
,generateUpdatesFilesForAllChannels = true
, andpublish.provider = "github"
, and it will not set thechannel
based on the version (e.g.1.2.3-beta.4
in my package.json. All builds wind up creating alatest.yml
file.electron-builder
does emit the channel-specific yaml if I setpublish.channel
explicitly.It seems the logic to do this is typically in
SomePublisherClass.checkAndResolveOptions
1 butGitHubPublisher
has no such function, instead doing all options logic in the constructor2.Footnotes
https://github.com/electron-userland/electron-builder/blob/8cc2b42a0386d07b90749b5ce52de221786c46a2/packages/app-builder-lib/src/publish/PublishManager.ts#L481-L516 ↩
https://github.com/electron-userland/electron-builder/blob/8cc2b42a0386d07b90749b5ce52de221786c46a2/packages/electron-publish/src/gitHubPublisher.ts ↩
The text was updated successfully, but these errors were encountered: