From 96a51cf9eefa0b33eb24014611e6a26dd4821a39 Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Tue, 28 Apr 2026 20:50:50 +0500 Subject: [PATCH 1/4] Automate winget package submission --- .github/workflows/testAndPublish.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/testAndPublish.yml b/.github/workflows/testAndPublish.yml index d1733e8738d..6455d480249 100644 --- a/.github/workflows/testAndPublish.yml +++ b/.github/workflows/testAndPublish.yml @@ -753,3 +753,38 @@ jobs: --repo ${{ github.repository }} \ --clobber \ $NVDA_EXE_NAME#Installer + + submit-winget: + name: Submit manifest to WinGet Packages Repository + needs: [release] + runs-on: windows-latest + if: startsWith(github.ref_name, 'release-') + permissions: + contents: read + steps: + - name: Submit package using wingetcreate + env: + GH_TOKEN: ${{ github.token }} + # wingetcreate will read the token from the below environment variable + # Reference: https://aka.ms/winget-create-token + WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_CREATE_GITHUB_TOKEN }} + run: | + # Strip the 'release-' prefix to get the package version + $packageVersion = "${{ github.ref_name }}" -replace '^release-', '' + + # beta/rc tags submit to NVAccess.NVDA.Beta; all other release tags submit to NVAccess.NVDA + $isBeta = "${{ github.ref_name }}" -match 'beta|rc' + $wingetPackageId = if ($isBeta) { "NVAccess.NVDA.Beta" } else { "NVAccess.NVDA" } + + # Retrieve the .exe installer URL from the published GitHub release + $releaseAssets = gh release view "${{ github.ref_name }}" ` + --repo "${{ github.repository }}" ` + --json assets | ConvertFrom-Json + $installerUrl = ($releaseAssets.assets | Where-Object { $_.name -like "*.exe" }).url + + # Download wingetcreate and open a PR against the winget-pkgs repository + curl.exe -JLO https://aka.ms/wingetcreate/latest + .\wingetcreate.exe update $wingetPackageId ` + --version $packageVersion ` + --urls $installerUrl ` + --submit From f97925c4093896b9b09df16991a978a30d61d4d4 Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Wed, 29 Apr 2026 11:22:53 +0500 Subject: [PATCH 2/4] Update CI README --- ci/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/README.md b/ci/README.md index a10b3ee896a..0b487b83827 100644 --- a/ci/README.md +++ b/ci/README.md @@ -35,6 +35,7 @@ Some of these steps run concurrently. * On snapshot builds, deploy to the server. * On beta branch builds, upload translation to Crowdin. * On release builds, publish the release on GitHub and deploy to the server. + * On release builds, submit a PR for the new version to the WinGet community repository. * Clean up build cache. ### Build behaviours From 5c7c9aac99172a44ed5bf2d7ff787f8a80f7a5de Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:50:01 +0500 Subject: [PATCH 3/4] document steps for WinGet CI --- ci/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci/README.md b/ci/README.md index 0b487b83827..5bcab761764 100644 --- a/ci/README.md +++ b/ci/README.md @@ -183,6 +183,16 @@ To ensure this step of tagged builds succeeds, set: * `VT_API_KEY` as a secret. +### WinGet manifest submission + +On release builds, a PR is automatically submitted to the [WinGet community repository](https://github.com/microsoft/winget-pkgs) with the new version's manifest. + +To ensure this step of release builds succeeds, set: + +* `WINGET_CREATE_GITHUB_TOKEN` as a secret with a GitHub personal access token that has permission to fork and open pull requests against `microsoft/winget-pkgs`. + +See [the winget-create documentation](https://aka.ms/winget-create-token) for the required token scopes. + ### GitHub Discussions category This is only used when building tagged builds. From 98a93795e3db015c7ff494e2754bbae698ba5bb2 Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Sat, 9 May 2026 15:19:23 +0500 Subject: [PATCH 4/4] move to separate packageID for RC --- .github/workflows/testAndPublish.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testAndPublish.yml b/.github/workflows/testAndPublish.yml index 6455d480249..54f48159245 100644 --- a/.github/workflows/testAndPublish.yml +++ b/.github/workflows/testAndPublish.yml @@ -772,9 +772,10 @@ jobs: # Strip the 'release-' prefix to get the package version $packageVersion = "${{ github.ref_name }}" -replace '^release-', '' - # beta/rc tags submit to NVAccess.NVDA.Beta; all other release tags submit to NVAccess.NVDA - $isBeta = "${{ github.ref_name }}" -match 'beta|rc' - $wingetPackageId = if ($isBeta) { "NVAccess.NVDA.Beta" } else { "NVAccess.NVDA" } + # Determine the appropriate package ID based on stable, beta, or rc release + $isBeta = "${{ github.ref_name }}" -match 'beta' + $isRc = "${{ github.ref_name }}" -match 'rc' + $wingetPackageId = if ($isBeta) { "NVAccess.NVDA.Beta" } elseif ($isRc) { "NVAccess.NVDA.RC" } else { "NVAccess.NVDA" } # Retrieve the .exe installer URL from the published GitHub release $releaseAssets = gh release view "${{ github.ref_name }}" `