-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (85 loc) · 2.39 KB
/
build-release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Build and Release
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: cargo test --verbose
lint:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
build:
name: Build
needs: [test, lint]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Build (default features)
run: cargo build --release
- name: Rename and copy artifacts
run: |
move target\release\mbss.exe mbss-strip.exe
shell: cmd
- name: Build (no default features)
run: cargo build --release --no-default-features
- name: Rename and copy artifacts
run: |
move target\release\mbss.exe mbss-nostrip.exe
shell: cmd
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mbss-executables
path: |
mbss-strip.exe
mbss-nostrip.exe
update-latest:
name: Update Latest Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: mbss-executables
- name: Update Latest Release
uses: softprops/action-gh-release@v1
with:
tag_name: latest
name: Latest Release
draft: false
prerelease: false
files: |
mbss-strip.exe
mbss-nostrip.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}