Add release-sdk-rust.yml for crates.io publish automation
Triggers on semver tag push or manual dispatch. Validates tag matches Cargo.toml version, runs dry-run, then publishes. No git-dep swapping needed — Cargo.toml already uses onde-mistralrs registry deps since v1.0.0.
keypair34 committed
Apr 26, 2026 at 16:00 UTC
e0e422c0c68454ac5198a535820fc49425194544
1 file changed
+50
.github/workflows/release-sdk-rust.yml
new
+50
@@ -0,0 +1,50 @@
1
+name: Release SDK Rust (crates.io)
2
+
3
+on:
4
+ push:
5
+ tags:
6
+ - "[0-9]+.[0-9]+.[0-9]+"
7
+ workflow_dispatch:
8
+
9
+permissions:
10
+ contents: read
11
+
12
+jobs:
13
+ publish:
14
+ name: cargo publish
15
+ runs-on: macos-26
16
+
17
+ env:
18
+ GRESIQ_API_KEY_DEV: ${{ secrets.GRESIQ_API_KEY_DEV }}
19
+ GRESIQ_API_SECRET_DEV: ${{ secrets.GRESIQ_API_SECRET_DEV }}
20
+ GRESIQ_API_KEY_PRODUCTION: ${{ secrets.GRESIQ_API_KEY_PRODUCTION }}
21
+ GRESIQ_API_SECRET_PRODUCTION: ${{ secrets.GRESIQ_API_SECRET_PRODUCTION }}
22
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
23
+
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v6
27
+
28
+ - name: Install stable Rust toolchain
29
+ uses: dtolnay/rust-toolchain@stable
30
+
31
+ - name: Validate tag matches Cargo.toml version
32
+ if: startsWith(github.ref, 'refs/tags/')
33
+ run: |
34
+ TAG="${GITHUB_REF#refs/tags/}"
35
+ CRATE_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "//;s/"//')
36
+ echo "Tag: $TAG"
37
+ echo "Crate: $CRATE_VERSION"
38
+ if [ "$TAG" != "$CRATE_VERSION" ]; then
39
+ echo "::error::Tag '$TAG' does not match Cargo.toml version '$CRATE_VERSION'."
40
+ exit 1
41
+ fi
42
+
43
+ - name: cargo publish --dry-run
44
+ run: cargo publish --dry-run
45
+
46
+ - name: cargo publish
47
+ if: startsWith(github.ref, 'refs/tags/')
48
+ env:
49
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
50
+ run: cargo publish