diff --git a/.github/workflows/package-submissions.yml b/.github/workflows/package-submissions.yml new file mode 100644 index 0000000000..2304f4b668 --- /dev/null +++ b/.github/workflows/package-submissions.yml @@ -0,0 +1,22 @@ +name: Submit Microsoft.PowerToys package to Windows Package Manager Community Repository +# based off of https://github.com/nushell/nushell/blob/main/.github/workflows/winget-submission.yml + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + + winget: + name: Publish winget package + runs-on: windows-latest + steps: + - name: Submit package to Windows Package Manager Community Repository + run: | + iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json + $installerUrl = $github.release.assets | Where-Object -Property name -match 'PowerToysSetup' | Select -ExpandProperty browser_download_url -First 1 + $wingetPackage = "Microsoft.PowerToys" + $gitToken = {{ secrets.pt_WinGet }} + .\wingetcreate.exe update $wingetPackage -s -v $github.release.tag_name.Trim("v") -u $installerUrl -t $gitToken