-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (69 loc) · 1.92 KB
/
tools.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Tools
on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "generator/**"
- ".github/workflows/tools.yml"
pull_request:
branches:
- master
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "generator/**"
- ".github/workflows/tools.yml"
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
jobs:
hygiene:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Setup | Protoc
run: sudo apt-get install -y protobuf-compiler
- name: Setup | Cache
uses: Swatinem/rust-cache@v2
- name: Build | Hygiene
run: |
cargo fmt -- --check
cargo clippy --all-features --locked -- -D clippy::all
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/lw-generator')
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup | Protoc
run: sudo apt-get install -y protobuf-compiler
- name: Setup | Cache
uses: Swatinem/rust-cache@v2
- name: Build | Release
run: |
cargo build --all --release --locked
- name: Release | Prepare
run: |
tar -zcv -C target/release -f linux.x64.tar.gz lw-generator
sha256sum -b --tag linux.x64.tar.gz > linux.x64.checksum
- name: Release | Artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_unmatched_files: true
name: ${{github.ref_name}}
files: |
linux.x64.tar.gz
linux.x64.checksum