Publish WinGet releases #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish WinGet releases | |
on: | |
workflow_dispatch: | |
release: | |
types: [released] | |
jobs: | |
winget: | |
name: Publish release to WinGet | |
runs-on: windows-latest | |
env: | |
WINGET_TOKEN: ${{ secrets.WINGET_PAT }} | |
steps: | |
- name: Get WinGet create tool | |
run: iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe | |
- name: Submit release to WinGet (stable channel) | |
run: | | |
$releases = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases" | |
$stableRelease = $releases | Where-Object { $_.prerelease -eq $false } | Select -First 1 | |
$installerUrl = $stableRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match "EverythingToolbar.*msi" | Select -ExpandProperty browser_download_url | |
.\wingetcreate.exe update stnkl.EverythingToolbar -s -v $stableRelease.tag_name -u $installerUrl -t $env:WINGET_TOKEN | |
- name: Submit release to WinGet (beta channel) | |
run: | | |
$releases = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases" | |
$latestRelease = $releases | Select -First 1 | |
$installerUrl = $latestRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match "EverythingToolbar.*msi" | Select -ExpandProperty browser_download_url | |
.\wingetcreate.exe update stnkl.EverythingToolbar.Beta -s -v $latestRelease.tag_name -u $installerUrl -t $env:WINGET_TOKEN |