Skip to content

Commit 3e26fc3

Browse files
authored
v1.99.0: semver correction for the 5 feature modules + winget/chocolatey trigger fix (#20)
* v1.99.0 — correct semver for the 5 feature modules + fix winget/chocolatey triggers SEMVER CORRECTION: The five feature modules (Azure Arc, Defender for Endpoint, WSUS, AD CS, Storage Migration) were each shipped as a patch bump (v1.98.58-1.98.62). That was wrong — a new feature is a minor bump (the y in x.y.z), not a patch. They are now consolidated into a single proper minor release, v1.99.0, consistent with how v1.93.0 / v1.95.0 / v1.96.0 / v1.97.0 were each feature releases on the minor track. - Version bumped 1.98.62 -> 1.99.0 across Header.ps1, RackStack.ps1, RackStack.psd1, Modules/00-Initialization.ps1, Tests/Run-Tests.ps1. - Changelog.md: the five v1.98.58-1.98.62 entries are replaced by one consolidated v1.99.0 entry. v1.98.55-57 (audit fixes, coverage, Silver-badge infra — genuinely patches) are unchanged. - The mis-numbered v1.98.62 GitHub release + tag are deleted separately (see release cleanup). v1.98.58-62 on PowerShell Gallery are immutable and cannot be deleted — they can only be unlisted via the PSGallery UI. WINGET / CHOCOLATEY TRIGGER FIX: The standalone winget.yml and chocolatey.yml workflows triggered on — but a release created with GITHUB_TOKEN (which is how ci.yml creates releases) does NOT trigger event workflows (GitHub recursion-prevention). So they never ran once. - winget + chocolatey submission are now inlined as steps in the ci.yml release job, right after the GitHub Release + PowerShell Gallery publish steps. They run exactly when a release is cut. - A 'Detect publish tokens' step exposes WINGET_TOKEN / CHOCO_API_KEY presence as step outputs (the secrets context is not usable in step if: conditions); the winget/choco steps gate on those. - Both are continue-on-error so a publish hiccup never fails a release. - Standalone .github/workflows/winget.yml + chocolatey.yml deleted. - dist/README.md + dist/chocolatey/README.md updated to describe the inlined approach. PSSA 0/0, regex harness 4759/4759, Pester 312/312. RackStack v1.99.0: 70 modules, 181 CLI actions. * fix(ci): use wingetcreate CLI instead of winget-releaser action The winget-releaser action pulls in an unpinned transitive action (cargo-bins/cargo-binstall@main); the repo's sha_pinning_required policy correctly rejected the whole workflow run. Switch the winget submission step to download + run Microsoft's wingetcreate.exe directly — a single signed binary with no nested actions, so it stays inside the SHA-pinning policy. wingetcreate update handles every release after the package exists in winget-pkgs; the first-ever submission is a documented one-time manual step.
1 parent 4635d84 commit 3e26fc3

11 files changed

Lines changed: 158 additions & 326 deletions

File tree

.github/workflows/chocolatey.yml

Lines changed: 0 additions & 118 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,100 @@ jobs:
494494
}
495495
exit 0
496496
497+
# Detect which publish-channel tokens are configured. The `secrets`
498+
# context is not reliably usable in step-level `if:` conditions, so
499+
# presence is checked here and exposed as step outputs the winget /
500+
# chocolatey steps gate on.
501+
- name: Detect publish tokens
502+
id: pubtokens
503+
if: steps.vercheck.outputs.bumped == 'true' && steps.releasecheck.outputs.exists == 'false'
504+
env:
505+
WT: ${{ secrets.WINGET_TOKEN }}
506+
CT: ${{ secrets.CHOCO_API_KEY }}
507+
run: |
508+
$w = if ([string]::IsNullOrWhiteSpace($env:WT)) { 'false' } else { 'true' }
509+
$c = if ([string]::IsNullOrWhiteSpace($env:CT)) { 'false' } else { 'true' }
510+
"winget=$w" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
511+
"choco=$c" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
512+
Write-Host "winget token: $w choco token: $c"
513+
514+
# Submit to winget-pkgs. Inlined into the release job (rather than a
515+
# separate workflow on `release: published`) because a release created
516+
# with GITHUB_TOKEN does NOT trigger `release` event workflows — GitHub's
517+
# recursion-prevention. Running it here fires exactly when a release is
518+
# cut. continue-on-error so a winget hiccup never fails the release.
519+
#
520+
# Uses Microsoft's wingetcreate CLI directly rather than a winget
521+
# submission Action — the popular winget-releaser Action pulls in an
522+
# unpinned transitive action (cargo-bins/cargo-binstall@main), which the
523+
# repo's SHA-pinning policy correctly rejects. wingetcreate is a single
524+
# signed .exe with no nested actions, so it stays inside the policy.
525+
#
526+
# `wingetcreate update` requires the package to already exist in
527+
# winget-pkgs. The FIRST submission of TheAbider.RackStack is a one-time
528+
# manual step (`wingetcreate new` locally, or a hand-authored manifest
529+
# PR — see dist/README.md). Every release after that is automated here.
530+
- name: Submit to winget-pkgs
531+
if: steps.pubtokens.outputs.winget == 'true'
532+
continue-on-error: true
533+
env:
534+
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
535+
run: |
536+
$ver = '${{ steps.vercheck.outputs.version }}'
537+
$exeUrl = "https://github.com/$env:GITHUB_REPOSITORY/releases/download/v$ver/RackStack.exe"
538+
$wc = Join-Path $env:RUNNER_TEMP 'wingetcreate.exe'
539+
Write-Host "Downloading wingetcreate..."
540+
Invoke-WebRequest -Uri 'https://aka.ms/wingetcreate/latest' -OutFile $wc -UseBasicParsing
541+
Write-Host "Submitting TheAbider.RackStack v$ver to winget-pkgs..."
542+
& $wc update TheAbider.RackStack --version $ver --urls $exeUrl --submit --token $env:WINGET_TOKEN
543+
if ($LASTEXITCODE -ne 0) {
544+
Write-Host "wingetcreate exit $LASTEXITCODE — if this is the first-ever submission,"
545+
Write-Host "the package does not exist in winget-pkgs yet; do the first one manually"
546+
Write-Host "(see dist/README.md). Subsequent releases will auto-submit."
547+
}
548+
$global:LASTEXITCODE = 0
549+
exit 0
550+
551+
# Publish to the Chocolatey Community Repository. Inlined for the same
552+
# reason as winget above. The EXE is already built in builds\ for this
553+
# run, so no download is needed.
554+
- name: Publish to Chocolatey
555+
if: steps.pubtokens.outputs.choco == 'true'
556+
continue-on-error: true
557+
env:
558+
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
559+
run: |
560+
$ver = '${{ steps.vercheck.outputs.version }}'
561+
$exe = 'builds\RackStack.exe'
562+
if (-not (Test-Path -LiteralPath $exe)) {
563+
Write-Host 'RackStack.exe not present — skipping Chocolatey publish.'
564+
exit 0
565+
}
566+
$hash = (Get-FileHash -LiteralPath $exe -Algorithm SHA256).Hash.ToLower()
567+
Push-Location dist/chocolatey
568+
# Stamp the templated nuspec + install script with this version + hash.
569+
(Get-Content 'rackstack.nuspec' -Raw) -replace '<version>0\.0\.0</version>', "<version>$ver</version>" |
570+
Set-Content 'rackstack.nuspec' -Encoding utf8
571+
(Get-Content 'tools/chocolateyinstall.ps1' -Raw) `
572+
-replace '__VERSION__', $ver `
573+
-replace '__CHECKSUM_SHA256__', $hash |
574+
Set-Content 'tools/chocolateyinstall.ps1' -Encoding utf8
575+
choco pack rackstack.nuspec
576+
$nupkg = Get-ChildItem -Filter 'rackstack.*.nupkg' | Select-Object -First 1
577+
if ($nupkg) {
578+
Write-Host "Pushing $($nupkg.Name) to Chocolatey..."
579+
choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
580+
choco push $nupkg.FullName --source https://push.chocolatey.org/
581+
if ($LASTEXITCODE -ne 0) {
582+
Write-Host "choco push exit $LASTEXITCODE — first submissions queue for moderation."
583+
}
584+
} else {
585+
Write-Host "choco pack produced no .nupkg."
586+
}
587+
$global:LASTEXITCODE = 0
588+
Pop-Location
589+
exit 0
590+
497591
- name: Apply retention rule (only latest z in minor survives)
498592
if: steps.vercheck.outputs.bumped == 'true' && steps.releasecheck.outputs.exists == 'false'
499593
env:

.github/workflows/winget.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)