Skip to content

Commit 14e1b15

Browse files
Lessley Denningtondscho
authored andcommitted
Adding winget workflows
1 parent 8b6b13a commit 14e1b15

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 '64-bit.exe$'
15+
16+
# Remove 'v' and 'vfs' from the version
17+
$github.release.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)