Skip to content

Commit b539614

Browse files
xi xiaoxixiaofinland
authored andcommitted
feat: add github action to auto publish to creates.io when tagging
1 parent 6332fa0 commit b539614

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger only on version tags (e.g., v1.0.0)
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
name: Publish to crates.io
15+
steps:
16+
# Checkout the repository
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install Rust
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
# Publish to crates.io
24+
- name: Publish to crates.io
25+
env:
26+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
27+
run: |
28+
# Ensure Cargo.lock is up-to-date
29+
cargo check
30+
# Publish to crates.io
31+
cargo publish --no-verify
32+

0 commit comments

Comments
 (0)