name: Publish to crates.io

on:
  push:
    tags:
      - "v*"

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Login to crates.io
        run: cargo login ${{ secrets.CARGO_API_TOKEN }}

      - name: Publish
        run: cargo publish --no-verify
