Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: switch to vedantmgoyal2009/winget-releaser #103

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions .github/workflows/winget-submission.yml
Original file line number Diff line number Diff line change
@@ -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@52ef3f3028ed79a9606d7678d0a88d295bc0c690 # v2
with:
identifier: Vencord.Vesktop
token: ${{ secrets.WINGET_PAT }}
installers-regex: '\.exe$'