Skip to content

Commit b7b2638

Browse files
authored
Try out trusted publishing for crates.io (#69)
1 parent 594f2b1 commit b7b2638

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ on:
99

1010
permissions:
1111
contents: write
12+
id-token: write
1213

1314
jobs:
1415
create_tag:
1516
name: Publish artifacts of build
17+
environment: release
1618
runs-on: ubuntu-latest
1719
if: |
1820
github.repository_owner == 'bytecodealliance'
@@ -79,10 +81,15 @@ jobs:
7981
files: "dist/*"
8082
tag_name: v${{ steps.tag.outputs.version }}
8183

84+
85+
- uses: rust-lang/crates-io-auth-action@v1
86+
id: auth
87+
if: steps.tag.outputs.push_tag == 'yes'
88+
8289
- run: |
8390
rm -rf dist main.log
8491
rustc ci/publish.rs
8592
./publish publish
8693
env:
87-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
94+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
8895
if: steps.tag.outputs.push_tag == 'yes'

0 commit comments

Comments
 (0)