Skip to content

Commit

Permalink
Add a Winget Releaser workflow (#14965)
Browse files Browse the repository at this point in the history
[The winget-releaser action] automatically generates manifests for the
[Winget Community Repository] and submits them.

I suggest adding Dependabot to keep the action up to date. There were
many cases where the action was failing due to an outdated version.

Closes #14795

[The winget-releaser action]:
https://github.com/vedantmgoyal2009/winget-releaser
[Winget Community Repository]: https://github.com/microsoft/winget-pkgs
  • Loading branch information
sitiom committed Mar 17, 2023
1 parent b6bb3e0 commit bee22f3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/winget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish to Winget

on:
release:
types: [published]

env:
REGEX: 'Microsoft\.WindowsTerminal(?:Preview)?_Win10_([\d.]+)_8wekyb3d8bbwe\.msixbundle$'

jobs:
publish:
runs-on: windows-latest # Action can only run on Windows
steps:
- name: Extract version from release asset
id: extract-version
run: |
$version = '${{ toJSON(github.event.release.assets.*.name) }}' | ConvertFrom-Json | Select-String -Pattern $env:REGEX | ForEach-Object { $_.Matches.Groups[1].Value }
Write-Output "version=$version" >> $env:GITHUB_OUTPUT
- name: Publish ${{ github.event.release.prerelease && 'Preview' || 'Stable' }}
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Microsoft.WindowsTerminal${{ github.event.release.prerelease && '.Preview' || '' }}
version: ${{ steps.extract-version.outputs.version }}
installers-regex: ${{ env.REGEX }}
token: ${{ secrets.WINGET_TOKEN }}
fork-user: DHowett

0 comments on commit bee22f3

Please sign in to comment.