schemreg 0.3.0

Async Confluent + AWS Glue schema registry client — wire format, traits, caching, HTTP
Documentation
name: Release

on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+*"

env:
  CARGO_TERM_COLOR: always

jobs:
  # ── Preflight ─────────────────────────────────────────────────────────────
  preflight:
    name: Preflight checks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --check

      - name: Clippy (all features)
        run: cargo clippy --all-features -- -D warnings

      - name: Tests (all features)
        run: cargo test --all-features

      - name: Tests (no default features)
        run: cargo test --no-default-features

      - name: Docs (all features)
        run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps

      # Verify the version tag matches the crate version in Cargo.toml.
      - name: Verify crate version matches tag
        run: |
          CRATE_VERSION=$(cargo metadata --no-deps --format-version 1 \
            | jq -r '.packages[0].version')
          TAG_VERSION="${GITHUB_REF_NAME#v}"
          if [ "$CRATE_VERSION" != "$TAG_VERSION" ]; then
            echo "ERROR: Cargo.toml version ($CRATE_VERSION) != tag ($TAG_VERSION)"
            exit 1
          fi
          echo "Version OK: $CRATE_VERSION"

  # ── Publish ───────────────────────────────────────────────────────────────
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    needs: preflight
    environment: crates-io
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: cargo publish --no-verify