-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
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,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" } | ||
|
Comment on lines
+775
to
+777
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. Is it possible to have separate channels for RC and beta?
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 I was following the existing pattern for publishing RC under Beta, but I think it makes sense to have a separate RC PackageIdentifier. I've opened PRs for it on the WinGet repo. I'll re-test the wingetcreate flow and update the script once the PRs are merged & published. FYI @LeonarddeR Moving the latest one should unblock us right away. I'll open PRs later to move the older RC ones |
||
|
|
||
| # 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 ` | ||
|
Comment on lines
+785
to
+787
|
||
| --version $packageVersion ` | ||
| --urls $installerUrl ` | ||
| --submit | ||
| 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 | ||
|
|
||
| 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. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.