-
Notifications
You must be signed in to change notification settings - Fork 67
28 lines (23 loc) · 1.24 KB
/
winget-submission.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Submit DLSS Swapper 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
if: '!github.event.release.prerelease'
run: |
$packageId = "beeradmoore.dlss-swapper"
$gitToken = "${{ secrets.WINGET_PAT }}"
# Fetching latest release from GitHub
$github = Invoke-RestMethod -uri "https://api.github.com/repos/beeradmoore/dlss-swapper/releases"
$targetRelease = $github | Where-Object -Property draft -match 'False' | Select-Object -First 1
$installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'DLSS.Swapper-(.*?)-installer.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|x64" --submit --token $gitToken