-
Notifications
You must be signed in to change notification settings - Fork 6
250 lines (209 loc) · 7.24 KB
/
build_gui_artifacts.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: Build GUI Artifacts
on:
workflow_dispatch:
workflow_call:
jobs:
build_gui_linux:
name: Building GUI for Linux x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-
- name: Build Linux GUI binaries
run: cargo build --verbose -p xmodits-gui --release
- name: Create ./bin directory
run: mkdir -p bin
- name: Tarball Linux GUI binary
run: |
tar -czf bin/xmodits-gui-linux-x86_64.tar.gz -C target/release/ xmodits-gui
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-linux-x86_64
path: |
bin/xmodits-gui-linux-x86_64.*
build_gui_linux-cross:
name: Building GUI for ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- linux-aarch64-gnu
- linux-armv7-gnu
include:
- target: linux-aarch64-gnu
arch: aarch64-unknown-linux-gnu
- target: linux-armv7-gnu
arch: armv7-unknown-linux-gnueabihf
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-
- name: Install cross
run: cargo install cross
- name: Build Linux GUI binaries
run: cross build -p xmodits-gui --release --target ${{ matrix.arch }}
- name: Create ./bin directory
run: mkdir -p bin
- name: Tarball Linux GUI binary
run: |
tar -czf bin/xmodits-gui-${{ matrix.target }}.tar.gz -C target/${{matrix.arch}}/release/ xmodits-gui
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target }}.*
build_gui_windows:
name: Building GUI for ${{ matrix.target }}
runs-on: windows-latest
strategy:
matrix:
target:
- windows-64-bit
# - windows-32-bit # disabled due to winit bug
include:
- target: windows-64-bit
arch: x86_64-pc-windows-msvc
# - target: windows-32-bit
# arch: i686-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.arch }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-
- name: Install Windows 32 bit target
if: matrix.arch == 'i686-pc-windows-msvc'
run: | # Install 32-bit target and make it the default
rustup target add i686-pc-windows-msvc && rustup default stable-i686-pc-windows-msvc
- name: Build Windows GUI binary
run: cargo build -p xmodits-gui --release
- name: Create ./bin directory
run: mkdir -p bin
- name: Zip Windows GUI binary
run: | # On Windows, remove gui suffix
rm target/release/*xmodits.exe
mv target/release/xmodits-gui.exe target/release/xmodits.exe
Compress-Archive target/release/xmodits.exe bin/xmodits-gui-${{ matrix.target }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target}}.*
build_gui_macos:
name: Building GUI for ${{ matrix.target }}
runs-on: macOS-latest
strategy:
matrix:
target:
- macos-intel
# - macos-apple-slicon # TODO: make this a separate task?
include:
- target: macos-intel
arch: x86_64-apple-darwin
# - target: macos-apple-silicon
# arch: aarch64-apple-darwin
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.arch }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-
- name: Build macOS GUI binary
run: cargo build -p xmodits-gui --release
- name: Create ./bin directory
run: mkdir -p bin
- name: Zip macOS GUI binary
run: |
mv target/release/xmodits-gui target/release/xmodits
chmod +x target/release/xmodits
zip -j ./bin/xmodits-gui-${{ matrix.target }}.zip target/release/xmodits
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target }}.*
# build:
# name: Building ${{ matrix.build_target }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# build_target: [linux, windows]
# include:
# - build_target: linux
# os: ubuntu-latest
# - build_target: windows
# os: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target
# key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.OS }}-release-
# - name: Building GUI
# run: cargo build -p xmodits-gui --release
# - name: Create ./bin directory
# run: mkdir -p bin
# - name: Tarball Linux GUI binary
# if: matrix.os != 'windows-latest'
# run: |
# tar -czf bin/xmodits-gui-${{ matrix.build_target }}.tar.gz -C target/release/ xmodits-gui
# - name: Zip Windows GUI binary
# if: matrix.os == 'windows-latest'
# run: | # On Windows, remove gui suffix
# rm target/release/*xmodits.exe
# mv target/release/xmodits-gui.exe target/release/xmodits.exe
# Compress-Archive target/release/xmodits.exe bin/xmodits-gui-${{ matrix.build_target }}.zip
# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: xmodits-gui-${{ matrix.build_target }}
# path: |
# bin/xmodits-gui-${{ matrix.build_target }}.*