forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 13
425 lines (413 loc) · 17.9 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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
name: CI
env:
LLVM_VERSION: 18
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
llvm_version:
description: "LLVM version"
default: "18"
jobs:
macos:
name: macOS
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
matrix:
include:
- runner: macos-13-large
cpp_flags: "-D_LIBCXX_ENABLE_ASSERTIONS=1"
cpu: haswell
label: bun-webkit-macos-amd64-debug
brew_prefix: /usr/local/opt
package_json_arch: "x64"
CMAKE_BUILD_TYPE: Debug
- runner: macos-13-xlarge
cpp_flags: "-D_LIBCXX_ENABLE_ASSERTIONS=1"
cpu: native
label: bun-webkit-macos-arm64-debug
brew_prefix: /opt/homebrew/opt
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: Debug
# We aren't doing LTO on macOS, for now.
# - runner: macos-13-large
# cpp_flags: -flto=full -fwhole-program-vtables -fforce-emit-vtables -D_LIBCXX_ENABLE_ASSERTIONS=0
# cpu: haswell
# label: bun-webkit-macos-amd64-lto
# brew_prefix: /usr/local/opt
# package_json_arch: "x64"
# CMAKE_BUILD_TYPE: Release
- runner: macos-13-large
cpp_flags: ""
cpu: haswell
label: bun-webkit-macos-amd64
brew_prefix: /usr/local/opt
package_json_arch: "x64"
CMAKE_BUILD_TYPE: Release
# We aren't doing LTO on macOS, for now.
# - runner: macos-13-xlarge
# cpp_flags: -flto=full -fwhole-program-vtables -fforce-emit-vtables -D_LIBCXX_ENABLE_ASSERTIONS=0
# cpu: native
# label: bun-webkit-macos-arm64-lto
# brew_prefix: /opt/homebrew/opt
# package_json_arch: "arm64"
# CMAKE_BUILD_TYPE: Release
- runner: macos-13-xlarge
cpp_flags: "-D_LIBCXX_ENABLE_ASSERTIONS=0"
cpu: native
label: bun-webkit-macos-arm64
brew_prefix: /opt/homebrew/opt
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: Release
steps:
- name: "Set LLVM version"
if: github.event == 'workflow_dispatch'
run: echo "LLVM_VERSION=${{inputs.llvm_version}}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!LayoutTests/
!JSTests/
- name: PATH
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
run: |
echo "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin" >> $GITHUB_PATH
brew install llvm@${{env.LLVM_VERSION}} python icu4c ninja -f --overwrite
brew link llvm@${{env.LLVM_VERSION}} -f --overwrite
- name: Run
env:
ICU_INCLUDE_DIRS: ${{matrix.brew_prefix}}/icu4c/include
LDFLAGS: "${{env.LDFLAGS}} "
CC: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang"
CXX: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang++"
RANLIB: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/llvm-ranlib"
AR: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/llvm-ar"
CMAKE_C_COMPILER: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang"
CMAKE_CXX_COMPILER: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang++"
CMAKE_C_FLAGS: " -fno-exceptions ${{matrix.cpp_flags}} -fvisibility=hidden -fvisibility-inlines-hidden -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -faddrsig "
CMAKE_CXX_FLAGS: " -fno-exceptions ${{matrix.cpp_flags}} -fvisibility=hidden -fvisibility-inlines-hidden -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -faddrsig -fno-c++-static-destructors "
CMAKE_OSX_DEPLOYMENT_TARGET: "13.0"
CMAKE_BUILD_TYPE: ${{matrix.CMAKE_BUILD_TYPE}}
PACKAGE_JSON_ARCH: ${{matrix.package_json_arch}}
PACKAGE_JSON_LABEL: ${{matrix.label}}
run: GITHUB_REPOSITORY=$GITHUB_REPOSITORY bash mac-release.bash
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.label}}
path: ${{runner.temp}}/bun-webkit.tar.gz
linux:
name: Linux
runs-on: ${{matrix.os}}
strategy:
matrix:
include:
- lto_flag: ""
label: bun-webkit-linux-amd64-debug
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Debug"
- lto_flag: ""
label: bun-webkit-linux-arm64-debug
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Debug"
- lto_flag: "-flto=full -fwhole-program-vtables -fforce-emit-vtables"
label: bun-webkit-linux-arm64-lto
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: ""
label: bun-webkit-linux-arm64
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: "-flto=full -fwhole-program-vtables -fforce-emit-vtables"
label: bun-webkit-linux-amd64-lto
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: ""
label: bun-webkit-linux-amd64
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Release"
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!LayoutTests/
!JSTests/
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/bun-webkit ${{runner.temp}}/bun-webkit.tar.gz
WEBKIT_RELEASE_TYPE=${{matrix.CMAKE_BUILD_TYPE}} CPU="native" cpu=native LTO_FLAG="${{matrix.lto_flag}}" temp=${{runner.temp}} bash release.sh
cd ${{runner.temp}}
echo "#define BUN_WEBKIT_VERSION \"${{github.sha}}\"" >> bun-webkit/include/cmakeconfig.h
echo '{ "name": "${{matrix.label}}", "version": "0.0.1-${{github.sha}}", "os": ["linux"], "cpu": ["${{matrix.package_json_arch}}"], "repository": "https://github.com/${{github.repository}}" }' > bun-webkit/package.json
rm -rf bun-webkit/lib/*.so
rm -rf bun-webkit/lib/*.so.*
tar -czf bun-webkit.tar.gz bun-webkit
rm -rf bun-webkit
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.label}}
path: ${{runner.temp}}/bun-webkit.tar.gz
windows:
strategy:
matrix:
include:
- runner: windows
build-type: Release
package_json_arch: "x64"
label: bun-webkit-windows-amd64
- runner: windows
build-type: Debug
package_json_arch: "x64"
label: bun-webkit-windows-amd64-debug
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
steps:
- name: Install Scoop
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
- name: Install LLVM and Ninja
run: |
scoop install ninja
scoop install llvm@18.1.8
Join-Path (Resolve-Path ~).Path "scoop\apps\llvm\current\bin" >> $Env:GITHUB_PATH
- uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!LayoutTests/
!JSTests/
- name: Build WebKit
run: |
$env:Path = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\;" + $env:Path
$env:WEBKIT_OUTPUT_DIR = "bun-webkit"
$env:BUN_WEBKIT_VERSION = "${{ github.sha }}"
$env:CMAKE_BUILD_TYPE = "${{matrix.build-type}}"
$env:PACKAGE_JSON_LABEL = "${{matrix.label}}"
$env:GITHUB_SHA = "${{ github.sha }}"
$env:PACKAGE_JSON_ARCH = "${{matrix.package_json_arch}}"
$env:GITHUB_REPOSITORY = "${{ github.repository }}"
./windows-release.ps1
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.label}}
path: bun-webkit.tar.gz
linux-musl:
name: Linux
runs-on: ${{matrix.os}}
strategy:
matrix:
include:
- lto_flag: ""
label: bun-webkit-linux-amd64-musl-debug
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Debug"
- lto_flag: ""
label: bun-webkit-linux-arm64-musl-debug
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Debug"
- lto_flag: "-flto=full -fwhole-program-vtables -fforce-emit-vtables"
label: bun-webkit-linux-arm64-musl-lto
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: ""
label: bun-webkit-linux-arm64-musl
os: linux-arm64-gh
package_json_arch: "arm64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: "-flto=full -fwhole-program-vtables -fforce-emit-vtables"
label: bun-webkit-linux-amd64-musl-lto
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Release"
- lto_flag: ""
label: bun-webkit-linux-amd64-musl
os: big-ubuntu
package_json_arch: "x64"
CMAKE_BUILD_TYPE: "Release"
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
/*
!LayoutTests/
!JSTests/
- uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/bun-webkit ${{runner.temp}}/bun-webkit.tar.gz
WEBKIT_RELEASE_TYPE=${{matrix.CMAKE_BUILD_TYPE}} CPU="native" cpu=native LTO_FLAG="${{matrix.lto_flag}}" temp=${{runner.temp}} bash musl-release.sh
cd ${{runner.temp}}
echo "#define BUN_WEBKIT_VERSION \"${{github.sha}}\"" >> bun-webkit/include/cmakeconfig.h
echo '{ "name": "${{matrix.label}}", "version": "0.0.1-${{github.sha}}", "os": ["linux"], "cpu": ["${{matrix.package_json_arch}}"], "repository": "https://github.com/${{github.repository}}" }' > bun-webkit/package.json
rm -rf bun-webkit/lib/*.so
rm -rf bun-webkit/lib/*.so.*
tar -czf bun-webkit.tar.gz bun-webkit
rm -rf bun-webkit
- uses: actions/upload-artifact@v3
with:
name: ${{matrix.label}}
path: ${{runner.temp}}/bun-webkit.tar.gz
release:
name: release
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 90
if: github.ref == 'refs/heads/main'
needs:
- linux
- macos
- windows
- linux-musl
steps:
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64
path: ${{runner.temp}}/bun-webkit-linux-amd64
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64
path: ${{runner.temp}}/bun-webkit-linux-arm64
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64-debug
path: ${{runner.temp}}/bun-webkit-linux-amd64-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64-debug
path: ${{runner.temp}}/bun-webkit-linux-arm64-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-macos-arm64
path: ${{runner.temp}}/bun-webkit-macos-arm64
- uses: actions/download-artifact@v3
with:
name: bun-webkit-macos-arm64-debug
path: ${{runner.temp}}/bun-webkit-macos-arm64-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-macos-amd64-debug
path: ${{runner.temp}}/bun-webkit-macos-amd64-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-macos-amd64
path: ${{runner.temp}}/bun-webkit-macos-amd64
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64-lto
path: ${{runner.temp}}/bun-webkit-linux-amd64-lto
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64-lto
path: ${{runner.temp}}/bun-webkit-linux-arm64-lto
- uses: actions/download-artifact@v3
with:
name: bun-webkit-windows-amd64
path: ${{runner.temp}}/bun-webkit-windows-amd64
- uses: actions/download-artifact@v3
with:
name: bun-webkit-windows-amd64-debug
path: ${{runner.temp}}/bun-webkit-windows-amd64-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64-musl
path: ${{runner.temp}}/bun-webkit-linux-amd64-musl
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64-musl
path: ${{runner.temp}}/bun-webkit-linux-arm64-musl
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64-musl-debug
path: ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64-musl-debug
path: ${{runner.temp}}/bun-webkit-linux-arm64-musl-debug
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-amd64-musl-lto
path: ${{runner.temp}}/bun-webkit-linux-amd64-musl-lto
- uses: actions/download-artifact@v3
with:
name: bun-webkit-linux-arm64-musl-lto
path: ${{runner.temp}}/bun-webkit-linux-arm64-musl-lto
- name: Rename files
run: |
mv ${{runner.temp}}/bun-webkit-linux-amd64/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-musl/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64-musl.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-musl/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64-musl.tar.gz
mv ${{runner.temp}}/bun-webkit-macos-arm64/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-macos-arm64.tar.gz
mv ${{runner.temp}}/bun-webkit-macos-amd64/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-macos-amd64.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64-musl-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-musl-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64-musl-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-macos-arm64-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-macos-arm64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-macos-amd64-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-macos-amd64-debug.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-lto/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64-lto.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-lto/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64-lto.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-amd64-musl-lto/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-amd64-musl-lto.tar.gz
mv ${{runner.temp}}/bun-webkit-linux-arm64-musl-lto/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-linux-arm64-musl-lto.tar.gz
mv ${{runner.temp}}/bun-webkit-windows-amd64/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-windows-amd64.tar.gz
mv ${{runner.temp}}/bun-webkit-windows-amd64-debug/bun-webkit.tar.gz ${{runner.temp}}/bun-webkit-windows-amd64-debug.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
id: release
with:
generate_release_notes: true
tag_name: "autobuild-${{github.sha}}"
files: |
${{runner.temp}}/bun-webkit-linux-amd64-debug.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64-debug.tar.gz
${{runner.temp}}/bun-webkit-linux-amd64-musl-debug.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64-musl-debug.tar.gz
${{runner.temp}}/bun-webkit-macos-arm64-debug.tar.gz
${{runner.temp}}/bun-webkit-macos-amd64-debug.tar.gz
${{runner.temp}}/bun-webkit-linux-amd64.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64.tar.gz
${{runner.temp}}/bun-webkit-linux-amd64-musl.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64-musl.tar.gz
${{runner.temp}}/bun-webkit-macos-arm64.tar.gz
${{runner.temp}}/bun-webkit-macos-amd64.tar.gz
${{runner.temp}}/bun-webkit-linux-amd64-lto.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64-lto.tar.gz
${{runner.temp}}/bun-webkit-linux-amd64-musl-lto.tar.gz
${{runner.temp}}/bun-webkit-linux-arm64-musl-lto.tar.gz
${{runner.temp}}/bun-webkit-windows-amd64.tar.gz
${{runner.temp}}/bun-webkit-windows-amd64-debug.tar.gz