-
Notifications
You must be signed in to change notification settings - Fork 340
45 lines (40 loc) · 1.35 KB
/
winget.yml
File metadata and controls
45 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: winget
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish (e.g., v1.20.5)"
required: true
type: string
dry_run:
description: "Dry run (do not submit PR)"
required: false
type: boolean
default: false
permissions: {}
jobs:
publish:
runs-on: windows-latest
steps:
- name: publish
env:
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_GH_TOKEN }}
VERSION: ${{ inputs.release_tag || github.event.release.tag_name }}
DRY_RUN: ${{ inputs.dry_run || false }}
run: |
winget install wingetcreate --accept-source-agreements --accept-package-agreements
$Version = $ENV:VERSION
$DryRun = $ENV:DRY_RUN -eq 'true'
$PackageId = "Docker.Agent"
$Urls = @(
"https://github.com/docker/docker-agent/releases/download/$Version/docker-agent-windows-amd64.exe|amd64",
"https://github.com/docker/docker-agent/releases/download/$Version/docker-agent-windows-arm64.exe|arm64"
)
# Build command with conditional -s flag
$params = @('update', $PackageId, '-v', $Version, '-u', $Urls)
if (-not $DryRun) {
$params += '-s'
}
& wingetcreate.exe @params