Skip to content

Commit 55ff110

Browse files
committed
chore: Added release-plz to automate release management
1 parent 15d2dae commit 55ff110

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches: [ main ]
10+
pull_request:
11+
branches: [ main ]
12+
13+
env:
14+
RUSTFLAGS: -D warnings
15+
RUST_BACKTRACE: short
16+
CARGO_NET_RETRY: 10
17+
CARGO_TERM_COLOR: always
18+
CARGO_INCREMENTAL: 0
19+
20+
jobs:
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
28+
- name: Show Active Rust Toolchain
29+
run: rustup show active-toolchain
30+
31+
- name: Run cargo test
32+
run: cargo test --verbose --workspace
33+
34+
clippy:
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v4
40+
41+
- name: Run clippy
42+
run: cargo clippy -- -D clippy::all
43+
44+
cargo-fmt:
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout Repository
49+
uses: actions/checkout@v4
50+
51+
- name: Run cargo fmt
52+
run: cargo fmt --all -- --check
53+
54+
release-plz:
55+
runs-on: ubuntu-latest
56+
needs: [test, clippy, cargo-fmt]
57+
if: github.ref == 'refs/heads/main'
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
token: ${{ secrets.RELEASE_PLZ_GITHUB_TOKEN }}
64+
- name: Install Rust toolchain
65+
uses: dtolnay/rust-toolchain@stable
66+
- name: Run release-plz
67+
uses: MarcoIeni/[email protected]
68+
env:
69+
# https://marcoieni.github.io/release-plz/github-action.html#triggering-further-workflow-runs
70+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_GITHUB_TOKEN }}
71+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)