plexpy/.github/workflows/submit-winget.yml
JonnyWong16 8f06b39a07
Fix submit winget workflow
[skip ci]
2023-03-03 10:59:22 -08:00

26 lines
988 B
YAML

name: Submit winget
on:
workflow_dispatch: ~
release:
types: [published]
jobs:
winget:
name: Submit Winget Package
runs-on: windows-latest
if: ${{ !github.event.release.prerelease }}
steps:
- name: Submit package to Windows Package Manager Community Repository
run: |
$wingetPackage = "Tautulli.Tautulli"
$gitToken = "${{ secrets.WINGET_TOKEN }}"
$github = Invoke-RestMethod -uri "https://api.github.com/repos/Tautulli/Tautulli/releases/latest"
$installerUrl = $github | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match "Tautulli-windows-.*-x64.exe" | Select -ExpandProperty browser_download_url
$version = "$($github.tag_name.Trim('v')).1"
# getting latest wingetcreate file
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update $wingetPackage -s -v $version -u $installerUrl -t $gitToken