-
Notifications
You must be signed in to change notification settings - Fork 208
33 lines (25 loc) · 1.28 KB
/
Copy pathwinget-submission.yml
File metadata and controls
33 lines (25 loc) · 1.28 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
name: Submit Clink release to winget-pkgs
# based off of https://github.com/microsoft/PowerToys/blob/main/.github/workflows/package-submissions.yml
# ... based off of https://github.com/nushell/nushell/blob/main/.github/workflows/winget-submission.yml
on:
workflow_dispatch:
release:
types: [published]
jobs:
winget:
name: Publish winget package
runs-on: windows-latest
steps:
- name: Submit package to winget-pkgs
run: |
$wingetPackage = "chrisant996.Clink"
$gitToken = "${{ secrets.WINGET_PAT }}"
$targetRelease = Invoke-RestMethod -uri "https://api.github.com/repos/chrisant996/clink/releases/latest"
$installerUrl = $targetRelease | Select -ExpandProperty assets -First 1 | Where-Object -Property name -match 'clink.*.exe' | Select -ExpandProperty browser_download_url
$ver = $targetRelease.tag_name.Trim("v")
# diagnostics
Write-Host "installerUrl = $installerUrl"
Write-Host "ver = $ver"
# getting latest wingetcreate file
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update $wingetPackage -s -v $ver -u "$installerUrl|x86" "$installerUrl|x64" -t $gitToken