-
Notifications
You must be signed in to change notification settings - Fork 33
27 lines (22 loc) · 1013 Bytes
/
winget.yaml
File metadata and controls
27 lines (22 loc) · 1013 Bytes
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
name: Publish to WinGet
on:
release:
types: [published]
env:
VERSION_REGEX: '^v(\d+)$'
# winget-create will read the following environment variable to access the GitHub token needed for submitting a PR
# See https://aka.ms/winget-create-token
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}
jobs:
publish:
runs-on: windows-latest # Action can only run on Windows
steps:
- name: Publish To WinGet
run: |
$release = '${{ toJSON(github.event.release) }}' | ConvertFrom-Json
$wingetRelevantAsset = $release | Select-Object -Property assets | Where-Object { $_.name -like '*.msi' } | Select-Object -First 1
$regex = [Regex]::New($env:VERSION_REGEX)
$version = $regex.Match($release.tag_name).Groups[1].Value
$wingetPackage = "Exidex.Gauntlet"
& curl.exe -JLO https://aka.ms/wingetcreate/latest
& .\wingetcreate.exe update $wingetPackage -s -v $version -u $wingetRelevantAsset.browser_download_url