directiva 0.2.0

A tiny, paste-friendly directive mini-language: ACTION:[<KIND>]NAME[@PATH][=NOTE]
Documentation
# Test + clippy on every push/PR; on a version tag (`vX.Y.Z`) build wheels + sdist and attach them
# to a GitHub Release. crates.io is published manually (`cargo publish`). No PyPI — install the
# Python package from a release wheel or `pip install git+https://github.com/prostomarkeloff/directiva`.
#
# No secrets needed — the GitHub Release uses the built-in GITHUB_TOKEN.
#
# abi3 (pyo3 abi3-py39) → one wheel per platform/arch works on CPython 3.9+, so no per-Python matrix.
name: CI

on:
  push:
    branches: [main]
    tags: ["v*"]
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test:
    name: test + clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - run: cargo test
      - run: cargo clippy --all-targets -- -D warnings
      # The Python bindings type-check too (extension-module → no link needed for clippy).
      - run: cargo clippy --features python -- -D warnings

  msrv:
    name: MSRV (1.85)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # Verify the declared `rust-version` actually builds — edition 2024 + pyo3 0.28 floor.
      - uses: dtolnay/rust-toolchain@1.85.0
      - run: cargo test
      # `check` (not test) for the python feature: extension-module can't link a test binary
      # without a Python interpreter, but it must still type-check on the MSRV.
      - run: cargo check --features python

  linux:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target: [x86_64, aarch64]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist
          sccache: "true"
          manylinux: auto
      - uses: actions/upload-artifact@v4
        with:
          name: wheels-linux-${{ matrix.target }}
          path: dist

  macos:
    runs-on: macos-latest
    strategy:
      matrix:
        target: [x86_64, aarch64]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist
          sccache: "true"
      - uses: actions/upload-artifact@v4
        with:
          name: wheels-macos-${{ matrix.target }}
          path: dist

  windows:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: x64
          args: --release --out dist
          sccache: "true"
      - uses: actions/upload-artifact@v4
        with:
          name: wheels-windows
          path: dist

  sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build sdist
        uses: PyO3/maturin-action@v1
        with:
          command: sdist
          args: --out dist
      - uses: actions/upload-artifact@v4
        with:
          name: wheels-sdist
          path: dist

  release:
    name: GitHub release (wheels + sdist)
    runs-on: ubuntu-latest
    if: startsWith(github.ref, 'refs/tags/')
    needs: [test, linux, macos, windows, sdist]
    permissions:
      contents: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          path: dist
          pattern: wheels-*
          merge-multiple: true
      - name: Attach wheels + sdist to the release
        uses: softprops/action-gh-release@v2
        with:
          files: dist/*