-
Notifications
You must be signed in to change notification settings - Fork 18
149 lines (134 loc) · 4.98 KB
/
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Cargo Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
runs-on: ubuntu-latest
name: Build Linux
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libasound2-dev
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --verbose
- name: Prepare directory to upload as an artifact
run: |
mkdir zip
mkdir zip/offline-chess-puzzles
cp -R pieces zip/offline-chess-puzzles/
cp -R puzzles zip/offline-chess-puzzles/
cp -R translations zip/offline-chess-puzzles/
cp -R font zip/offline-chess-puzzles/
cp .env zip/offline-chess-puzzles/
cp ocp.db zip/offline-chess-puzzles/
cp *.ogg zip/offline-chess-puzzles/
cp settings.json zip/offline-chess-puzzles/
cp LICENSE zip/offline-chess-puzzles/
cp README.md zip/offline-chess-puzzles/
cp target/release/offline-chess-puzzles zip/offline-chess-puzzles/
- uses: actions/upload-artifact@v3
with:
name: linux-release-bin
path: zip/
build-mac:
runs-on: macos-latest
name: Build mac
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --verbose
- name: Prepare directory to upload as an artifact
run: |
mkdir zip
mkdir zip/offline-chess-puzzles
cp -R pieces zip/offline-chess-puzzles/
cp -R puzzles zip/offline-chess-puzzles/
cp -R translations zip/offline-chess-puzzles/
cp -R font zip/offline-chess-puzzles/
cp .env zip/offline-chess-puzzles/
cp ocp.db zip/offline-chess-puzzles/
cp *.ogg zip/offline-chess-puzzles/
cp settings.json zip/offline-chess-puzzles/
cp LICENSE zip/offline-chess-puzzles/
cp README.md zip/offline-chess-puzzles/
cp target/release/offline-chess-puzzles zip/offline-chess-puzzles/
- uses: actions/upload-artifact@v3
with:
name: macos-release-bin
path: zip/
build-windows-64:
runs-on: windows-latest
name: Build Windows 64-bit
steps:
- uses: actions/checkout@v3
- run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Enable static CRT linkage
run: |
mkdir .cargo
echo '[target.x86_64-pc-windows-msvc]' >> .cargo/config
echo 'rustflags = ["-Ctarget-feature=+crt-static"]' >> .cargo/config
- run: cargo build --release --verbose
- name: Prepare directory to upload as an artifact
run: |
mkdir zip
mkdir zip/offline-chess-puzzles
cp -R pieces zip/offline-chess-puzzles/
cp -R puzzles zip/offline-chess-puzzles/
cp -R translations zip/offline-chess-puzzles/
cp -R font zip/offline-chess-puzzles/
cp .env zip/offline-chess-puzzles/
cp ocp.db zip/offline-chess-puzzles/
cp *.ogg zip/offline-chess-puzzles/
cp settings.json zip/offline-chess-puzzles/
cp LICENSE zip/offline-chess-puzzles/
cp README.md zip/offline-chess-puzzles/
cp target/release/offline-chess-puzzles.exe zip/offline-chess-puzzles/
- uses: actions/upload-artifact@v3
with:
name: windows-release
path: zip/
build-windows-32:
runs-on: windows-latest
name: Build Windows 32-bit
steps:
- uses: actions/checkout@v3
- run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Enable static CRT linkage
run: |
mkdir .cargo
echo '[target.i686-pc-windows-msvc]' >> .cargo/config
echo 'rustflags = ["-Ctarget-feature=+crt-static"]' >> .cargo/config
- run: cargo build --release --target i686-pc-windows-msvc --verbose
- name: Prepare directory to upload as an artifact
run: |
mkdir zip
mkdir zip/offline-chess-puzzles
cp -R pieces zip/offline-chess-puzzles/
cp -R puzzles zip/offline-chess-puzzles/
cp -R translations zip/offline-chess-puzzles/
cp -R font zip/offline-chess-puzzles/
cp .env zip/offline-chess-puzzles/
cp ocp.db zip/offline-chess-puzzles/
cp *.ogg zip/offline-chess-puzzles/
cp settings.json zip/offline-chess-puzzles/
cp LICENSE zip/offline-chess-puzzles/
cp README.md zip/offline-chess-puzzles/
cp target/i686-pc-windows-msvc/release/offline-chess-puzzles.exe zip/offline-chess-puzzles/
- uses: actions/upload-artifact@v3
with:
name: windows-release-i686
path: zip/