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
name: Release
# Triggered only when a version tag is pushed.
#
# Recommended local release workflow (using cargo-release):
# cargo install cargo-release
# cargo release patch --execute # bumps version, commits, tags, and pushes
#
# That push of the v* tag is what triggers this workflow.
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
# ── Gate: run the full CI suite on the tagged commit ───────────────────────
ci:
name: CI
uses: ./.github/workflows/rust-ci.yml
# ── Publish to crates.io (only after CI passes) ────────────────────────────
publish:
name: Publish to crates.io
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Verify package (dry-run)
run: cargo publish --dry-run
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}