Skip to content

Commit

Permalink
Update winget release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
srwi authored Sep 12, 2024
1 parent 04b6a3c commit a57246d
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/winget-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ jobs:
winget:
name: Publish release to WinGet
runs-on: windows-latest
steps:
- name: Submit installer to Windows Package Manager Community Repository
steps:
- name: Get WinGet create tool
run: iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe

- name: Get GitHub releases
run: |
$wingetToken = "${{ secrets.WINGET_PAT }}"
$releases = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases"
- name: Submit release to WinGet (stable channel)
run: |
$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 $wingetToken
- name: Submit release to WinGet (beta channel)
run: |
$gitToken = "${{ secrets.WINGET_PAT }}"
$github = Invoke-RestMethod -uri "https://api.github.com/repos/srwi/EverythingToolbar/releases"
$targetRelease = $github | Where-Object { $_.prerelease -eq $false } | Select -First 1
$installerUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match "EverythingToolbar.*msi" | Select -ExpandProperty browser_download_url
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update stnkl.EverythingToolbar -s -v $targetRelease.tag_name -u $installerUrl -t $gitToken
$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 $wingetToken

0 comments on commit a57246d

Please sign in to comment.