-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (56 loc) · 1.38 KB
/
build.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
57
58
59
60
61
62
name: GitHub CI
on:
push:
paths:
- ".github/workflows/build.yml"
- "Cargo.toml"
- "src/**"
- "!**/*.md"
branches:
- main
pull_request:
paths:
- "Cargo.toml"
- "src/**"
- "!**/*.md"
branches:
- main
release:
types: [released]
jobs:
build-rust:
name: Build
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install Rust
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Rust info
shell: bash
run: |
rustup update
rustc --version
cargo --version
- name: Check
shell: bash
run: |
echo "==== FORMAT CHECK ===="
cargo fmt -- --color always --check
echo "==== BUILD RELEASE ===="
cargo build --color always --release
- name: Upload to crates.io
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
git reset .
git checkout .
git clean -xdf
cargo login --color always -- "${{secrets.CRATES_IO_TOKEN}}"
# --no-verify: we've tested building everything already
cargo publish --color always --no-verify