Skip to content

Commit 9a93010

Browse files
committed
ci: publish to crates.io via trusted publishing
Replace the static CRATE_AUTH_TOKEN secret with OIDC-based Trusted Publishing using rust-lang/crates-io-auth-action, which exchanges a short-lived token at publish time instead of storing a long-lived credential in the repository. https://claude.ai/code/session_013tt2ucFPTnTnGGM1RLG19m
1 parent cdb1b88 commit 9a93010

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,9 @@ jobs:
469469

470470
runs-on: ubuntu-latest
471471

472+
permissions:
473+
id-token: write # needed for crates.io Trusted Publishing
474+
472475
steps:
473476
- uses: actions/checkout@v6
474477

@@ -479,11 +482,14 @@ jobs:
479482
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > $installer
480483
bash $installer --default-toolchain $(cat rust-toolchain) -y
481484
482-
- name: Login
483-
run: cargo login ${{ secrets.CRATE_AUTH_TOKEN }}
485+
- name: Authenticate with crates.io
486+
id: auth
487+
uses: rust-lang/crates-io-auth-action@v1
484488

485489
- name: Publish
486490
run: cargo publish
491+
env:
492+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
487493

488494
competing_benchmark:
489495
name: Benchmark

0 commit comments

Comments
 (0)