Workflow file for this run
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: Submit WinWhisper package to Windows Package Manager Community Repository | |
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: | | |
$packageId = "Jaap.WinWhisper" | |
$gitToken = "${{ secrets.WINGET_PAT }}" | |
# Fetching latest release from GitHub | |
$github = Invoke-RestMethod -uri "https://api.github.com/repos/GewoonJaap/WinWhisper/releases/latest" | |
$targetRelease = $github | Where-Object -Property name -match 'WinWhisper'| Select-Object -First 1 | |
$installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'WinWhisperSetup.exe' | Select-Object -ExpandProperty browser_download_url | |
$packageVersion = $targetRelease.tag_name.Trim("v") | |
# Update package using wingetcreate | |
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe | |
.\wingetcreate.exe update $packageId --version $packageVersion --urls "$installerUrl" --submit --token $gitToken |