on:
  push:
    tags:
      - 'v*'

name: release

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: create release
        id: create_release
        uses: actions/create-release@v1
        env:
          # NOTE(ww): GitHub actions cannot trigger other GitHub actions by default,
          # but we need that behavior to trigger the 'publish' workflow.
          # The workaround is to use a PAT instead of the default GITHUB_TOKEN.
          GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          draft: false
          prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }}
