ci: added updated winget package submission

This commit is contained in:
Nicola
2024-10-25 10:16:19 +02:00
committed by Nick Bolton
parent 3cb1980af3
commit 1880a157b6
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,32 @@
name: Winget Publish
description: A composite action to publish packages to the Windows Package Manager (Winget) repository
inputs:
release-version:
description: "Version to publish to Winget package manager (without 'v' prefix)"
required: true
token:
description: "GitHub token with public read permissions on the source repo"
required: true
runs:
using: "composite"
steps:
- name: Submit package to Windows Package Manager Community Repository
if: ${{ runner.os == 'Windows' }}
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: |
# Download latest wingetcreate
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
$packageId = "Deskflow.Deskflow"
$installerUrl = "https://github.com/deskflow/deskflow/releases/download/v${{ inputs.release-version }}/deskflow-${{ inputs.release-version }}.0_win64.msi"
# Submit package update
.\wingetcreate.exe update "$packageId" `
--version "${{ inputs.release-version }}" `
--urls "$installerUrl" `
--submit `
--token "${{ inputs.token }}"
shell: pwsh

View File

@ -327,3 +327,20 @@ jobs:
prerelease: false
files: |
package-*/*
winget-publish:
needs: release
if: contains(github.ref, 'tags/v')
runs-on: windows-latest
steps:
- name: Fancy Checkout
uses: sithlord48/fancy-checkout@v1.0.0
- name: Get version
uses: ./.github/actions/get-version
- name: Submit
uses: ./.github/actions/winget-publish
with:
release-version: ${{env.DESKFLOW_VERSION}}
token: ${{ secrets.WINGET_DEPLOY_TOKEN }}