Skip to content

Commit 4d20aa7

Browse files
Merge pull request cli#3801 from Vishesh-Gupta/automate-winget-release
Automate packaging for Winget
1 parent dd3aac7 commit 4d20aa7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/releases.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,18 @@ jobs:
197197
GIT_AUTHOR_NAME: cli automation
198198
GIT_COMMITTER_EMAIL: noreply@github.com
199199
GIT_AUTHOR_EMAIL: noreply@github.com
200+
- name: Bump Winget manifest
201+
shell: pwsh
202+
env:
203+
WINGETCREATE_VERSION: v0.2.0.29-preview
204+
GITHUB_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
205+
run: |
206+
$tagname = $env:GITHUB_REF.Replace("refs/tags/", "")
207+
$version = $tagname.Replace("v", "")
208+
$url = "https://github.com/cli/cli/releases/download/${tagname}/gh_${version}_windows_amd64.msi"
209+
iwr https://github.com/microsoft/winget-create/releases/download/${env:WINGETCREATE_VERSION}/wingetcreate.exe -OutFile wingetcreate.exe
210+
211+
.\wingetcreate.exe update GitHub.cli --url $url --version $version
212+
if ($version -notmatch "-") {
213+
.\wingetcreate.exe submit .\manifests\g\GitHub\cli\${version}\ --token $env:GITHUB_TOKEN
214+
}

0 commit comments

Comments
 (0)