name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest # action can only be run on windows
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v2
        with:
          identifier: Balena.Etcher
          # matches something like "balenaEtcher-1.19.0.Setup.exe"
          installers-regex: 'balenaEtcher-[\d.-]+\.Setup.exe$'
          token: ${{ secrets.WINGET_PAT }}
