7
7
8
8
env :
9
9
RUNNER : tools/run-tests.py
10
- BUILD_OPTIONS : -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
10
+ BUILD_OPTIONS : -DESCARGOT_MODE=release -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_DEPLOY=ON - DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
11
11
12
12
jobs :
13
- build-mac64 :
14
- runs-on : macos-13
13
+ build-macOS :
14
+ runs-on : ${{ matrix.os }}
15
+ strategy :
16
+ matrix :
17
+ os : [macos-13, macos-latest]
15
18
steps :
16
19
- uses : actions/checkout@v4
17
20
with :
18
21
submodules : true
19
22
- name : Install Packages
20
23
run : |
21
24
brew update
22
- brew install ninja icu4c
25
+ brew install ninja icu4c zip
23
26
- name : Build x64
24
27
run : |
25
28
# check cpu
@@ -33,44 +36,130 @@ jobs:
33
36
run : |
34
37
file out/escargot
35
38
strip out/escargot
36
- $RUNNER --engine="$GITHUB_WORKSPACE/out/escargot" new-es
37
- mv out/escargot out/escargot-mac64
38
- - name : Upload
39
+
40
+ # set deploy directory
41
+ mkdir -p deploy
42
+
43
+ # set escargot
44
+ cp out/escargot ./deploy/.
45
+ LIBS=$(otool -L ./deploy/escargot | grep "icu" | awk '{print $1}')
46
+ for LIB in $LIBS; do
47
+ BASENAME=$(basename "$LIB")
48
+ install_name_tool -change "$LIB" "@executable_path/$BASENAME" deploy/escargot
49
+ done
50
+
51
+ # set icu libs
52
+ ICU_LIBS=("libicuuc" "libicui18n" "libicudata")
53
+ ICU_SOURCE_PATH="$(brew --prefix icu4c)/lib"
54
+ ICU_VERSION=$(find "$ICU_SOURCE_PATH" -name "libicuuc.*.dylib" | grep -oE '\.[0-9]+\.' | head -n 1 | tr -d '.')
55
+
56
+ if [ -z "$ICU_VERSION" ]; then
57
+ echo "ICU version could not be detected."
58
+ exit 1
59
+ else
60
+ echo "Detected ICU Version: $ICU_VERSION"
61
+ fi
62
+
63
+ for LIB in "${ICU_LIBS[@]}"; do
64
+ cp -a $ICU_SOURCE_PATH/$LIB.*.dylib ./deploy/.
65
+ install_name_tool -id "@loader_path/$LIB.$ICU_VERSION.dylib" "./deploy/$LIB.$ICU_VERSION.dylib"
66
+ done
67
+
68
+ # check results
69
+ echo "Check results..."
70
+ ls ./deploy
71
+ otool -L ./deploy/escargot
72
+ otool -L ./deploy/libicu*.dylib
73
+
74
+ # run test
75
+ $RUNNER --engine="$GITHUB_WORKSPACE/deploy/escargot" new-es
76
+
77
+ # zip results
78
+ if [ "${{ matrix.os }}" == "macos-13" ]; then
79
+ zip -j escargot-mac64.zip deploy/*
80
+ elif [ "${{ matrix.os }}" == "macos-latest" ]; then
81
+ zip -j escargot-mac64arm.zip deploy/*
82
+ fi
83
+ - name : Upload mac64
84
+ if : ${{ matrix.os == 'macos-13' }}
39
85
uses : actions/upload-artifact@v4
40
86
with :
41
87
name : build-artifact-mac64
42
- path : out/escargot-mac64
88
+ path : ./escargot-mac64.zip
89
+ - name : Upload mac64arm
90
+ if : ${{ matrix.os == 'macos-latest' }}
91
+ uses : actions/upload-artifact@v4
92
+ with :
93
+ name : build-artifact-mac64arm
94
+ path : ./escargot-mac64arm.zip
43
95
44
- build-mac64arm :
45
- runs-on : macos-latest
96
+ build-linux :
97
+ runs-on : ubuntu-22.04
46
98
steps :
47
99
- uses : actions/checkout@v4
48
100
with :
49
101
submodules : true
50
102
- name : Install Packages
51
103
run : |
52
- brew update
53
- brew install ninja icu4c
54
- - name : Build arm64
104
+ # for i386 ICU
105
+ sudo dpkg --add-architecture i386
106
+ sudo apt-get update
107
+ sudo apt-get install -y ninja-build libicu-dev gcc-multilib g++-multilib zip patchelf
108
+ sudo apt-get install -y libicu-dev:i386 # install i386 ICU
109
+ - name : Build x86/x64
55
110
run : |
56
- # check cpu
57
- sysctl -a | grep machdep.cpu
58
- # add icu path to pkg_config_path
59
- export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
60
- echo $PKG_CONFIG_PATH
61
- cmake -H. -Bout/ $BUILD_OPTIONS
62
- ninja -Cout/
111
+ cmake -H. -Bout/x86 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS
112
+ cmake -H. -Bout/x64 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS
113
+ ninja -Cout/x86
114
+ ninja -Cout/x64
63
115
- name : Check
64
116
run : |
65
- file out/escargot
66
- strip out/escargot
67
- $RUNNER --engine="$GITHUB_WORKSPACE/out/escargot" new-es
68
- mv out/escargot out/escargot-mac64arm
117
+ file out/x86/escargot
118
+ file out/x64/escargot
119
+ strip out/x86/escargot
120
+ strip out/x64/escargot
121
+ # set locale
122
+ sudo locale-gen en_US.UTF-8
123
+ export LANG=en_US.UTF-8
124
+ locale
125
+
126
+ # set deploy directory and copy escargot binary
127
+ mkdir -p deploy-x86
128
+ mkdir -p deploy-x64
129
+ cp out/x86/escargot ./deploy-x86/.
130
+ cp out/x64/escargot ./deploy-x64/.
131
+
132
+ # set icu libs
133
+ ldd deploy-x86/escargot | grep "icu" | grep "=>" | awk '{print $3}' | xargs -I '{}' cp '{}' deploy-x86/
134
+ ldd deploy-x64/escargot | grep "icu" | grep "=>" | awk '{print $3}' | xargs -I '{}' cp '{}' deploy-x64/
135
+ for LIB in ./deploy-x86/libicu*; do
136
+ patchelf --set-rpath '$ORIGIN' "$LIB"
137
+ done
138
+ for LIB in ./deploy-x64/libicu*; do
139
+ patchelf --set-rpath '$ORIGIN' "$LIB"
140
+ done
141
+
142
+ # check results
143
+ echo "Check results..."
144
+ ls ./deploy-x86
145
+ ldd deploy-x86/escargot
146
+ ldd deploy-x86/libicu*
147
+ ls ./deploy-x64
148
+ ldd deploy-x64/escargot
149
+ ldd deploy-x64/libicu*
150
+
151
+ # run test
152
+ $RUNNER --engine="$GITHUB_WORKSPACE/deploy-x86/escargot" new-es
153
+ $RUNNER --engine="$GITHUB_WORKSPACE/deploy-x64/escargot" new-es
154
+
155
+ # zip results
156
+ zip -j escargot-linux-x86.zip deploy-x86/*
157
+ zip -j escargot-linux-x64.zip deploy-x64/*
69
158
- name : Upload
70
159
uses : actions/upload-artifact@v4
71
160
with :
72
- name : build-artifact-mac64arm
73
- path : out/ escargot-mac64arm
161
+ name : build-artifact-linux
162
+ path : escargot-linux-*.zip
74
163
75
164
build-windows :
76
165
runs-on : windows-2022
@@ -103,6 +192,11 @@ jobs:
103
192
with :
104
193
arch : ${{ matrix.arch }}
105
194
sdk : " 10.0.20348.0"
195
+ - name : Install zip if not available
196
+ run : |
197
+ if (-Not (Get-Command zip -ErrorAction SilentlyContinue)) {
198
+ choco install zip -y
199
+ }
106
200
- name : Build ${{ matrix.arch }}
107
201
run : |
108
202
CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DESCARGOT_ARCH=${{ matrix.arch }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release
@@ -111,55 +205,83 @@ jobs:
111
205
run : |
112
206
python tools\run-tests.py --engine=%cd%\out\escargot.exe new-es
113
207
rename out\escargot.exe escargot-win-${{ matrix.arch }}.exe
208
+ zip -j escargot-win-${{ matrix.arch}}.zip out\escargot-win-${{ matrix.arch }}.exe
114
209
shell : cmd
115
210
- name : Upload
116
211
uses : actions/upload-artifact@v4
117
212
with :
118
213
name : build-artifact-win-${{ matrix.arch }}
119
- path : out\ escargot-win-${{ matrix.arch }}.exe
214
+ path : escargot-win-${{ matrix.arch }}.zip
120
215
121
- build-linux :
122
- runs-on : ubuntu-22.04
216
+ check-build-mac64 :
217
+ needs : [build-macOS]
218
+ runs-on : macos-13
123
219
steps :
124
220
- uses : actions/checkout@v4
125
221
with :
126
222
submodules : true
127
- - name : Install Packages
128
- run : |
129
- # for i386 ICU
130
- sudo dpkg --add-architecture i386
131
- sudo apt-get update
132
- sudo apt-get install -y ninja-build libicu-dev gcc-multilib g++-multilib
133
- sudo apt-get install -y libicu-dev:i386 # install i386 ICU
134
- - name : Build x86/x64
223
+ - name : Download build artifacts
224
+ uses : actions/download-artifact@v4
225
+ with :
226
+ path : artifacts
227
+ pattern : build-artifact-mac64
228
+ merge-multiple : true
229
+ - name : Check
135
230
run : |
136
- cmake -H. -Bout/x86 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS
137
- cmake -H. -Bout/x64 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS
138
- ninja -Cout/x86
139
- ninja -Cout/x64
231
+ unzip artifacts/escargot-mac64.zip -d artifacts
232
+ otool -L artifacts/escargot
233
+ otool -L artifacts/*.dylib
234
+ $RUNNER --engine="$GITHUB_WORKSPACE/artifacts/escargot" new-es
235
+
236
+ check-build-mac64arm :
237
+ needs : [build-macOS]
238
+ runs-on : macos-latest
239
+ steps :
240
+ - uses : actions/checkout@v4
241
+ with :
242
+ submodules : true
243
+ - name : Download build artifacts
244
+ uses : actions/download-artifact@v4
245
+ with :
246
+ path : artifacts
247
+ pattern : build-artifact-mac64arm
248
+ merge-multiple : true
140
249
- name : Check
141
250
run : |
142
- file out/x86/escargot
143
- file out/x64/escargot
144
- strip out/x86/escargot
145
- strip out/x64/escargot
146
- # set locale
147
- sudo locale-gen en_US.UTF-8
148
- export LANG=en_US.UTF-8
149
- locale
150
- # run test
151
- $RUNNER --engine="$GITHUB_WORKSPACE/out/x86/escargot" new-es
152
- $RUNNER --engine="$GITHUB_WORKSPACE/out/x64/escargot" new-es
153
- mv out/x86/escargot out/escargot-linux-x86
154
- mv out/x64/escargot out/escargot-linux-x64
155
- - name : Upload
156
- uses : actions/upload-artifact@v4
251
+ unzip artifacts/escargot-mac64arm.zip -d artifacts
252
+ otool -L artifacts/escargot
253
+ otool -L artifacts/*.dylib
254
+ $RUNNER --engine="$GITHUB_WORKSPACE/artifacts/escargot" new-es
255
+
256
+ check-build-linux :
257
+ needs : [build-linux]
258
+ runs-on : ubuntu-latest
259
+ steps :
260
+ - uses : actions/checkout@v4
157
261
with :
158
- name : build-artifact-linux
159
- path : out/escargot-linux-*
262
+ submodules : true
263
+ - name : Download build artifacts
264
+ uses : actions/download-artifact@v4
265
+ with :
266
+ path : artifacts
267
+ pattern : build-artifact-linux
268
+ merge-multiple : true
269
+ - name : Check
270
+ run : |
271
+ dpkg -l | grep libicu-dev
272
+ mkdir -p result-x86
273
+ mkdir -p result-x64
274
+ unzip artifacts/escargot-linux-x86.zip -d result-x86
275
+ unzip artifacts/escargot-linux-x64.zip -d result-x64
276
+ ldd result-x86/escargot
277
+ ldd result-x86/libicu*
278
+ ldd result-x64/escargot
279
+ ldd result-x64/libicu*
280
+ $RUNNER --engine="$GITHUB_WORKSPACE/result-x86/escargot" new-es
281
+ $RUNNER --engine="$GITHUB_WORKSPACE/result-x64/escargot" new-es
160
282
161
283
update-release :
162
- needs : [build-mac64, build-mac64arm, build-windows , build-linux ]
284
+ needs : [check- build-mac64, check- build-mac64arm, check- build-linux , build-windows ]
163
285
runs-on : ubuntu-latest
164
286
steps :
165
287
- name : Download build artifacts
0 commit comments