Skip to content

Commit 40e2390

Browse files
carterscodeclaude
andcommitted
fix(release): stop merges from publishing, filter prerelease tags, gate manual update in dev builds
Three independent release-plumbing fixes, none of them UI-overhaul work. release.yml no longer fires on a push to main. It published on any push touching src/** or installer/**, so merging a PR was indistinguishable from cutting a release -- v0.1.62 through v0.1.64 all shipped that way as a side effect of merging. Publishing now requires an explicit act: a pushed v*.*.* tag or a manual workflow_dispatch. Both remain. The version auto-bump now filters prerelease tags. The 'v*.*.*' glob also matches v0.1.65-beta.1, and with no filter $parts[2] becomes "65-beta", which [int] throws on -- a tagged prerelease would have broken every subsequent release. dev-build.yml has always had this filter; release.yml did not, despite the docs claiming both did. The Settings "Check now" button no longer self-updates a dev build. The startup check has always been gated on App.IsDevBuild(), but this manual path was not: clicking it in a dev build downloaded the newest stable installer and launched it over the running build. It now reports that updates are disabled and returns. Shipping bug, independent of the beta channel work. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent eb4afa4 commit 40e2390

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: release
22

3+
# Releases are cut deliberately, never as a side effect of merging. A push to
4+
# main used to publish whenever it touched src/** or installer/**, which meant
5+
# every merged PR consumed a version and shipped an installer. Publishing now
6+
# requires an explicit act: push a v*.*.* tag, or run the workflow by hand.
37
on:
48
push:
5-
branches: [main]
6-
paths:
7-
- 'src/**'
8-
- 'installer/**'
9-
- '.github/workflows/release.yml'
109
tags: ['v*.*.*']
1110
workflow_dispatch:
1211
inputs:
@@ -47,7 +46,11 @@ jobs:
4746
$v = $manual
4847
$createTag = $true
4948
} else {
50-
$latest = (git tag --list 'v*.*.*' --sort=-v:refname | Select-Object -First 1)
49+
# Stable tags only. The 'v*.*.*' glob also matches prerelease tags
50+
# like v0.1.65-beta.1, and $parts[2] would then be "65-beta", which
51+
# [int] throws on -- failing the release. dev-build.yml has always
52+
# filtered these out; release.yml did not.
53+
$latest = (git tag --list 'v*.*.*' --sort=-v:refname | Where-Object { $_ -notmatch '-' } | Select-Object -First 1)
5154
if ([string]::IsNullOrWhiteSpace($latest)) { $latest = 'v0.0.0' }
5255
$parts = ($latest -replace '^v','').Split('.')
5356
$patch = [int]$parts[2] + 1

src/GamerGuardian/UI/SettingsWindow.xaml.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,22 @@ private void OpenChangeLogButton_Click(object sender, RoutedEventArgs e)
10271027

10281028
private async void CheckUpdatesNowButton_Click(object sender, RoutedEventArgs e)
10291029
{
1030+
// Dev builds must never self-update. The startup check has always been
1031+
// gated on this (App.OnStartup), but this manual path was not: clicking
1032+
// "Check now" in a dev build would download the newest *stable* installer
1033+
// and launch it over the running dev build. Same guard, both paths.
1034+
if (App.IsDevBuild())
1035+
{
1036+
System.Windows.MessageBox.Show(
1037+
this,
1038+
$"This is a development build (v{UpdateService.CurrentSemver()}). "
1039+
+ "Automatic updates are disabled so it can't replace itself with a release build.",
1040+
"GamerGuardian",
1041+
System.Windows.MessageBoxButton.OK,
1042+
System.Windows.MessageBoxImage.Information);
1043+
return;
1044+
}
1045+
10301046
var btn = CheckUpdatesNowButton;
10311047
var prev = btn.Content;
10321048
btn.IsEnabled = false;

0 commit comments

Comments
 (0)