-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (110 loc) · 2.9 KB
/
cargo-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
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
name: Build and Upload
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
name: clippy (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Restore cargo cache
uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('Cargo.lock') }}
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --no-deps
check:
name: check (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Restore cargo cache
uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('Cargo.lock') }}
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --release
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
rust:
- stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Restore cargo cache
uses: actions/[email protected]
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- if: matrix.os != 'windows-latest'
name: Strip
run: strip target/release/dexios
- if: matrix.os == 'ubuntu-latest'
name: Hash the Binary
run: sha256sum target/release/dexios
- if: matrix.os == 'ubuntu-latest'
name: Upload Binary as artifact
uses: actions/upload-artifact@v3
with:
name: dexios-linux-amd64
path: target/release/dexios
- if: matrix.os == 'macos-latest'
name: Upload Binary as artifact
uses: actions/upload-artifact@v3
with:
name: dexios-macos-amd64
path: target/release/dexios
- if: matrix.os == 'windows-latest'
name: Upload Binary as artifact
uses: actions/upload-artifact@v3
with:
name: dexios-windows-amd64
path: target/release/dexios.exe