Skip to content

Commit e0fc25b

Browse files
committed
Update GitHub Actions workflow for crate publishing
- Added permissions for id-token to enhance authentication during crate publishing. - Switched from using `actions-rust-lang/setup-rust-toolchain` to `rust-lang/crates-io-auth-action` for improved token management. - Updated the environment variable for `CARGO_REGISTRY_TOKEN` to utilize the output from the new authentication step, ensuring secure and efficient publishing. These changes aim to streamline the release process and maintain security best practices.
1 parent 7fa17ae commit e0fc25b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ jobs:
6565
publish:
6666
name: Publish to crates.io
6767
runs-on: ubuntu-latest
68+
permissions:
69+
id-token: write
6870
needs: validate
6971
steps:
7072
- uses: actions/checkout@v6
71-
- uses: actions-rust-lang/setup-rust-toolchain@v1
72-
- name: Publish crate
73+
- uses: rust-lang/crates-io-auth-action@v1
74+
id: auth
75+
- run: cargo publish
7376
env:
74-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
75-
run: cargo publish
77+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)