From 3157ed678b200b58625b73e0b6525b35ea5af1b5 Mon Sep 17 00:00:00 2001 From: Lessley Dennington Date: Thu, 29 Apr 2021 10:28:44 -0700 Subject: [PATCH] Adding winget workflows --- .github/workflows/release-winget.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/release-winget.yml diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml new file mode 100644 index 00000000000000..c1f0c5ab282618 --- /dev/null +++ b/.github/workflows/release-winget.yml @@ -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