Skip to content

Commit 767b2f5

Browse files
committed
Refactor winget workflow to use winget-releaser action
- Switch from manual wingetcreate to vedantmgoyal9/winget-releaser action - Add GitHub App token generation for authentication - Add pull_request trigger for testing - Rename version input to release_tag with clearer description - Add explicit read permissions for contents Assisted-By: cagent
1 parent d31ba97 commit 767b2f5

1 file changed

Lines changed: 18 additions & 20 deletions

File tree

‎.github/workflows/winget.yml‎

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
name: winget
2-
32
on:
43
release:
54
types: [published]
65
workflow_dispatch:
76
inputs:
8-
version:
9-
description: 'Version'
7+
release_tag:
8+
description: 'Release tag to publish (e.g., v1.20.5)'
109
required: true
11-
12-
env:
13-
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}
14-
10+
type: string
11+
permissions:
12+
contents: read
1513
jobs:
1614
publish:
1715
runs-on: windows-latest
1816
steps:
19-
- name: publish
20-
env:
21-
RELEASE: ${{ toJSON(github.event.release) }}
22-
VERSION: ${{ github.event.inputs.version }}
23-
run: |
24-
$Version = $ENV:VERSION
25-
$PackageId = "Docker.Cagent"
26-
$Urls = @(
27-
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-amd64.exe|amd64",
28-
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-arm64.exe|arm64"
29-
)
30-
& curl.exe -JLO https://aka.ms/wingetcreate/latest
31-
& .\wingetcreate.exe update $PackageId -s -v $Version -u $Urls
17+
- name: Generate GitHub App token
18+
id: app-token
19+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
20+
with:
21+
app_id: ${{ secrets.CAGENT_REVIEWER_APP_ID }}
22+
private_key: ${{ secrets.CAGENT_REVIEWER_APP_PRIVATE_KEY }}
23+
24+
- name: Publish to WinGet
25+
uses: vedantmgoyal9/winget-releaser@19e706d4c9121098010096f9c495a70a7518b30f # v2
26+
with:
27+
identifier: "Docker.Cagent"
28+
version: "${{ github.event.release.tag_name || inputs.release_tag }}"
29+
token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)