From 62c1ca773e6460dd7c131f7036006716e098c657 Mon Sep 17 00:00:00 2001 From: Devid HW Date: Thu, 23 Apr 2026 01:30:12 +0700 Subject: [PATCH] ci: publish to crates.io before GitHub release Add cargo-publish job that runs in parallel with binary builds. The release job now depends on [build-macos, build-linux, cargo-publish] so the crate is always published to crates.io before the GitHub release and binaries are attached. Requires CARGO_REGISTRY_TOKEN secret in repo settings. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e93bd43..30a0729 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,10 +88,36 @@ jobs: name: linux-binary path: dist/mcp-mt5-quant-linux-x64.tar.gz + # ── Cargo Publish ──────────────────────────────────────────────────────────── + + cargo-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-publish-${{ hashFiles('Cargo.lock') }} + restore-keys: cargo-publish- + + - name: Publish to crates.io + run: cargo publish --no-verify + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # ── GitHub Release ─────────────────────────────────────────────────────────── release: - needs: [build-macos, build-linux] + needs: [build-macos, build-linux, cargo-publish] + runs-on: ubuntu-latest permissions: contents: write