From 1880a157b617a0490f3991101517b900d764ca08 Mon Sep 17 00:00:00 2001 From: Nicola <61830443+nicola02nb@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:16:19 +0200 Subject: [PATCH] ci: added updated winget package submission --- .github/actions/winget-publish/action.yaml | 32 ++++++++++++++++++++++ .github/workflows/ci.yml | 17 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/actions/winget-publish/action.yaml diff --git a/.github/actions/winget-publish/action.yaml b/.github/actions/winget-publish/action.yaml new file mode 100644 index 000000000..f125c8bca --- /dev/null +++ b/.github/actions/winget-publish/action.yaml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 175407c90..d4787a5f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}