From 7e7466d224a4a8b0be6bebe6efecd3b585a0a040 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 23 Jul 2025 14:53:52 +0800 Subject: [PATCH] ci: enable trust publishing for rust crates (#2529) --- .github/workflows/cargo-publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cargo-publish.yml b/.github/workflows/cargo-publish.yml index 8bb085b0..1243395c 100644 --- a/.github/workflows/cargo-publish.yml +++ b/.github/workflows/cargo-publish.yml @@ -5,8 +5,8 @@ on: tags-ignore: # We don't publish pre-releases for Rust. Crates.io is just a source # distribution, so we don't need to publish pre-releases. - - 'v*-beta*' - - '*-v*' # for example, python-vX.Y.Z + - "v*-beta*" + - "*-v*" # for example, python-vX.Y.Z env: # This env var is used by Swatinem/rust-cache@v2 for the cache @@ -19,6 +19,8 @@ env: jobs: build: runs-on: ubuntu-22.04 + permissions: + id-token: write timeout-minutes: 30 # Only runs on tags that matches the make-release action if: startsWith(github.ref, 'refs/tags/v') @@ -31,6 +33,8 @@ jobs: run: | sudo apt update sudo apt install -y protobuf-compiler libssl-dev + - uses: rust-lang/crates-io-auth-action@v1 + id: auth - name: Publish the package run: | - cargo publish -p lancedb --all-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish -p lancedb --all-features --token ${{ steps.auth.outputs.token }}