-
-
Notifications
You must be signed in to change notification settings - Fork 779
Automate winget package submission #20029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
96a51cf
f97925c
5c7c9aa
98a9379
9f98181
ee40e56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 on lines
+759
to
+760
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we bind this to the default runner?
Suggested change
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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.
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 | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -182,6 +183,16 @@ To ensure this step of tagged builds succeeds, set: | |
|
|
||
| * `VT_API_KEY` as a secret. | ||
|
|
||
| ### WinGet manifest submission | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
| 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" } | ||
|
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 | ||
Uh oh!
There was an error while loading. Please reload this page.