Skip to content

Commit 15559b7

Browse files
Migrate to crates.io trusted publishing setup (#280)
Migrates the `liboxen` crate publishing to crates.io's trusted publishing. Publish jobs get an expiring credential for each invocation.
1 parent 7aa0127 commit 15559b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,21 @@ jobs:
3838
maturin-version: v1.8.5
3939

4040
publish_liboxen_crate:
41+
# See https://crates.io/docs/trusted-publishing for details
4142
name: Publish liboxen crate to crates.io
4243
runs-on: ubuntu-latest
44+
permissions:
45+
id-token: write # Required for OIDC token exchange
4346
steps:
4447
- name: Checkout
4548
uses: actions/checkout@v4
46-
49+
- uses: rust-lang/crates-io-auth-action@v1
50+
id: auth
4751
- name: Upload to crates.io
52+
env:
53+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
4854
run: |
4955
cd ${{ github.workspace }}/oxen-rust/src/lib
50-
cargo login ${{ secrets.CRATES_IO_TOKEN }}
5156
cargo publish
5257
5358
publish_homebrew_oxen:

0 commit comments

Comments
 (0)