name: Post Release

on:
  release:
    types: [released]

jobs:
  create-issues:
    name: Create GitHub Issues
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - run: |
          gh issue create --title "Publish Windows Release for $RELEASE_TAG" --body "Update json file in root of project."
          gh issue create --title "Publish Flatpak Release for $RELEASE_TAG" --body "Update https://github.com/flathub/com.github.dail8859.NotepadNext"

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          RELEASE_TAG: ${{ github.event.release.tag_name }}

  winget:
    name: Publish to WinGet
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v2
        with:
          identifier: dail8859.NotepadNext
          token: ${{ secrets.WINGET_TOKEN }}
