Skip to content

Commit 21a86ce

Browse files
committed
ci(release.yml): update to use oidc token
Signed-off-by: Vaughn Dice <[email protected]>
1 parent a30eb5c commit 21a86ce

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
crates:
1212
name: Publish to crates.io
1313
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write # required for OIDC token exchange (crates-io-auth-action)
1416
if: github.repository_owner == 'spinframework'
1517
steps:
1618
- uses: actions/checkout@v4
@@ -21,17 +23,23 @@ jobs:
2123
rustup toolchain install ${{ env.RUST_VERSION }}
2224
rustup default ${{ env.RUST_VERSION }}
2325
26+
- uses: rust-lang/[email protected]
27+
id: auth
28+
2429
- name: Publish spin-executor to crates.io
2530
working-directory: ./crates/executor
26-
run: |
27-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
run: cargo publish
32+
env:
33+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2834

2935
- name: Publish spin-macro to crates.io
3036
working-directory: ./crates/macro
31-
run: |
32-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
37+
run: cargo publish
38+
env:
39+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
3340

3441
- name: Publish spin-sdk to crates.io
3542
working-directory: ./
36-
run: |
37-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
43+
run: cargo publish
44+
env:
45+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)