From 67dad34b9dd11155f8556614bde4a00694fcd6c0 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 29 Oct 2026 16:26:43 +0200 Subject: [PATCH] publish.yaml: switch to crates.io trusted publishing (OIDC) Replace the long-lived CARGO_REGISTRY_TOKEN secret with a short-lived token minted by rust-lang/crates-io-auth-action (pinned to v1.0.6), matching hypersync-client-solana and hyperfuel-client-rust. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 09b3ab4..f4d7933 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,6 +2,10 @@ name: Publish to crates.io permissions: contents: write + # Lets the job mint a GitHub OIDC token, which crates-io-auth-action exchanges + # for a short-lived crates.io token. Each crate has a Trusted Publisher entry + # on crates.io pinning this repo + this workflow file. + id-token: write on: workflow_dispatch: @@ -62,10 +66,14 @@ jobs: fi echo "No existing tag or release found for ${TAG}. Proceeding." + - name: Authenticate with crates.io + id: auth + uses: rust-lang/crates-io-auth-action@3268eb413133e2960fa4ae0e963ca76380c54cd9 # v1.0.6 + - name: Publish to crates.io env: VERBOSE: true - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} run: | cargo publish -p ${{ inputs.crate_name }}