rustcdc 0.3.0

Embeddable Rust CDC library focused on correctness-first capture primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
name: ci

on:
  workflow_dispatch:
  push:
    branches:
      - main
    tags:
      - "v*"
  pull_request:

permissions:
  actions: read
  contents: read

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

jobs:
  msrv:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: 1.92.0
      - uses: Swatinem/rust-cache@v2
      - name: cargo check --no-default-features (msrv)
        run: cargo check --no-default-features
      - name: cargo check --features default (msrv)
        run: cargo check --features default
      - name: cargo test --lib --features default (msrv)
        run: cargo test --lib --features default

  check:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        rust: [stable, nightly]
        profile:
          - { name: no-default-features, args: "--no-default-features" }
          - { name: default-features, args: "--features default" }
          - { name: all-features, args: "--all-features" }
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - name: cargo check (${{ matrix.profile.name }})
        run: cargo check ${{ matrix.profile.args }}
      - name: cargo test --lib (${{ matrix.profile.name }})
        run: cargo test --lib ${{ matrix.profile.args }}
      - name: cargo build --example suite (stable ubuntu)
        if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
        run: |
          cargo build --example pg_to_stdout --features postgres
          cargo build --example postgres_to_otel --features postgres,metrics
          cargo build --example sqlserver_to_otel --features sqlserver,metrics
          cargo build --example regex_filter_transform
          cargo build --example uppercase_transform

  quality:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        rust: [stable, nightly]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - name: cargo fmt --check
        run: cargo fmt --check
      - name: cargo clippy --all-targets --all-features -- -D warnings
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: cargo doc --all-features --no-deps
        run: cargo doc --all-features --no-deps
        env:
          RUSTDOCFLAGS: "-D warnings"

  transport-security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --lib --features postgres,tls
        run: cargo test --lib --features postgres,tls
      - name: cargo test --lib --features mysql,tls
        run: cargo test --lib --features mysql,tls
      - name: cargo test --lib --features sqlserver,tls
        run: cargo test --lib --features sqlserver,tls

  policy-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: install policy gate dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y ripgrep jq
      - name: policy gates (schema + deprecated + workflow drift)
        run: bash scripts/ci-policy-gate.sh

  correctness-smoke:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: pre-pull postgres image (public ecr mirror)
        run: bash scripts/ci-pull-relational-images.sh 16-alpine
      - name: pre-pull mysql/mariadb/sqlserver images
        run: bash scripts/ci-pull-relational-images.sh --relational-smoke
      - name: contract compatibility smoke
        run: cargo test --test compatibility_contract --all-features
      - name: postgres checkpoint durability smoke
        run: cargo test --test checkpoint_file_integration --features postgres
      - name: postgres process-crash replay smoke
        run: cargo test --test runtime_postgres_process_crash_integration --features postgres --bins
      - name: reliability data-loss smoke
        run: cargo test --test data_loss_detection --features postgres,test-harnesses
      - name: mysql connection integration smoke
        run: cargo test --test mysql_connection_integration --features mysql
      - name: mariadb connection integration smoke
        run: cargo test --test mariadb_connection_integration --features mariadb
      - name: sqlserver connection integration smoke
        run: cargo test --test sqlserver_connection_integration --features sqlserver
      - name: mysql process-crash replay smoke
        run: cargo test --test runtime_mysql_process_crash_integration --features mysql --bins
      - name: mariadb process-crash replay smoke
        run: cargo test --test runtime_mariadb_process_crash_integration --features mariadb --bins
      - name: sqlserver process-crash replay smoke
        run: cargo test --test runtime_sqlserver_process_crash_integration --features sqlserver --bins

  reliability-core:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        suite:
          - deterministic_replay_failure_fixtures
          - deterministic_replay_golden_fixtures
          - runtime_health_states
          - wasm_conformance_contract
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: reliability core suite (${{ matrix.suite }})
        run: cargo test --test ${{ matrix.suite }} --features postgres,test-harnesses

  latency-core:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
      LATENCY_GATE_DEFAULT_P95_MS: "500"
      LATENCY_GATE_DEFAULT_P99_MS: "1000"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: pre-pull postgres image (public ecr mirror)
        run: bash scripts/ci-pull-relational-images.sh 16-alpine
      - name: connector-backed latency evidence gate (p95/p99)
        run: bash scripts/ci-latency-gate.sh

  integration-postgres:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    strategy:
      fail-fast: false
      matrix:
        suite:
          - runtime_postgres
          - postgres_version_matrix
          - postgres_snapshot_integration
          - postgres_stream_integration
          - postgres_handoff_integration
          - checkpoint_file_integration
          - runtime_postgres_process_crash_integration
          - parallel_snapshot_stress_integration
          - otel_metrics_integration
          - otel_tracing_integration
          - snapshot_resumable_integration
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: pre-pull postgres images (public ecr mirror)
        run: |
          tags="16-alpine"
          if [[ "${{ matrix.suite }}" == "postgres_version_matrix" ]]; then
            tags="12-alpine 14-alpine 15-alpine 16-alpine"
          fi
          bash scripts/ci-pull-relational-images.sh ${tags}
      - name: cargo test --test ${{ matrix.suite }}
        if: matrix.suite != 'runtime_postgres_process_crash_integration' && matrix.suite != 'otel_metrics_integration' && matrix.suite != 'otel_tracing_integration'
        run: cargo test --test ${{ matrix.suite }} --features postgres
      - name: cargo test --test ${{ matrix.suite }} (metrics)
        if: matrix.suite == 'otel_metrics_integration' || matrix.suite == 'otel_tracing_integration'
        run: cargo test --test ${{ matrix.suite }} --features postgres,metrics
      - name: cargo test --test runtime_postgres_process_crash_integration (with bins)
        if: matrix.suite == 'runtime_postgres_process_crash_integration'
        run: cargo test --test runtime_postgres_process_crash_integration --features postgres --bins

  integration-postgres-encryption:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: pre-pull postgres images (public ecr mirror)
        run: bash scripts/ci-pull-relational-images.sh 16-alpine
      - name: cargo test --test runtime_postgres_process_crash_integration --features postgres,encryption --bins
        run: cargo test --test runtime_postgres_process_crash_integration --features postgres,encryption --bins

  integration-reliability:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        suite:
          - data_loss_detection
          - deterministic_replay_failure_fixtures
          - deterministic_replay_golden_fixtures
          - runtime_health_states
          - fault_injection_soak_matrix
          - wasm_runtime_integration
          - wasm_conformance_contract
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test ${{ matrix.suite }} --features postgres,test-harnesses
        run: cargo test --test ${{ matrix.suite }} --features postgres,test-harnesses

  integration-mysql:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    strategy:
      fail-fast: false
      matrix:
        suite:
          - mysql_version_matrix
          - mysql_connection_integration
          - mysql_snapshot_integration
          - mysql_stream_integration
          - mysql_handoff_integration
          - runtime_mysql_process_crash_integration
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test ${{ matrix.suite }}
        if: matrix.suite != 'runtime_mysql_process_crash_integration'
        run: cargo test --test ${{ matrix.suite }} --features mysql
      - name: cargo test --test runtime_mysql_process_crash_integration (with bins)
        if: matrix.suite == 'runtime_mysql_process_crash_integration'
        run: cargo test --test runtime_mysql_process_crash_integration --features mysql --bins

  integration-mysql-encryption:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test runtime_mysql_process_crash_integration --features mysql,encryption --bins
        run: cargo test --test runtime_mysql_process_crash_integration --features mysql,encryption --bins

  integration-mariadb:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    strategy:
      fail-fast: false
      matrix:
        suite:
          - mariadb_connection_integration
          - mariadb_e2e_integration
          - runtime_mariadb_process_crash_integration
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test ${{ matrix.suite }}
        if: matrix.suite != 'runtime_mariadb_process_crash_integration'
        run: cargo test --test ${{ matrix.suite }} --features mariadb
      - name: cargo test --test runtime_mariadb_process_crash_integration (with bins)
        if: matrix.suite == 'runtime_mariadb_process_crash_integration'
        run: cargo test --test runtime_mariadb_process_crash_integration --features mariadb --bins

  integration-mariadb-encryption:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test runtime_mariadb_process_crash_integration --features mariadb,encryption --bins
        run: cargo test --test runtime_mariadb_process_crash_integration --features mariadb,encryption --bins

  integration-sqlserver:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    strategy:
      fail-fast: false
      matrix:
        suite:
          - sqlserver_version_matrix
          - sqlserver_snapshot_integration
          - sqlserver_stream_integration
          - sqlserver_handoff_integration
          - runtime_sqlserver_process_crash_integration
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test ${{ matrix.suite }}
        if: matrix.suite != 'runtime_sqlserver_process_crash_integration'
        run: cargo test --test ${{ matrix.suite }} --features sqlserver
      - name: cargo test --test runtime_sqlserver_process_crash_integration (with bins)
        if: matrix.suite == 'runtime_sqlserver_process_crash_integration'
        run: cargo test --test runtime_sqlserver_process_crash_integration --features sqlserver --bins

  integration-sqlserver-encryption:
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@v2
      - name: cargo test --test runtime_sqlserver_process_crash_integration --features sqlserver,encryption --bins
        run: cargo test --test runtime_sqlserver_process_crash_integration --features sqlserver,encryption --bins

  release-evidence:
    if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
    needs:
      - msrv
      - check
      - quality
      - transport-security
      - policy-gate
      - correctness-smoke
      - reliability-core
      - latency-core
      - integration-postgres
      - integration-postgres-encryption
      - integration-reliability
      - integration-mysql
      - integration-mysql-encryption
      - integration-mariadb
      - integration-mariadb-encryption
      - integration-sqlserver
      - integration-sqlserver-encryption
    runs-on: ubuntu-latest
    env:
      CDC_RS_RUN_DOCKER_TESTS: "1"
      BENCHMARK_STRICT: "1"
      BENCHMARK_REQUIRE_HISTORICAL_BASELINE: "1"
      BENCHMARK_ENFORCE_RELEASE_POLICY: "1"
      CRITERION_BASELINE: ci-baseline
      BENCHMARK_CRITICAL_GROUP_PREFIXES: "quality_gates wasm_transform"
      LATENCY_GATE_DEFAULT_P95_MS: "500"
      LATENCY_GATE_DEFAULT_P99_MS: "1000"
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: install release evidence dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y ripgrep jq

      - name: derive benchmark baseline inputs
        env:
          CONFIGURED_BASELINE_COMMIT: ${{ vars.BENCHMARK_BASELINE_COMMIT }}
          CONFIGURED_BASELINE_ARTIFACT: ${{ vars.BENCHMARK_BASELINE_ARTIFACT }}
        run: |
          set -euo pipefail

          baseline_commit="${CONFIGURED_BASELINE_COMMIT}"
          baseline_artifact="${CONFIGURED_BASELINE_ARTIFACT}"

          if [ -z "$baseline_commit" ]; then
            # Auto-detect baseline from git history:
            # 1. Try the most recent prior release tag.
            # 2. Fall back to HEAD~1 (parent commit).
            # 3. If this is the initial commit with no parent, use HEAD itself
            #    and disable the historical-baseline requirement for this run.
            prior_tag_commit="$(git log --tags --no-walk --pretty=format:'%H' 2>/dev/null | head -1 || true)"
            if [ -n "$prior_tag_commit" ] && [ "$prior_tag_commit" != "$(git rev-parse HEAD)" ]; then
              baseline_commit="$prior_tag_commit"
              echo "::notice::BENCHMARK_BASELINE_COMMIT not configured — auto-detected from most recent release tag: ${baseline_commit:0:12}. Set the 'BENCHMARK_BASELINE_COMMIT' repository variable to a specific SHA for reproducible release evidence."
            elif git rev-parse HEAD~1 >/dev/null 2>&1; then
              baseline_commit="$(git rev-parse HEAD~1)"
              echo "::notice::BENCHMARK_BASELINE_COMMIT not configured — falling back to HEAD~1: ${baseline_commit:0:12}. Set the 'BENCHMARK_BASELINE_COMMIT' repository variable to a known-good commit SHA for reproducible release evidence."
            else
              # Initial commit: no ancestor exists — bootstrap mode.
              baseline_commit="$(git rev-parse HEAD)"
              echo "BENCHMARK_REQUIRE_HISTORICAL_BASELINE=0" >> "$GITHUB_ENV"
              echo "BENCHMARK_ENFORCE_RELEASE_POLICY=0" >> "$GITHUB_ENV"
              echo "::notice::BENCHMARK_BASELINE_COMMIT not configured and no prior commit found — running in bootstrap mode (no regression comparison, release policy not enforced)."
            fi
          fi

          if [ -z "$baseline_artifact" ]; then
            baseline_artifact="commit:${baseline_commit}"
          fi

          echo "BENCHMARK_BASELINE_COMMIT=$baseline_commit" >> "$GITHUB_ENV"
          echo "BENCHMARK_BASELINE_ARTIFACT=$baseline_artifact" >> "$GITHUB_ENV"

      - name: policy gate
        run: bash scripts/ci-policy-gate.sh

      - name: clear stale criterion baseline cache
        run: |
          # Remove any Criterion baseline cached from a prior crate version
          # (Swatinem/rust-cache persists target/ across Cargo.lock-stable runs).
          # Clearing here forces ensure_named_baseline to bootstrap against the
          # current commit so the gate compares like-for-like.
          rm -rf target/criterion

      - name: benchmark policy gate
        run: bash scripts/ci-benchmark-gate.sh

      - name: full integration 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

  release-evidence-verify:
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: install verification dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y jq

      - 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: verify successful release-evidence run exists for this commit
        uses: actions/github-script@v7
        with:
          script: |
            const owner = context.repo.owner;
            const repo = context.repo.repo;
            const workflowId = '.github/workflows/ci.yml';
            const headSha = context.sha;

            const runs = await github.paginate(github.rest.actions.listWorkflowRuns, {
              owner,
              repo,
              workflow_id: workflowId,
              per_page: 100,
              head_sha: headSha,
            });

            const candidates = runs.filter((run) =>
              run.id !== context.runId &&
              !run.head_branch?.startsWith('v') &&
              run.event !== 'workflow_dispatch' &&
              run.conclusion === 'success'
            );

            if (candidates.length === 0) {
              core.setFailed(`No successful non-tag CI run found for commit ${headSha}.`);
              return;
            }

            let evidenceFound = false;
            for (const run of candidates) {
              const jobsResp = await github.rest.actions.listJobsForWorkflowRun({
                owner,
                repo,
                run_id: run.id,
                per_page: 100,
              });

              const releaseEvidenceJob = jobsResp.data.jobs.find((job) => job.name === 'release-evidence');
              if (!releaseEvidenceJob || releaseEvidenceJob.conclusion !== 'success') {
                continue;
              }

              const artifactsResp = await github.rest.actions.listWorkflowRunArtifacts({
                owner,
                repo,
                run_id: run.id,
                per_page: 100,
              });

              const hasEvidenceArtifact = artifactsResp.data.artifacts.some((artifact) => artifact.name === 'release-gate-evidence');
              if (hasEvidenceArtifact) {
                core.info(`Using validated evidence from run ${run.id}.`);
                evidenceFound = true;
                break;
              }
            }

            if (!evidenceFound) {
              core.setFailed('No successful release-evidence job with release-gate-evidence artifact found for this commit.');
            }

  publish:
    if: startsWith(github.ref, 'refs/tags/v')
    needs: release-evidence-verify
    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 }}