From 7f7fa0274e2ac8b5f5412c680f6500b7305de499 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Fri, 30 Oct 2026 09:25:19 -0400 Subject: [PATCH 1/5] fix: update WinGet manifest schema --- .../winget/OpenCLICollective.newrelic-cli.installer.yaml | 4 ++-- .../winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml | 4 ++-- packaging/winget/OpenCLICollective.newrelic-cli.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/winget/OpenCLICollective.newrelic-cli.installer.yaml b/packaging/winget/OpenCLICollective.newrelic-cli.installer.yaml index ae4bab2..ffe8200 100644 --- a/packaging/winget/OpenCLICollective.newrelic-cli.installer.yaml +++ b/packaging/winget/OpenCLICollective.newrelic-cli.installer.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.28.0.schema.json PackageIdentifier: OpenCLICollective.newrelic-cli PackageVersion: 0.0.0 @@ -15,4 +15,4 @@ Installers: InstallerUrl: https://github.com/open-cli-collective/newrelic-cli/releases/download/v0.0.0/nrq_v0.0.0_windows_arm64.zip InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000000 ManifestType: installer -ManifestVersion: 1.10.0 +ManifestVersion: 1.28.0 diff --git a/packaging/winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml b/packaging/winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml index 51c3642..58f1663 100644 --- a/packaging/winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml +++ b/packaging/winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml @@ -1,4 +1,4 @@ -# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.10.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.28.0.schema.json PackageIdentifier: OpenCLICollective.newrelic-cli PackageVersion: 0.0.0 @@ -35,4 +35,4 @@ Tags: - sre ReleaseNotesUrl: https://github.com/open-cli-collective/newrelic-cli/releases ManifestType: defaultLocale -ManifestVersion: 1.10.0 +ManifestVersion: 1.28.0 diff --git a/packaging/winget/OpenCLICollective.newrelic-cli.yaml b/packaging/winget/OpenCLICollective.newrelic-cli.yaml index 2cf3345..6aa268d 100644 --- a/packaging/winget/OpenCLICollective.newrelic-cli.yaml +++ b/packaging/winget/OpenCLICollective.newrelic-cli.yaml @@ -1,7 +1,7 @@ -# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.10.0.schema.json +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.28.0.schema.json PackageIdentifier: OpenCLICollective.newrelic-cli PackageVersion: 0.0.0 DefaultLocale: en-US ManifestType: version -ManifestVersion: 1.10.0 +ManifestVersion: 1.28.0 From 416f12869fbfe049be4a44520fc2da7b4b5b6014 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Fri, 30 Oct 2026 09:27:47 -0400 Subject: [PATCH 2/5] Use current WinGet in manifest validation --- .github/workflows/test-winget.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test-winget.yml b/.github/workflows/test-winget.yml index 97b8ac4..e8bdf19 100644 --- a/.github/workflows/test-winget.yml +++ b/.github/workflows/test-winget.yml @@ -17,6 +17,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install current WinGet validator + shell: pwsh + run: | + $bundle = Join-Path $env:RUNNER_TEMP "Microsoft.DesktopAppInstaller.msixbundle" + Invoke-WebRequest "https://github.com/microsoft/winget-cli/releases/download/v1.29.380/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile $bundle + $expected = "65dea9c01ce08ee7b763366b27c0e651f97db857c11ca9b9c301826c10092f2e" + if ((Get-FileHash $bundle -Algorithm SHA256).Hash -ne $expected) { throw "WinGet bundle checksum mismatch" } + Add-AppxPackage -Path $bundle + winget --version + - name: Validate manifest schema shell: pwsh run: | From 62bf236bbdbca214e04ac76e6c72668a41e7ba87 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Fri, 30 Oct 2026 09:29:07 -0400 Subject: [PATCH 3/5] Install WinGet runtime dependencies --- .github/workflows/test-winget.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-winget.yml b/.github/workflows/test-winget.yml index e8bdf19..4ab5005 100644 --- a/.github/workflows/test-winget.yml +++ b/.github/workflows/test-winget.yml @@ -24,7 +24,14 @@ jobs: Invoke-WebRequest "https://github.com/microsoft/winget-cli/releases/download/v1.29.380/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile $bundle $expected = "65dea9c01ce08ee7b763366b27c0e651f97db857c11ca9b9c301826c10092f2e" if ((Get-FileHash $bundle -Algorithm SHA256).Hash -ne $expected) { throw "WinGet bundle checksum mismatch" } - Add-AppxPackage -Path $bundle + $deps = Join-Path $env:RUNNER_TEMP "winget-dependencies.zip" + Invoke-WebRequest "https://github.com/microsoft/winget-cli/releases/download/v1.29.380/DesktopAppInstaller_Dependencies.zip" -OutFile $deps + $depsHash = "ba875afe9d190f61218985ac0292a99d1db710bf93e13c68944ca9d89f0d82d1" + if ((Get-FileHash $deps -Algorithm SHA256).Hash -ne $depsHash) { throw "WinGet dependencies checksum mismatch" } + $depsDir = Join-Path $env:RUNNER_TEMP "winget-dependencies" + Expand-Archive -Path $deps -DestinationPath $depsDir + $dependencyPaths = @(Get-ChildItem (Join-Path $depsDir "x64") -Filter "*.appx" | ForEach-Object FullName) + Add-AppxPackage -Path $bundle -DependencyPath $dependencyPaths winget --version - name: Validate manifest schema From 22d303def16d3308438638a4684f8733eff3ef40 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Fri, 30 Oct 2026 09:32:04 -0400 Subject: [PATCH 4/5] fix: use updated WinGet submission workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6768051..fa5f4ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ permissions: jobs: release: - uses: open-cli-collective/.github/.github/workflows/release.yml@v1 + uses: open-cli-collective/.github/.github/workflows/release.yml@6ee65fbc893f13b8876f013ec0661219a3e18269 with: # tag push is live (false); workflow_dispatch honors the checkbox. Compare # against both true and 'true' because a workflow_dispatch boolean input From 910a33aecac4bcec196168aaa501c1be625a66c7 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Fri, 30 Oct 2026 09:32:21 -0400 Subject: [PATCH 5/5] Use shared WinGet submission for manual publishing --- .github/workflows/winget-publish.yml | 113 ++++----------------------- 1 file changed, 14 insertions(+), 99 deletions(-) diff --git a/.github/workflows/winget-publish.yml b/.github/workflows/winget-publish.yml index bf00391..f5606c9 100644 --- a/.github/workflows/winget-publish.yml +++ b/.github/workflows/winget-publish.yml @@ -8,107 +8,22 @@ on: required: true type: string +permissions: + contents: read + jobs: publish: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - - name: Validate release exists - shell: pwsh - env: - GH_TOKEN: ${{ github.token }} - run: | - $release = gh release view "v${{ inputs.version }}" --json tagName 2>&1 - if ($LASTEXITCODE -ne 0) { - Write-Error "Release v${{ inputs.version }} not found" - exit 1 - } - Write-Host "Found release v${{ inputs.version }}" - - - name: Install wingetcreate - shell: pwsh - run: | - Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - - - name: Check if manifest exists in winget-pkgs - id: check-manifest - shell: pwsh - run: | - $response = Invoke-WebRequest -Uri "https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/o/OpenCLICollective/newrelic-cli" -Method Head -SkipHttpErrorCheck - if ($response.StatusCode -eq 200) { - Write-Host "Manifest exists - will use wingetcreate update" - echo "exists=true" >> $env:GITHUB_OUTPUT - } else { - Write-Host "Manifest does not exist - will use wingetcreate new" - echo "exists=false" >> $env:GITHUB_OUTPUT - } - - - name: Get checksums from release - shell: pwsh - env: - GH_TOKEN: ${{ github.token }} - run: | - gh release download "v${{ inputs.version }}" --pattern "checksums.txt" --dir . - - $checksums = Get-Content checksums.txt - $x64Hash = ($checksums | Select-String "windows_amd64.zip").Line.Split()[0] - $arm64Hash = ($checksums | Select-String "windows_arm64.zip").Line.Split()[0] - - Write-Host "x64 SHA256: $x64Hash" - Write-Host "arm64 SHA256: $arm64Hash" - - echo "X64_HASH=$x64Hash" >> $env:GITHUB_ENV - echo "ARM64_HASH=$arm64Hash" >> $env:GITHUB_ENV - - - name: Update manifest (existing package) - if: steps.check-manifest.outputs.exists == 'true' - shell: pwsh - run: | - $version = "${{ inputs.version }}" - $x64 = "https://github.com/open-cli-collective/newrelic-cli/releases/download/v${version}/nrq_v${version}_windows_amd64.zip" - $arm64 = "https://github.com/open-cli-collective/newrelic-cli/releases/download/v${version}/nrq_v${version}_windows_arm64.zip" - - Write-Host "Updating existing manifest to version $version" - ./wingetcreate.exe update OpenCLICollective.newrelic-cli --version $version --urls $x64 $arm64 --submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} - - - name: Create manifest (new package) - if: steps.check-manifest.outputs.exists == 'false' - shell: pwsh - run: | - $version = "${{ inputs.version }}" - $manifestDir = "manifests" - New-Item -ItemType Directory -Path $manifestDir -Force | Out-Null - - # Update version manifest - $versionManifest = Get-Content "packaging/winget/OpenCLICollective.newrelic-cli.yaml" -Raw - $versionManifest = $versionManifest -replace "0\.0\.0", $version - Set-Content "$manifestDir/OpenCLICollective.newrelic-cli.yaml" $versionManifest - - # Update locale manifest - $localeManifest = Get-Content "packaging/winget/OpenCLICollective.newrelic-cli.locale.en-US.yaml" -Raw - $localeManifest = $localeManifest -replace "0\.0\.0", $version - Set-Content "$manifestDir/OpenCLICollective.newrelic-cli.locale.en-US.yaml" $localeManifest - - # Update installer manifest with version and real checksums - $installerManifest = Get-Content "packaging/winget/OpenCLICollective.newrelic-cli.installer.yaml" -Raw - $installerManifest = $installerManifest -replace "0\.0\.0", $version - # Use .NET regex for sequential replacement (PowerShell -replace doesn't support count) - $regex = [regex]"0{64}" - $installerManifest = $regex.Replace($installerManifest, $env:X64_HASH, 1) - $installerManifest = $regex.Replace($installerManifest, $env:ARM64_HASH, 1) - Set-Content "$manifestDir/OpenCLICollective.newrelic-cli.installer.yaml" $installerManifest - - Write-Host "Generated manifests:" - Get-ChildItem $manifestDir | ForEach-Object { Write-Host " $_" } - - Write-Host "`nValidating manifests..." - winget validate --manifest $manifestDir - if ($LASTEXITCODE -ne 0) { - Write-Error "Manifest validation failed" - exit 1 - } - Write-Host "Validation passed!" - - Write-Host "`nSubmitting new package to Winget..." - ./wingetcreate.exe submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} $manifestDir + - name: Submit WinGet package + uses: open-cli-collective/.github/actions/winget-submit@6ee65fbc893f13b8876f013ec0661219a3e18269 + with: + package-id: OpenCLICollective.newrelic-cli + version: ${{ inputs.version }} + final-tag: v${{ inputs.version }} + repo: ${{ github.repository }} + working-directory: . + bootstrap: "true" + github-token: ${{ github.token }} + winget-token: ${{ secrets.WINGET_GITHUB_TOKEN }}