Skip to content

Commit

Permalink
Merge pull request #328: Adding winget workflow
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
derrickstolee authored and dscho committed Jun 17, 2022
2 parents 1712ea8 + 3157ed6 commit b248c8a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release-winget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "release-winget"
on:
release:
types: [released]

jobs:
release:
runs-on: windows-latest
steps:
- name: Publish manifest with winget-create
run: |
# Get correct release asset
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
$asset = $github.release.assets | Where-Object -Property name -match '64-bit.exe$'
# Remove 'v' and 'vfs' from the version
$github.release.tag_name -match '\d.*'
$version = $Matches[0] -replace ".vfs",""
# Download and run wingetcreate
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update Microsoft.Git -u $asset.browser_download_url -v $version -o manifests -t "${{ secrets.WINGET_TOKEN }}" -s
shell: powershell

0 comments on commit b248c8a

Please sign in to comment.