Skip to content

Commit df8cf6d

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

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
@@ -14,6 +14,8 @@ jobs:
1414
crates:
1515
name: Publish to crates.io
1616
runs-on: ubuntu-latest
17+
permissions:
18+
id-token: write # required for OIDC token exchange (crates-io-auth-action)
1719
if: |
1820
startsWith(github.ref, 'refs/tags/v') &&
1921
github.repository_owner == 'spinframework'
@@ -26,17 +28,23 @@ jobs:
2628
rustup toolchain install ${{ env.RUST_VERSION }}
2729
rustup default ${{ env.RUST_VERSION }}
2830
31+
- uses: rust-lang/[email protected]
32+
id: auth
33+
2934
- name: Publish spin-executor to crates.io
3035
working-directory: ./crates/executor
31-
run: |
32-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
36+
run: cargo publish
37+
env:
38+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
3339

3440
- name: Publish spin-macro to crates.io
3541
working-directory: ./crates/macro
36-
run: |
37-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
42+
run: cargo publish
43+
env:
44+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
3845

3946
- name: Publish spin-sdk to crates.io
4047
working-directory: ./
41-
run: |
42-
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
48+
run: cargo publish
49+
env:
50+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)