Skip to content

Commit a496f0c

Browse files
derrickstoleeldennington
authored andcommitted
Merge pull request microsoft#328: Adding winget workflow
Adding a shiny new workflow to publish releases to winget! 🥳 I validated this workflow locally by successfully opening a [PR](https://github.com/ldennington/winget-playground/pull/4) against my winget-playground repo and running `winget validate` to ensure the generated manifest adheres to winget's required schema. Any feedback on the fields I've included (\*cough\* `ShortDescription:` \*cough\*) or suggestions for additional fields/values are welcome!
2 parents 9bcb421 + eccfba2 commit a496f0c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "release-winget"
2+
on:
3+
release:
4+
types: [released]
5+
6+
jobs:
7+
release:
8+
runs-on: windows-latest
9+
steps:
10+
- name: Publish manifest with winget-create
11+
run: |
12+
# Get correct release asset
13+
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
14+
$asset = $github.release.assets | Where-Object -Property name -match '.exe$'
15+
16+
# Remove 'v' and 'vfs' from the version
17+
$assets.tag_name -match '\d.*'
18+
$version = $Matches[0] -replace ".vfs",""
19+
20+
# Download and run wingetcreate
21+
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
22+
.\wingetcreate.exe update Microsoft.Git -u $asset.browser_download_url -v $version -o manifests -t "${{ secrets.WINGET_TOKEN }}" -s
23+
shell: powershell

0 commit comments

Comments
 (0)