-
-
Notifications
You must be signed in to change notification settings - Fork 70
307 lines (255 loc) · 8.44 KB
/
windows_x86_64_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
name: Windows x86_64 Build
concurrency:
group: windows_x86_64_build_${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
env:
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: D:\a\Javet
jobs:
build_javet_v8:
strategy:
matrix:
include:
- name: i18n
cmake_flag: -DENABLE_I18N=1
v8_flag: v8_enable_i18n_support=true
- name: non-i18n
cmake_flag:
v8_flag: v8_enable_i18n_support=false
name: Build Javet V8 ${{ matrix.name }}
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Path
run: |
echo "${{ env.ROOT }}\google\depot_tools" >> $GITHUB_PATH
- name: Build V8
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
run: |
cd ${{ env.ROOT }}
mkdir google
cd google
git clone --depth=10 --branch=main https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
git checkout remotes/origin/main
cd ..
.\depot_tools\fetch.bat v8
cd v8
git checkout ${{ env.JAVET_V8_VERSION }}
cd ..
.\depot_tools\gclient.bat sync -D
cd v8
python3 tools\dev\v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false ${{ matrix.v8_flag }} v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
..\depot_tools\gn.bat gen out.gn/x64.release
python3 ${{ env.ROOT }}\Javet\scripts\python\patch_v8_build.py -p .\
..\depot_tools\ninja.bat -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}\Javet\scripts\python\patch_v8_build.py -p .\
..\depot_tools\ninja.bat -C out.gn/x64.release v8_monolith
move out.gn out.gn.${{ matrix.name }}
- name: Copy the i18n
if: matrix.name == 'i18n'
run: |
mkdir icu-v8
copy ..\google\v8\third_party\icu\common\*.dat icu-v8
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 8
- name: Setup Cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.23.x'
- name: Patch V8
shell: bash
run: |
cd ../google/v8
sed -i '/static_assert(alignof(Type) <= alignof(decltype(/d' src/objects/tagged-field.h
- name: Build Javet JNI
run: |
cd ${{ env.ROOT }}\Javet\cpp
.\build-windows.cmd -DV8_DIR=${{ env.ROOT }}\google\v8 ${{ matrix.cmake_flag }}
- name: Upload the Artifact
uses: actions/upload-artifact@v4
with:
name: javet-windows-v8-x86_64-${{ env.JAVET_VERSION }}-${{ matrix.name }}
path: src\main\resources\*.dll
- name: Upload the i18n
uses: actions/upload-artifact@v4
if: matrix.name == 'i18n'
with:
name: icu-v8
path: icu-v8\*.dat
build_javet_node:
strategy:
matrix:
include:
- name: i18n
cmake_flag: -DENABLE_I18N=1
node_flag: full-icu
- name: non-i18n
cmake_flag:
node_flag: without-intl
name: Build Javet Node ${{ matrix.name }}
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout the code
uses: actions/checkout@v4
- name: Install NASM
run: choco install nasm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build Node.js
run: |
cd ${{ env.ROOT }}
git clone https://github.com/nodejs/node.git
cd node
git checkout v${{ env.JAVET_NODE_VERSION }}
.\vcbuild.bat static ${{ matrix.node_flag }} vs2022
move out out.${{ matrix.name }}
- name: Copy the i18n
if: matrix.name == 'i18n'
run: |
mkdir icu-node
copy ..\node\deps\icu-tmp\*.dat icu-node
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 8
- name: Setup Cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.23.x'
- name: Build Javet JNI
run: |
cd ${{ env.ROOT }}\Javet\cpp
.\build-windows.cmd -DNODE_DIR=${{ env.ROOT }}\node ${{ matrix.cmake_flag }}
- name: Upload the Artifact
uses: actions/upload-artifact@v4
with:
name: javet-windows-node-x86_64-${{ env.JAVET_VERSION }}-${{ matrix.name }}
path: src\main\resources\*.dll
- name: Upload the i18n
uses: actions/upload-artifact@v4
if: matrix.name == 'i18n'
with:
name: icu-node
path: icu-node\*.dat
build_javet_jar:
needs: [build_javet_v8, build_javet_node]
name: Build Javet Jar
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 8
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.10.2
- name: Install 7zip
run: choco install 7zip.install
- name: Download Javet Node i18n
uses: actions/download-artifact@v4
with:
name: javet-windows-node-x86_64-${{ env.JAVET_VERSION }}-i18n
path: src\main\resources\
- name: Download Javet Node non-i18n
uses: actions/download-artifact@v4
with:
name: javet-windows-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n
path: src\main\resources\
- name: Download Javet V8 i18n
uses: actions/download-artifact@v4
with:
name: javet-windows-v8-x86_64-${{ env.JAVET_VERSION }}-i18n
path: src\main\resources\
- name: Download Javet V8 non-i18n
uses: actions/download-artifact@v4
with:
name: javet-windows-v8-x86_64-${{ env.JAVET_VERSION }}-non-i18n
path: src\main\resources\
- name: Prepare i18n Location
run: |
mkdir icu-node
mkdir icu-v8
- name: Download i18n node
uses: actions/download-artifact@v4
with:
name: icu-node
path: icu-node
- name: Download i18n V8
uses: actions/download-artifact@v4
with:
name: icu-v8
path: icu-v8
- name: Copy the i18n
run: |
mkdir ..\node\deps\icu-tmp
move icu-node\*.dat ..\node\deps\icu-tmp
mkdir ..\google\v8\third_party\icu\common
move icu-v8\*.dat ..\google\v8\third_party\icu\common
- name: Build the Artifact
shell: bash
run: |
touch src/main/resources/libjavet-v8-*-x86_64.v*
gradle build test --rerun-tasks
touch src/main/resources/libjavet-node-*-x86_64.v*
gradle build test --rerun-tasks
touch src/main/resources/libjavet-v8-*-x86_64-i18n.v*
gradle build test --rerun-tasks
touch src/main/resources/libjavet-node-*-x86_64-i18n.v*
gradle build test --rerun-tasks
gradle build generatePomFileForGeneratePomPublication
7z d build/libs/javet-${{ env.JAVET_VERSION }}-sources.jar *.dll
- name: Upload the Artifact
uses: actions/upload-artifact@v4
with:
name: javet-windows-x86_64-${{ env.JAVET_VERSION }}
path: |
build\libs\*.jar
build\libs\*.pom
- name: Delete Javet Node i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-windows-node-x86_64-${{ env.JAVET_VERSION }}-i18n
- name: Delete Javet Node non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-windows-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n
- name: Delete Javet V8 i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-windows-v8-x86_64-${{ env.JAVET_VERSION }}-i18n
- name: Delete Javet V8 non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-windows-v8-x86_64-${{ env.JAVET_VERSION }}-non-i18n