PowerToys/.github/workflows/package-submissions.yml
2022-05-02 09:55:11 -07:00

25 lines
1.0 KiB
YAML

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
Write-Output $github.release.assets
$installerUrl = $github.release.assets | Where-Object -Property name -match 'PowerToysSetup' | Select -ExpandProperty browser_download_url -First 1
$wingetPackage = "Microsoft.PowerToys"
$gitToken = {{ secrets.pt_WinGet }}
$ver = $github.release.tag_name.Trim("v")
.\wingetcreate.exe update $wingetPackage -s -v $ver -u $installerUrl -t $gitToken