diff options
| author | 5an7y <[email protected]> | 2026-03-31 16:02:08 -0700 |
|---|---|---|
| committer | 5an7y <[email protected]> | 2026-03-31 16:22:25 -0700 |
| commit | 8508ffaaf97a200fe6e8588333c6ab1383687d4f (patch) | |
| tree | d14b5528b84b9cbffb14025c1e4d4960fd564173 | |
| parent | 12f94c8573a5ef79abf7842d3ea0faf458c3f733 (diff) | |
refactor: remove Github RunMode
NuGet mode works correctly for GitHub Actions (the HTML open is already
guarded by [Environment]::UserInteractive which is false on CI runners).
The Github mode was redundant and is removed to keep the interface clean.
Co-authored-by: Copilot <[email protected]>
| -rw-r--r-- | Build-Samples.ps1 | 16 | ||||
| -rw-r--r-- | BuildEnvironment.ps1 | 8 |
2 files changed, 7 insertions, 17 deletions
diff --git a/Build-Samples.ps1 b/Build-Samples.ps1 index 50f48949..a479177b 100644 --- a/Build-Samples.ps1 +++ b/Build-Samples.ps1 @@ -39,9 +39,8 @@ automatically based on the WDK build number. .PARAMETER RunMode - Selects the build environment mode. Valid values: Auto, WDK, NuGet, EWDK, Github. - Defaults to 'Auto', which detects the environment automatically (EWDK → WDK → NuGet). - 'Github' behaves identically to 'NuGet' but suppresses opening the HTML report at the end. + Selects the build environment mode. Valid values: Auto, WDK, NuGet, EWDK. + Defaults to 'Auto', which detects the environment automatically (NuGet → EWDK → WDK). .PARAMETER ThrottleLimit Maximum parallel build jobs. Defaults to 5 x logical processors. @@ -70,11 +69,6 @@ .\Build-Samples -RunMode WDK Forces WDK mode regardless of environment variables. - -.EXAMPLE - .\Build-Samples -RunMode Github - - Runs as NuGet mode (reads packages\) without opening the HTML report — intended for CI. #> #Requires -Version 7.0 @@ -87,7 +81,7 @@ param( [string]$LogFilesDirectory = (Join-Path (Get-Location) "_logs"), [string]$ReportFileName = $(if ([string]::IsNullOrEmpty($env:WDS_ReportFileName)) { "_overview" } else { $env:WDS_ReportFileName }), [string]$InfOptions, - [ValidateSet('Auto', 'WDK', 'NuGet', 'EWDK', 'Github')] + [ValidateSet('Auto', 'WDK', 'NuGet', 'EWDK')] [string]$RunMode = 'Auto', [int]$ThrottleLimit = 0 ) @@ -665,7 +659,7 @@ $sortedResults = $buildState.Results | Sort-Object { $_.Sample } $sortedResults | ConvertTo-Csv | Out-File $reportCsvPath $sortedResults | ConvertTo-Html -Title "WDK Sample Build Overview" | Out-File $reportHtmlPath -# Only open the HTML report interactively (not in CI/automation or Github mode) -if (-not $buildEnv.IsGithubMode -and -not $env:BUILD_BUILDID -and [Environment]::UserInteractive) { +# Only open the HTML report interactively (not in CI/automation) +if (-not $env:BUILD_BUILDID -and [Environment]::UserInteractive) { Invoke-Item $reportHtmlPath } diff --git a/BuildEnvironment.ps1 b/BuildEnvironment.ps1 index 285f3d7e..08f0469e 100644 --- a/BuildEnvironment.ps1 +++ b/BuildEnvironment.ps1 @@ -122,11 +122,10 @@ function Resolve-BuildEnvironment { Detects or resolves the active build environment and returns metadata. .DESCRIPTION When RunMode is 'Auto', checks in priority order: NuGet, EWDK, WDK. - When RunMode is 'Github', behaves identically to 'NuGet' and sets IsGithubMode. When RunMode is explicitly set to WDK/NuGet/EWDK, skips detection and uses that mode. Pass the VsInstallation returned by Initialize-DevShell to avoid prompting the user a second time when multiple VS installations are present. - Returns a hashtable: Name, BuildNumber (int), NuGetVersion, WdkVsComponentVersion, IsGithubMode. + Returns a hashtable: Name, BuildNumber (int), NuGetVersion, WdkVsComponentVersion. #> param( [string]$RepoRoot, @@ -139,12 +138,9 @@ function Resolve-BuildEnvironment { BuildNumber = [int]0 NuGetVersion = '' WdkVsComponentVersion = '' - IsGithubMode = $false } - # Resolve effective mode for Github (same path as NuGet) - $effectiveMode = if ($RunMode -eq 'Github') { 'NuGet' } else { $RunMode } - if ($RunMode -eq 'Github') { $result.IsGithubMode = $true } + $effectiveMode = $RunMode # --- Resolve build environment --- if ($effectiveMode -eq 'NuGet' -or |
