rustcdc 0.1.2

Embeddable Rust CDC library focused on correctness-first capture primitives
Documentation
name: publish

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

permissions:
  contents: read

jobs:
  # ── Sanity checks ──────────────────────────────────────────────────────────
  preflight:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
      CDC_RS_ALLOW_INSECURE_TEST_TRANSPORT: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Verify tag matches Cargo.toml version
        run: |
          TAG="${GITHUB_REF_NAME#v}"
          CARGO_VERSION=$(cargo metadata --no-deps --format-version 1 \
            | jq -r '.packages[] | select(.name == "rustcdc") | .version')
          if [ "$TAG" != "$CARGO_VERSION" ]; then
            echo "::error::Tag $GITHUB_REF_NAME does not match Cargo.toml version $CARGO_VERSION"
            exit 1
          fi

      - name: cargo fmt --check
        run: cargo fmt --check

      - name: cargo clippy --all-targets --all-features
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: cargo test --lib --all-features
        run: cargo test --lib --all-features

      - name: cargo doc --no-deps
        run: cargo doc --no-deps
        env:
          RUSTDOCFLAGS: "-D warnings"

      - name: cargo package (dry-run)
        run: cargo package --no-verify --all-features

      - name: full integration and reliability matrix evidence
        run: bash scripts/run_full_integration_matrix_evidence.sh

      - name: upload release-gate evidence artifacts
        uses: actions/upload-artifact@v4
        with:
          name: release-gate-evidence
          path: |
            target/integration-full-matrix-evidence.txt
            target/latency-evidence.txt
            target/latency-gate.txt
            target/postgres-latency-evidence.json
            target/postgres-latency-evidence.md
            target/mysql-latency-evidence.json
            target/mysql-latency-evidence.md
            target/sqlserver-latency-evidence.json
            target/sqlserver-latency-evidence.md

  # ── Publish ────────────────────────────────────────────────────────────────
  publish:
    needs: preflight
    runs-on: ubuntu-latest
    environment: crates-io   # optional: add a GitHub environment with required reviewers
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

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