From 4d20aa78733aa1e6f8c8d35dd27e9b4979ae4e6f Mon Sep 17 00:00:00 2001 From: Vishesh Gupta Date: Fri, 18 Jun 2021 09:56:58 -0400 Subject: [PATCH] Merge pull request #3801 from Vishesh-Gupta/automate-winget-release Automate packaging for Winget --- .github/workflows/releases.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index c5d8011d7..eddc87292 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -197,3 +197,18 @@ jobs: GIT_AUTHOR_NAME: cli automation GIT_COMMITTER_EMAIL: noreply@github.com GIT_AUTHOR_EMAIL: noreply@github.com + - name: Bump Winget manifest + shell: pwsh + env: + WINGETCREATE_VERSION: v0.2.0.29-preview + GITHUB_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }} + run: | + $tagname = $env:GITHUB_REF.Replace("refs/tags/", "") + $version = $tagname.Replace("v", "") + $url = "https://github.com/cli/cli/releases/download/${tagname}/gh_${version}_windows_amd64.msi" + iwr https://github.com/microsoft/winget-create/releases/download/${env:WINGETCREATE_VERSION}/wingetcreate.exe -OutFile wingetcreate.exe + + .\wingetcreate.exe update GitHub.cli --url $url --version $version + if ($version -notmatch "-") { + .\wingetcreate.exe submit .\manifests\g\GitHub\cli\${version}\ --token $env:GITHUB_TOKEN + }