name: Build and Release EPUB

on:
  push:
    tags:
      - 'v*'

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v4

      - name: Build EPUB
        run: uv run scripts/build_epub.py

      - name: Create Release
        uses: softprops/action-gh-release@v2
        with:
          files: claude-howto-guide.epub
          generate_release_notes: true
