From fa808575933fcccda5bc3f4280f53c9bc263b758 Mon Sep 17 00:00:00 2001 From: sitiom Date: Thu, 13 Apr 2023 05:05:48 +0800 Subject: [PATCH] Add Winget Releaser workflow (#2036) * Add Winget Releaser workflow * Add dependabot * Use commit hashes for versioning * Update hash --- .github/dependabot.yml | 6 ++++++ .github/workflows/winget.yml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/winget.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9f30839 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml new file mode 100644 index 0000000..70b2b6b --- /dev/null +++ b/.github/workflows/winget.yml @@ -0,0 +1,20 @@ +name: Publish to WinGet + +on: + release: + types: [released] + +jobs: + publish: + runs-on: windows-latest # Action can only be run on windows + steps: + - name: Extract version from tag + id: extract_version + run: | + $version = [regex]::Match("${{ github.event.release.tag_name }}", "(?<=v)[\d.]+").Value + Write-Output "version=$version" >> $env:GITHUB_OUTPUT + - uses: vedantmgoyal2009/winget-releaser@c9092bc79d77d72dd54e036af65bcc8814a7e599 + with: + identifier: Microsoft.OpenSSH.Beta + version: ${{ steps.extract_version.outputs.version }} + token: ${{ secrets.WINGET_TOKEN }}