Add submit-winget.yml workflow

This commit is contained in:
JonnyWong16 2022-09-10 09:17:01 -07:00
parent 0a6b12329c
commit 54af528f6c
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

24
.github/workflows/submit-winget.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Submit Tautulli 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: |
$wingetPackage = "Tautulli.Tautulli"
$gitToken = "${{ secrets.GITHUB_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