Skip to content

Commit 6ba36ae

Browse files
committed
add github action
1 parent 90ccad5 commit 6ba36ae

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Rust
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Build
14+
run: cargo build --verbose
15+
- name: Run tests
16+
run: cargo test --verbose
17+
pre-release-check:
18+
if: success() && startsWith(github.ref, 'refs/tags/')
19+
runs-on: ubuntu-latest
20+
needs: [build]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Publish Dry Run
24+
run: cargo publish --dry-run
25+
release:
26+
if: success() && startsWith(github.ref, 'refs/tags/')
27+
environment: crates.io
28+
runs-on: ubuntu-latest
29+
needs: [build, pre-release-check]
30+
env:
31+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Publish
35+
run: cargo publish

0 commit comments

Comments
 (0)