name: Publish to WinGet
on:
  workflow_dispatch:
    inputs:
      version:
        description: Version
        required: false

jobs:
  publish:
    runs-on: windows-latest # action can only be run on windows
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v2
        with:
          identifier: Suwayomi.Suwayomi-Server
          installers-regex: '.*x64.msi$'
          token: ${{ secrets.WINGET_PUBLISH_PAT }}
          version: ${{ inputs.version || github.ref_name }}
          release-tag: ${{ inputs.version || github.ref_name  }}
