fix: mark pre-release versions as such in GitHub releases#41
Merged
Conversation
The release workflow was hardcoding releaseType=release for all versions. This caused pre-release versions (e.g. 2.10.1-beta.1) to update latest.yml on GitHub, making electron-updater offer them to stable users (even though allowPrerelease defaults to false). Fix: detect semver pre-release identifiers (e.g. 2.10.1-beta.1 vs 2.10.1) and set releaseType=prerelease accordingly. electron-builder will then mark those GitHub releases as pre-releases, and electron-updater will correctly skip them for stable users. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The release workflow was hardcoding
releaseType: releasefor all versions. This caused pre-release versions (e.g.2.10.1-beta.1) to updatelatest.ymlon GitHub, making electron-updater offer them to stable users (even thoughallowPrereleasedefaults tofalse).Fix: detect semver pre-release identifiers and set
releaseType=prereleaseaccordingly so electron-builder marks those GitHub releases as pre-releases, and electron-updater correctly skips them.What changed
.github/workflows/release.yml— add bash logic to detect pre-release versions (regex:^[0-9]+\.[0-9]+\.[0-9]+$= stable, anything else = pre-release), then pass--config.publish.releaseType=$release_typeto electron-builderTesting
2.10.1→releaseType=release→ updateslatest.yml→ users get update2.10.1-beta.1→releaseType=prerelease→ GitHub marks as pre-release → electron-updater skips for stable users (as intended)