-
Notifications
You must be signed in to change notification settings - Fork 26
60 lines (57 loc) · 1.84 KB
/
rust.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
name: Rust
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release --verbose
- run: mkdir artifact
- run: cp target/release/rpcn artifact/rpcn
- run: cp rpcn.cfg artifact/rpcn.cfg
- run: cp servers.cfg artifact/servers.cfg
- run: cp server_redirs.cfg artifact/server_redirs.cfg
- run: cp scoreboards.cfg artifact/scoreboards.cfg
- name: Create artifact
run: cd artifact && tar -zcvf ../rpcn-linux.tar.gz ./ && cd ..
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: rpcn
path: rpcn-linux.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: rpcn-linux.tar.gz
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release --verbose
- run: mkdir artifact-win
- run: copy target/release/rpcn.exe artifact-win/rpcn.exe
- run: copy rpcn.cfg artifact-win/rpcn.cfg
- run: copy servers.cfg artifact-win/servers.cfg
- run: copy server_redirs.cfg artifact-win/server_redirs.cfg
- run: copy scoreboards.cfg artifact-win/scoreboards.cfg
- name: Create artifact
run: Compress-Archive -Path artifact-win/* -Destination rpcn-win.zip
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: rpcn-win
path: rpcn-win.zip
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: rpcn-win.zip