-
Notifications
You must be signed in to change notification settings - Fork 5
355 lines (306 loc) · 13.3 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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
name: Build
on:
pull_request:
branches: [master, main]
push:
branches: [master, main]
tags: ["*"]
workflow_dispatch:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
linux_nix:
uses: SpiralP/github-reusable-workflows/.github/workflows/build.yml@main
windows_x86:
name: Build Windows ${{ matrix.config.arch }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config:
- arch: x86_64
target: x86_64-pc-windows-msvc
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_windows64.tar.bz2
- arch: i686
target: i686-pc-windows-msvc
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_windows32.tar.bz2
steps:
- uses: actions/checkout@v4
- name: Fetch cef_binary
run: |
aria2c '${{ matrix.config.url }}' -o cef_binary.tar.bz2 --max-connection-per-server=4
7z x -y 'cef_binary.tar.bz2'
Remove-Item 'cef_binary.tar.bz2'
7z x -y 'cef_binary.tar'
Remove-Item 'cef_binary.tar'
Get-ChildItem cef_binary_* | Rename-Item -NewName 'cef_binary'
Move-Item -Path 'cef_binary' -Destination 'cef_interface'
- name: setup-msbuild
uses: microsoft/setup-msbuild@v2
- name: Install rust
run: |
rustup default stable
rustup component add rustfmt
rustup target add ${{ matrix.config.target }}
- name: Build
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo build --target ${{ matrix.config.target }}
- name: Test
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo test --target ${{ matrix.config.target }} -- --nocapture --test-threads 1
- name: Build Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cargo build --target ${{ matrix.config.target }} --release
- name: Rename files
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
Move-Item `
-Path 'target\${{ matrix.config.target }}\release\classicube_cef_plugin.dll' `
-Destination '.\classicube_cef_windows_${{ matrix.config.arch }}.dll'
Move-Item `
-Path 'target\${{ matrix.config.target }}\release\classicube_cef_plugin.pdb' `
-Destination 'classicube_cef_windows_${{ matrix.config.arch }}.pdb'
Move-Item `
-Path 'target\${{ matrix.config.target }}\release\cef.exe' `
-Destination '.\cef-windows-${{ matrix.config.arch }}.exe'
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v4
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: virustotal
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
files: |
classicube_cef_windows_${{ matrix.config.arch }}.dll
cef-windows-${{ matrix.config.arch }}.exe
- name: Generate Release Body Text
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.config.arch == 'x86_64' }}
run: |
node .github\format-release.js '${{ steps.virustotal.outputs.analysis }}' > release_body_text.txt
- name: Upload Release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.config.arch == 'x86_64' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: release_body_text.txt
files: |
classicube_cef_windows_${{ matrix.config.arch }}.dll
classicube_cef_windows_${{ matrix.config.arch }}.pdb
cef-windows-${{ matrix.config.arch }}.exe
- name: Upload Release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.config.arch != 'x86_64' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
classicube_cef_windows_${{ matrix.config.arch }}.dll
classicube_cef_windows_${{ matrix.config.arch }}.pdb
cef-windows-${{ matrix.config.arch }}.exe
linux_x86:
name: Build Linux ${{ matrix.config.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- arch: x86_64
target: x86_64-unknown-linux-gnu
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_linux64.tar.bz2
- arch: i686
target: i686-unknown-linux-gnu
# Linux x86 32-bit builds are discontinued after version 101 (details)
# https://cef-builds.spotifycdn.com/index.html#linux32
url: https://cef-builds.spotifycdn.com/cef_binary_101.0.18%2Bg367b4a0%2Bchromium-101.0.4951.67_linux32.tar.bz2
steps:
- uses: actions/checkout@v4
- name: Install x86_64 deps
if: ${{ matrix.config.arch == 'x86_64' }}
run: |
sudo apt-get -y update
sudo apt-get -y install aria2 rustup git gcc g++ build-essential cmake clang pkg-config \
libssl-dev \
libssl3t64 libglib2.0-0t64 libnss3 libnspr4 libdbus-1-3 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 libdrm2 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libpango-1.0-0 libcairo2 libasound2t64 libatspi2.0-0t64
- name: Install i686 deps
if: ${{ matrix.config.arch == 'i686' }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install aria2 rustup git gcc g++ build-essential cmake clang pkg-config:i386 \
gcc-multilib g++-multilib \
libssl-dev:i386 \
libssl3t64:i386 libglib2.0-0t64:i386 libnss3:i386 libnspr4:i386 libdbus-1-3:i386 libatk1.0-0t64:i386 libatk-bridge2.0-0t64:i386 libcups2t64:i386 libdrm2:i386 libxcomposite1:i386 libxdamage1:i386 libxfixes3:i386 libxrandr2:i386 libgbm1:i386 libxkbcommon0:i386 libpango-1.0-0:i386 libcairo2:i386 libasound2t64:i386 libatspi2.0-0t64:i386
echo "PKG_CONFIG_ALLOW_CROSS=1" >> "$GITHUB_ENV"
- name: Fetch cef_binary
run: |
aria2c '${{ matrix.config.url }}' -o cef_binary.tar.bz2 --max-connection-per-server=4
tar -xjf cef_binary.tar.bz2
rm cef_binary.tar.bz2
mv cef_binary_* cef_interface/cef_binary
- name: Install rust
run: |
rustup default stable
rustup component add rustfmt
rustup target add ${{ matrix.config.target }}
- name: Build
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo build --target ${{ matrix.config.target }}
file 'target/${{ matrix.config.target }}/debug/libclassicube_cef_plugin.so'
file 'target/${{ matrix.config.target }}/debug/cef'
- name: Test
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo test --target ${{ matrix.config.target }} -- --nocapture --test-threads 1
- name: Build Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cargo build --target ${{ matrix.config.target }} --release
file 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.so'
file 'target/${{ matrix.config.target }}/release/cef'
- name: Rename files
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
mv 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.so' \
'./classicube_cef_linux_${{ matrix.config.arch }}.so'
mv 'target/${{ matrix.config.target }}/release/cef' \
'./cef-linux-${{ matrix.config.arch }}' \
- name: Upload Release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
classicube_cef_linux_${{ matrix.config.arch }}.so
cef-linux-${{ matrix.config.arch }}
linux_arm:
name: Build Linux ${{ matrix.config.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- arch: armhf
target: armv7-unknown-linux-gnueabihf
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_linuxarm.tar.bz2
- arch: aarch64
target: aarch64-unknown-linux-gnu
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_linuxarm64.tar.bz2
steps:
- uses: actions/checkout@v4
- name: Install armhf deps
if: ${{ matrix.config.arch == 'armhf' }}
run: |
docker build --pull -t cross-armhf -f .github/cross-armhf.Dockerfile .
- name: Install aarch64 deps
if: ${{ matrix.config.arch == 'aarch64' }}
run: |
docker build --pull -t cross-aarch64 -f .github/cross-aarch64.Dockerfile .
- name: Fetch cef_binary
run: |
aria2c '${{ matrix.config.url }}' -o cef_binary.tar.bz2 --max-connection-per-server=4
tar -xjf cef_binary.tar.bz2
rm cef_binary.tar.bz2
mv cef_binary_* cef_interface/cef_binary
- name: Install rust
run: |
rustup default stable
rustup component add rustfmt
rustup target add ${{ matrix.config.target }}
- name: Install cross
run: |
cargo install cross
- name: Build
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cross build --target ${{ matrix.config.target }}
file 'target/${{ matrix.config.target }}/debug/libclassicube_cef_plugin.so'
file 'target/${{ matrix.config.target }}/debug/cef'
- name: Test
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cross test --target ${{ matrix.config.target }} -- --nocapture --test-threads 1
- name: Build Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cross build --target ${{ matrix.config.target }} --release
file 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.so'
file 'target/${{ matrix.config.target }}/release/cef'
- name: Rename files
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
mv 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.so' \
'./classicube_cef_linux_${{ matrix.config.arch }}.so'
mv 'target/${{ matrix.config.target }}/release/cef' \
'./cef-linux-${{ matrix.config.arch }}'
- name: Upload Release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
classicube_cef_linux_${{ matrix.config.arch }}.so
cef-linux-${{ matrix.config.arch }}
mac_x86:
name: Build MacOS ${{ matrix.config.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
config:
- arch: x86_64
target: x86_64-apple-darwin
url: https://cef-builds.spotifycdn.com/cef_binary_129.0.12%2Bgf09539f%2Bchromium-129.0.6668.101_macosx64.tar.bz2
steps:
- uses: actions/checkout@v4
- name: Fetch cef_binary
run: |
aria2c '${{ matrix.config.url }}' -o cef_binary.tar.bz2 --max-connection-per-server=4
tar -xjf cef_binary.tar.bz2
rm cef_binary.tar.bz2
mv cef_binary_* cef_interface/cef_binary
- name: Install rust
run: |
rustup default stable
rustup component add rustfmt
rustup target add ${{ matrix.config.target }}
- name: Build
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo build --target ${{ matrix.config.target }}
file 'target/${{ matrix.config.target }}/debug/libclassicube_cef_plugin.dylib'
file 'target/${{ matrix.config.target }}/debug/cef'
- name: Test
if: ${{ startsWith(github.ref, 'refs/tags/') != true }}
run: |
cargo test --target ${{ matrix.config.target }} -- --nocapture --test-threads 1
- name: Build Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
cargo build --target ${{ matrix.config.target }} --release
file 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.dylib'
file 'target/${{ matrix.config.target }}/release/cef'
- name: Rename files
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
mv 'target/${{ matrix.config.target }}/release/libclassicube_cef_plugin.dylib' \
'./classicube_cef_macos_${{ matrix.config.arch }}.dylib'
mv 'target/${{ matrix.config.target }}/release/cef' \
'./cef-macos-${{ matrix.config.arch }}'
- name: Upload Release
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
classicube_cef_macos_${{ matrix.config.arch }}.dylib
cef-macos-${{ matrix.config.arch }}