name: publish
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
permissions:
contents: read
jobs:
preflight:
runs-on: ubuntu-latest
env:
CDC_RS_RUN_DOCKER_TESTS: "1"
CDC_RS_ALLOW_INSECURE_TEST_TRANSPORT: "1"
BENCHMARK_STRICT: "1"
BENCHMARK_BASELINE_COMMIT: ${{ github.sha }}
BENCHMARK_BASELINE_ARTIFACT: BENCHMARK_REPORT.md
BENCHMARK_CRITICAL_GROUP_PREFIXES: "quality_gates wasm_transform"
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: strict benchmark evidence gate
run: bash scripts/ci-benchmark-gate.sh
- 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
target/benchmark-ci-gate*.txt
target/benchmark-ci-env.txt
target/criterion
BENCHMARK_REPORT.md
publish:
needs: preflight
runs-on: ubuntu-latest
environment: crates-io 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 }}