ci: winget
Based off of Dev Home's Winget CI
This commit is contained in:
parent
9bb02f8581
commit
c7134c2f68
1 changed files with 27 additions and 0 deletions
27
.github/workflows/winget-submission.yml
vendored
Normal file
27
.github/workflows/winget-submission.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
name: Submit to Winget Community Repo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
winget:
|
||||
name: Publish winget package
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Submit package to Winget Community Repo
|
||||
run: |
|
||||
|
||||
$packageId = "Vencord.Vesktop"
|
||||
$gitToken = "${{ secrets.WINGET_PAT }}"
|
||||
|
||||
# Fetching latest release from GitHub
|
||||
$github = Invoke-RestMethod -uri "https://api.github.com/repos/vencord/vesktop/releases"
|
||||
$targetRelease = $github | Select-Object -First 1
|
||||
$installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'Vesktop-Setup.*?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
|
Reference in a new issue