-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (44 loc) · 1.32 KB
/
build-crate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Rust crate
on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- "**"
jobs:
build_crate:
name: Build crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Fmt
run: cargo fmt --all -- --files-with-diff --check
- name: Clippy
run: cargo clippy --workspace --all-features --all-targets
- name: Tests (debug)
run: cargo test --workspace --all-features
- name: Tests (release)
run: cargo test --workspace --all-features --release
- name: Build (release)
run: cargo build --workspace --all-features --release
- name: Install cargo-workspaces
run: cargo install cargo-workspaces --locked
- name: Publish (dry run)
run: cargo ws publish --publish-as-is --dry-run
- name: Upload crate artifacts
uses: actions/upload-artifact@v4
with:
name: crate
path: ./target/package/*-*.crate
- name: Publish (crates.io)
if: startsWith(github.event.ref, 'refs/tags')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
run: cargo ws publish --publish-as-is