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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3b9d4ce2dd
commit
62c1ca773e
@@ -88,10 +88,36 @@ jobs:
|
|||||||
name: linux-binary
|
name: linux-binary
|
||||||
path: dist/mcp-mt5-quant-linux-x64.tar.gz
|
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 ───────────────────────────────────────────────────────────
|
# ── GitHub Release ───────────────────────────────────────────────────────────
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build-macos, build-linux]
|
needs: [build-macos, build-linux, cargo-publish]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
Reference in New Issue
Block a user