Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/testAndPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -753,3 +753,24 @@ jobs:
--repo ${{ github.repository }} \
--clobber \
$NVDA_EXE_NAME#Installer

submit-winget:
name: Submit manifest to WinGet Packages Repository
needs: [release]
runs-on: windows-latest
Comment thread
seanbudd marked this conversation as resolved.
Comment on lines +759 to +760
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bind this to the default runner?

Suggested change
needs: [release]
runs-on: windows-latest
needs: [matrix, release]
runs-on: ${{ needs.matrix.outputs.defaultRunner }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeonarddeR I think this was discussed in the review comment above #20029 (comment) which @seanbudd marked as resolved. No issues from my side if we still want to make this change.

winget is not pre-installed on windows-2022 runner. The only reason I chose windows-latest is that if ever there's a case where you'd want to downgrade the default runner from windows-2025 to windows-2022, the winget submission script should still pass. Also, on windows-latest, my assumption is that it would eventually start using the latest available version of WinGet instead of winget v1.11 which is currently pre-installed on windows-2025 runners

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason I chose windows-latest is that if ever there's a case where you'd want to downgrade the default runner from windows-2025 to windows-2022, the winget submission script should still pass.

I don't think there will ever be a case where we want to downgrade to 2022, especially now the windows-2025 label is going to be migrated to visual studio 2026.

Also, on windows-latest, my assumption is that it would eventually start using the latest available version of WinGet instead of winget v1.11 which is currently pre-installed on windows-2025 runners

Windows-latest is just an alias of windows-2025, and windows-2025 will shift to windows-2025-vs2026 in june. I guess windows-latest will move too.

Also note that windows-latest is never used in the set of workflows in the repo currently, and that might be for a good reason.

If installing winget create on windows 2022 would be a concern and we want to support winget creation regardless of runner version, we should yet use the aka.ms links and should avoid using winget for installation altogether I think.

I leave the final vote up to @seanbudd.

if: startsWith(github.ref_name, 'release-')
permissions:
contents: read
steps:
- name: Checkout NVDA
uses: actions/checkout@v6
with:
submodules: false

- 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: ci/scripts/submitWinGet.ps1
11 changes: 11 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also document the setup required for this to happen further down. We try to document all steps needed to get the CI working.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanbudd done, please check. I'm happy to follow up if I missed anything

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks looks good to me. I'll leave this unresolved until I set up the required tokens and confirm the steps are accurate

* Clean up build cache.

### Build behaviours
Expand Down Expand Up @@ -182,6 +183,16 @@ To ensure this step of tagged builds succeeds, set:

* `VT_API_KEY` as a secret.

### WinGet manifest submission
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Qchristensen - do we want to document that NVDA can be installed via winget to the quick start guide? or advanced topics? or just on the website?


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.
Expand Down
23 changes: 23 additions & 0 deletions ci/scripts/submitWinGet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest

# Strip the 'release-' prefix to get the package version
$packageVersion = $env:GITHUB_REF_NAME -replace '^release-', ''

# Determine stable/beta/rc package ID
$isBeta = $env:GITHUB_REF_NAME -match 'beta'
$isRc = $env:GITHUB_REF_NAME -match 'rc'
$wingetPackageId = if ($isBeta) { "NVAccess.NVDA.Beta" } elseif ($isRc) { "NVAccess.NVDA.RC" } else { "NVAccess.NVDA" }
Comment thread
seanbudd marked this conversation as resolved.

# Get .exe asset URL from GitHub release
$releaseAssets = gh release view $env:GITHUB_REF_NAME `
--repo $env:GITHUB_REPOSITORY `
--json assets | ConvertFrom-Json
$installerUrl = ($releaseAssets.assets | Where-Object { $_.name -like "*.exe" }).url

# Install wingetcreate and submit PR
winget install --id Microsoft.WingetCreate --installer-type msix --source winget
wingetcreate update $wingetPackageId `
--version $packageVersion `
--urls $installerUrl `
--submit