Skip to content

Commit 8d05e3c

Browse files
authored
ci: Add crates.io trusted publishing workflow (#58)
Add a GitHub Actions workflow for trusted publishing to crates.io using OIDC authentication. This enables secure, tokenless publishing when pushing version tags (v*) to the repository. Part of bootc-dev/infra#20 Assisted-by: OpenCode (claude-opus-4-5@20251101) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 6f4fc05 commit 8d05e3c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://crates.io/docs/trusted-publishing
2+
name: Publish to crates.io
3+
on:
4+
push:
5+
tags: ['v*'] # Triggers when pushing tags starting with 'v'
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-24.04
9+
permissions:
10+
id-token: write # Required for OIDC token exchange
11+
steps:
12+
- uses: actions/checkout@v6
13+
- uses: rust-lang/crates-io-auth-action@v1
14+
id: auth
15+
- run: cargo publish
16+
env:
17+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
18+

0 commit comments

Comments
 (0)