Skip to content

Commit d23f155

Browse files
committed
Add a CI workflow to publish to crate.io
1 parent e12a084 commit d23f155

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
# environment: release # Optional: for enhanced security
13+
permissions:
14+
id-token: write # Required for OIDC token exchange
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: rust-lang/crates-io-auth-action@v1
18+
if: github.ref_type == 'tag'
19+
id: auth
20+
- uses: katyo/publish-crates@v2
21+
with:
22+
registry-token: ${{ steps.auth.outputs.token }}
23+
dry-run: ${{ github.ref_type != 'tag' }}
24+
ignore-unpublished-changes: true

0 commit comments

Comments
 (0)