Skip to content

Commit 664de4f

Browse files
Submit WinGet manifest on release (#5203)
Add a GitHub Actions workflow that will submit the manifest for a new release of k6 to the WinGet package manager.
1 parent 02602d7 commit 664de4f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,43 @@ jobs:
498498
done
499499
gh release create "$VERSION" "${assets[@]}" --target "$GITHUB_SHA" -F "./release notes/${VERSION}.md"
500500
501+
submit-winget-manifest:
502+
needs: [configure, publish-github]
503+
runs-on: windows-2025
504+
permissions:
505+
contents: read
506+
id-token: write
507+
steps:
508+
509+
- name: Install WingetCreate
510+
shell: pwsh
511+
run: |
512+
Import-Module Appx -UseWindowsPowerShell
513+
$appxBundleFile = Join-Path ${env:RUNNER_TEMP} "wingetcreate.msixbundle"
514+
Invoke-WebRequest https://aka.ms/wingetcreate/latest/msixbundle -OutFile $appxBundleFile
515+
Add-AppxPackage $appxBundleFile
516+
517+
- name: Get WinGet token
518+
uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
519+
id: get-token
520+
with:
521+
export_env: false
522+
common_secrets: |
523+
token=winget-packages:token
524+
525+
- name: Submit WinGet Manifest
526+
env:
527+
PACKAGE_ID: GrafanaLabs.k6
528+
PACKAGE_VERSION: ${{ needs.configure.outputs.k6_version }}
529+
WINGET_CREATE_GITHUB_TOKEN: ${{ fromJSON(steps.get-token.outputs.secrets).token }}
530+
shell: pwsh
531+
run: |
532+
wingetcreate token --store
533+
wingetcreate update ${env:PACKAGE_ID} `
534+
--urls "${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}/releases/download/${env:PACKAGE_VERSION}/k6-${env:PACKAGE_VERSION}-windows-amd64.msi" `
535+
--version ${env:PACKAGE_VERSION}.TrimStart("v") `
536+
--submit
537+
501538
publish-packages:
502539
runs-on: ubuntu-latest
503540
needs: [configure, sign-binaries, sign-packages]

0 commit comments

Comments
 (0)