Skip to content

Commit

Permalink
Merge pull request #202 from beeradmoore/feature/auto-winget-pubish
Browse files Browse the repository at this point in the history
Added workflow to publish to winget
  • Loading branch information
beeradmoore authored Feb 11, 2024
2 parents 3358077 + ab23b7a commit c673b7c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/winget-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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
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

0 comments on commit c673b7c

Please sign in to comment.