scanii 1.3.0

Minimal-dependency Rust SDK for the Scanii content security API
Documentation
name: Release

# Triggered by Rafael publishing the GitHub Release (UI or `gh release create`).
# This workflow does NOT create the release — it only publishes the crate to
# crates.io.
#
# crates.io publishes are IRREVERSIBLE. `cargo yank` exists but the version
# number is permanently burned. PR CI is the gate for catching issues before
# this workflow ever runs.

on:
  release:
    types: [published]

jobs:
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.release.tag_name }}

      - name: Setup Rust toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable

      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
            echo "::error::CARGO_REGISTRY_TOKEN secret is not configured in repo settings"
            exit 1
          fi
          cargo publish --token "$CARGO_REGISTRY_TOKEN"