on:
  push:
    tags:
      - '*'

jobs:
  publish:
    if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')"
    runs-on: ubuntu-latest
    steps:
      - name: Check out
        uses: actions/checkout@v4

      - name: Publish to Hex.pm
        uses: erlangpack/github-action@v3
        env:
          HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
