Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add workflow steps to fetch latest release info and update WinGet package #976

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/release_to_winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,23 @@ jobs:
with:
identifier: topgrade-rs.topgrade
max-versions-to-keep: 5 # keep only latest 5 versions
token: ${{ secrets.WINGET_TOKEN }}
token: ${{ secrets.WINGET_TOKEN }}
- name: Get latest release information
id: get_release_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$ReleaseInfo = Invoke-RestMethod `
-Uri 'https://api.github.com/repos/topgrade-rs/topgrade/releases/latest' `
-Headers @{ Authorization = "token $env:GITHUB_TOKEN" }
Write-Output "Release Info: $ReleaseInfo"
echo "::set-output name=version::$(echo $ReleaseInfo.tag_name -replace '^v')"
echo "::set-output name=urls::$(echo $ReleaseInfo.assets.Where({ $_.name -match '.(exe|msi|msix|appx)(bundle){0,1}$' }).browser_download_url -join ' ')"
- name: Update WinGet package
env:
KOMAC_FORK_OWNER: topgrade-rs
KOMAC_CREATED_WITH: WinGet Releaser
KOMAC_CREATED_WITH_URL: https://github.com/vedantmgoyal2009/winget-releaser
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
komac update 'topgrade-rs.topgrade' --version '${{ steps.get_release_info.outputs.version }}' --submit --urls '${{ steps.get_release_info.outputs.urls }}'