From 5f4a97c490f2432b368b48b6f508e1d0d3fe713f Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Mon, 28 Aug 2023 13:28:37 +0100 Subject: [PATCH] ci: switch to vedantmgoyal2009/winget-releaser Works on Linux which should in theory be faster than a Windows runner, + it uses Komac which ironically has much better support for Winget manifest generation than Microsoft's own tooling. --- .github/workflows/winget-submission.yml | 28 ++++++------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml index 160635f..2093b6d 100644 --- a/.github/workflows/winget-submission.yml +++ b/.github/workflows/winget-submission.yml @@ -1,33 +1,17 @@ -# Based on Microsoft/DevHome Winget CI, modified for use in Vencord/Vesktop. -# -# Copyright (c) Microsoft Corporation and Contributors -# Licensed under the MIT license. - name: Submit to Winget Community Repo on: - workflow_dispatch: release: types: [published] jobs: winget: name: Publish winget package - runs-on: windows-latest - env: - WINGET_PAT: ${{ secrets.WINGET_PAT }} + runs-on: ubuntu-latest steps: - name: Submit package to Winget Community Repo - run: | - - $packageId = "Vencord.Vesktop" - - # Fetching latest release from GitHub - $github = Invoke-RestMethod -uri "https://api.github.com/repos/vencord/vesktop/releases" - $targetRelease = $github | Select-Object -First 1 - $installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'Vesktop-Setup.*?exe' | Select-Object -ExpandProperty browser_download_url - $packageVersion = $targetRelease.tag_name.Trim("v") - - # Update package using wingetcreate - Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - .\wingetcreate.exe update $packageId --version $packageVersion --urls "$installerUrl" --submit --token $env:WINGET_PAT + uses: vedantmgoyal2009/winget-releaser@v2 + with: + identifier: Vencord.Vesktop + token: ${{ secrets.WINGET_PAT }} + installers-regex: '\.exe$'