Skip to content

Commit e3846a8

Browse files
authored
crates.io Trusted Publishing (https://crates.io/docs/trusted-publishing)
Signed-off-by: GitHub <[email protected]>
1 parent 9daaf84 commit e3846a8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ jobs:
1010
publish:
1111
name: Publish
1212
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write # Required for OIDC token exchange (CARGO_REGISTRY_TOKEN)
1315
steps:
1416
- uses: actions/checkout@v4
17+
# https://crates.io/docs/trusted-publishing
18+
- uses: rust-lang/crates-io-auth-action@v1
19+
id: auth
1520
- name: cargo publish typed_floats_macros
16-
run: cd typed_floats_macros && cargo publish --token ${CRATES_TOKEN}
21+
run: cd typed_floats_macros && cargo publish
1722
env:
18-
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
23+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
1924
- name: cargo publish typed_floats
20-
run: cd typed_floats && cargo publish --allow-dirty --token ${CRATES_TOKEN}
25+
run: cd typed_floats && cargo publish --allow-dirty
2126
env:
22-
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
27+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2328

0 commit comments

Comments
 (0)