Skip to content

Commit 5fdaed8

Browse files
epilysroypat
authored andcommitted
ci: add crates.io publish workflow
Add a trusted publishing workflow for crates.io. It will be triggered everytime there's a push of a tag starting with `v`. The workflow must be manually added to crates.io: > Configuring Trusted Publishing > > Configure your crate on crates.io: > > Go to your crate's Settings → Trusted Publishing > Click the "Add" button and fill in: > Repository owner: Your GitHub username or organization > Repository name: The name of your repository > Workflow filename: The filename of your GitHub Actions workflow (e.g., "release.yml") > Environment: Optional environment name if you're using GitHub environments > Save the configuration Documentation: https://crates.io/docs/trusted-publishing Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
1 parent 4fafe0c commit 5fdaed8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)