Skip to content

Commit 287e891

Browse files
committed
fixing ci-cd
1 parent 91de857 commit 287e891

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
publish:
1313
if: github.event.release.target_commitish == 'main'
1414
runs-on: ubuntu-latest
15+
environment: publish
16+
permissions:
17+
contents: read
18+
id-token: write
1519
steps:
1620
- name: Checkout
1721
uses: actions/checkout@v6
@@ -54,7 +58,11 @@ jobs:
5458
- name: Verify tests
5559
run: cargo +stable test --workspace --all-features --locked
5660

61+
- name: Authenticate with crates.io
62+
id: auth
63+
uses: rust-lang/crates-io-auth-action@v1
64+
5765
- name: Publish to crates.io
5866
env:
59-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
60-
run: cargo +stable publish --locked --token "$CARGO_REGISTRY_TOKEN"
67+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
68+
run: cargo +stable publish --locked

0 commit comments

Comments
 (0)