-
-
Notifications
You must be signed in to change notification settings - Fork 7
167 lines (159 loc) · 4.95 KB
/
main.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build_fmt_clippy:
name: Fmt & Clippy Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust (rustup)
run: |
rustup update stable --no-self-update
rustup default stable
rustup component add rustfmt
rustup component add clippy
- name: Build
run: cargo build --verbose
- name: Format Check
run: |
cargo fmt --version
cargo fmt -- --check --verbose
- name: Clippy Check
run: |
cargo clippy
cargo clippy --version
cargo clippy -- --verbose -D warnings
build_ubuntu:
name: Ubuntu Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust (rustup)
run: |
rustup update stable --no-self-update
rustup default stable
- name: Test
run: cargo test --verbose
- name: Build Release
run: cargo build --release --verbose
- name: Move Artifacts
run: |
ls target/release
cp target/release/rustyhack_client rustyhack-client
ls target/release
cp target/release/rustyhack_server rustyhack-server
chmod +x rustyhack-client
chmod +x rustyhack-server
tar -cvzf rustyhack-client-ubuntu.tar.gz rustyhack-client
tar -cvzf rustyhack-server-ubuntu.tar.gz rustyhack-server assets
- name: Upload Artifact Client
uses: actions/upload-artifact@v3
with:
name: rustyhack-client-ubuntu
path: rustyhack-client-ubuntu.tar.gz
- name: Upload Artifact Server
uses: actions/upload-artifact@v3
with:
name: rustyhack-server-ubuntu
path: rustyhack-server-ubuntu.tar.gz
build_macos:
name: Mac Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust (rustup)
run: |
rustup update stable --no-self-update
rustup default stable
- name: Test
run: cargo test --verbose
- name: Build Release
run: cargo build --release --verbose
- name: Move Artifacts
run: |
cp target/release/rustyhack_client rustyhack-client
cp target/release/rustyhack_server rustyhack-server
chmod +x rustyhack-client
chmod +x rustyhack-server
tar -cvzf rustyhack-client-macos.tar.gz rustyhack-client
tar -cvzf rustyhack-server-macos.tar.gz rustyhack-server assets
- name: Upload Artifact Client
uses: actions/upload-artifact@v3
with:
name: rustyhack-client-macos
path: rustyhack-client-macos.tar.gz
- name: Upload Artifact Server
uses: actions/upload-artifact@v3
with:
name: rustyhack-server-macos
path: rustyhack-server-macos.tar.gz
build_win32:
name: Win32 Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust (rustup)
run: |
rustup update stable-i686 --no-self-update
rustup default stable-i686
- name: Test
run: cargo test --verbose
- name: Build Release
run: cargo build --release --verbose
- name: Move Artifacts
run: |
copy target\release\rustyhack_client.exe rustyhack-client.exe
copy target\release\rustyhack_server.exe rustyhack-server.exe
- name: Upload Artifact Client (win32)
uses: actions/upload-artifact@v3
with:
name: rustyhack-client-win32
path: rustyhack-client.exe
- name: Upload Artifact Server (win32)
uses: actions/upload-artifact@v3
with:
name: rustyhack-server-win32
path: |
rustyhack-server.exe
assets\**\*
build_win64:
name: Win64 Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust (rustup)
run: |
rustup update stable-x86_64 --no-self-update
rustup default stable-x86_64
- name: Test
run: cargo test --verbose
- name: Build Release
run: cargo build --release --verbose
- name: Move Artifacts
run: |
copy target\release\rustyhack_client.exe rustyhack-client.exe
copy target\release\rustyhack_server.exe rustyhack-server.exe
- name: Upload Artifact Client (win64)
uses: actions/upload-artifact@v3
with:
name: rustyhack-client-win64
path: rustyhack-client.exe
- name: Upload Artifact Server (win64)
uses: actions/upload-artifact@v3
with:
name: rustyhack-server-win64
path: |
rustyhack-server.exe
assets\**\*
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}