34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
name: WinGet Release
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Release tag (e.g. v1.4.1)'
|
|
required: true
|
|
|
|
jobs:
|
|
submit:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Install Komac
|
|
run: |
|
|
$tag = (Invoke-RestMethod "https://api.github.com/repos/russellbanks/Komac/releases/latest").tag_name
|
|
$ver = $tag.TrimStart('v')
|
|
$url = "https://github.com/russellbanks/Komac/releases/download/$tag/komac-$ver-x86_64-pc-windows-msvc.exe"
|
|
Invoke-WebRequest -Uri $url -OutFile "$env:RUNNER_TEMP\komac.exe"
|
|
Add-Content $env:GITHUB_PATH $env:RUNNER_TEMP
|
|
shell: pwsh
|
|
|
|
- name: Submit to WinGet
|
|
run: |
|
|
$releaseTag = if ("${{ github.event_name }}" -eq "workflow_dispatch") { "${{ github.event.inputs.tag }}" } else { "${{ github.event.release.tag_name }}" }
|
|
$version = $releaseTag.TrimStart('v')
|
|
$url = "https://github.com/SteveTheKiller/KillerPDF/releases/download/$releaseTag/KillerPDF.exe"
|
|
komac update SteveTheKiller.KillerPDF --version $version --urls $url --submit
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
|
shell: pwsh
|