60
60
- name : Install packages
61
61
run : yarn install --colors=always
62
62
- name : Build jar
63
- # unset ANDROID_HOME to prevent bazel from trying to use the Android SDK
63
+ # unset ANDROID_HOME to prevent bazel from trying to use the Android SDK
64
64
run : unset ANDROID_HOME && ./build-scripts/build_compiler.js
65
65
- name : Tests
66
66
run : node_modules/.bin/mocha --colors
81
81
build-linux :
82
82
name : Build Linux Native Image
83
83
needs : build-compiler
84
- runs-on : ' ubuntu-24.04'
84
+ runs-on : ubuntu-24.04
85
85
env :
86
- NODE_VERSION : ' 18 .x'
86
+ NODE_VERSION : ' 20 .x'
87
87
FORCE_COLOR : ' 1'
88
88
steps :
89
89
- name : Setup Java
@@ -106,7 +106,7 @@ jobs:
106
106
native-image-job-reports : ' true'
107
107
- name : Setup upx
108
108
run : |
109
- UPX_VERSION=3.96
109
+ UPX_VERSION=5.0.0
110
110
curl --fail --show-error --location --remote-name "https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz"
111
111
tar -xf upx-$UPX_VERSION-amd64_linux.tar.xz
112
112
mv ./upx-$UPX_VERSION-amd64_linux/upx /usr/local/bin/upx
@@ -146,13 +146,84 @@ jobs:
146
146
name : Linux image
147
147
path : packages/google-closure-compiler-linux/compiler
148
148
149
+ # Build the native image on Linux
150
+ # The runner image determines GLIBC compatibility and should not be changed without
151
+ # understanding the impact. See https://github.com/google/closure-compiler-npm/issues/280
152
+ build-linux-arm64 :
153
+ name : Build Linux Native Image for arm processors
154
+ needs : build-compiler
155
+ runs-on : ubuntu-24.04-arm
156
+ env :
157
+ NODE_VERSION : ' 20.x'
158
+ FORCE_COLOR : ' 1'
159
+ steps :
160
+ - name : Setup Java
161
+ uses : actions/setup-java@v4
162
+ with :
163
+ distribution : adopt-hotspot
164
+ java-version : 21
165
+ java-package : jdk
166
+ architecture : x64
167
+ - uses : actions/checkout@v4
168
+ - name : Use Node.js ${{ env.NODE_VERSION }}
169
+ uses : actions/setup-node@v4
170
+ with :
171
+ node-version : ${{ env.NODE_VERSION }}
172
+ - uses : graalvm/setup-graalvm@v1
173
+ with :
174
+ java-version : 21
175
+ distribution : ' graalvm-community'
176
+ github-token : ${{ secrets.GITHUB_TOKEN }}
177
+ native-image-job-reports : ' true'
178
+ - name : Setup upx
179
+ run : |
180
+ UPX_VERSION=5.0.0
181
+ curl --fail --show-error --location --remote-name "https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-arm64_linux.tar.xz"
182
+ tar -xf upx-$UPX_VERSION-arm64_linux.tar.xz
183
+ mv ./upx-$UPX_VERSION-arm64_linux/upx /usr/local/bin/upx
184
+ - name : Download compiler jar
185
+ uses : actions/download-artifact@v4
186
+ with :
187
+ name : Compiler.jar
188
+ path : packages/google-closure-compiler-java/
189
+ - name : Download contrib folder
190
+ uses : actions/download-artifact@v4
191
+ with :
192
+ name : Contrib folder
193
+ path : packages/google-closure-compiler/contrib
194
+ - name : Get yarn cache directory path
195
+ run : echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
196
+ - name : Cache yarn
197
+ uses : actions/cache@v4
198
+ id : yarn-cache
199
+ with :
200
+ path : ${{ env.yarn_cache_dir }}
201
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
202
+ restore-keys : |
203
+ ${{ runner.os }}-yarn-
204
+ - name : Install packages
205
+ run : yarn install --colors=always
206
+ - name : Build image
207
+ working-directory : packages/google-closure-compiler-linux-arm64
208
+ run : |
209
+ cp ../google-closure-compiler-java/compiler.jar compiler.jar
210
+ yarn run build
211
+ upx compiler
212
+ - name : Tests
213
+ run : yarn workspaces run test --colors
214
+ - name : Upload artifacts
215
+ uses : actions/upload-artifact@v4
216
+ with :
217
+ name : Linux arm64 image
218
+ path : packages/google-closure-compiler-linux-arm64/compiler
219
+
149
220
# Build the native image on MacOS
150
221
build-macos :
151
222
name : Build MacOS Native Image
152
223
needs : build-compiler
153
224
runs-on : macos-latest
154
225
env :
155
- NODE_VERSION : ' 20 .x'
226
+ NODE_VERSION : ' 22 .x'
156
227
FORCE_COLOR : ' 1'
157
228
steps :
158
229
- name : Setup Java
@@ -199,7 +270,7 @@ jobs:
199
270
- name : Install packages
200
271
run : yarn install --colors=always
201
272
- name : Build image
202
- working-directory : packages/google-closure-compiler-osx
273
+ working-directory : packages/google-closure-compiler-macos
203
274
run : |
204
275
cp ../google-closure-compiler-java/compiler.jar compiler.jar
205
276
yarn run build
@@ -210,15 +281,15 @@ jobs:
210
281
uses : actions/upload-artifact@v4
211
282
with :
212
283
name : MacOS image
213
- path : packages/google-closure-compiler-osx /compiler
284
+ path : packages/google-closure-compiler-macos /compiler
214
285
215
286
# Build the native image on Windows
216
287
build-windows :
217
288
name : Build Windows Native Image
218
289
needs : build-compiler
219
290
runs-on : windows-latest
220
291
env :
221
- NODE_VERSION : ' 20 .x'
292
+ NODE_VERSION : ' 22 .x'
222
293
FORCE_COLOR : ' 1'
223
294
steps :
224
295
- name : Setup Java
@@ -284,12 +355,13 @@ jobs:
284
355
runs-on : ubuntu-latest
285
356
if : ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
286
357
env :
287
- NODE_VERSION : ' 20 .x'
358
+ NODE_VERSION : ' 22 .x'
288
359
COMPILER_NIGHTLY : ${{ github.event_name == 'schedule' }}
289
360
NODE_AUTH_TOKEN : ${{ secrets.NPM_PUBLISH_AUTH_TOKEN }}
290
361
FORCE_COLOR : ' 1'
291
362
needs :
292
363
- build-linux
364
+ - build-linux-arm64
293
365
- build-macos
294
366
- build-windows
295
367
steps :
@@ -309,11 +381,16 @@ jobs:
309
381
with :
310
382
name : Linux image
311
383
path : packages/google-closure-compiler-linux/
384
+ - name : Download Linux arm64 image
385
+ uses : actions/download-artifact@v4
386
+ with :
387
+ name : Linux arm64 image
388
+ path : packages/google-closure-compiler-linux-arm64/
312
389
- name : Download MacOS image
313
390
uses : actions/download-artifact@v4
314
391
with :
315
392
name : MacOS image
316
- path : packages/google-closure-compiler-osx /
393
+ path : packages/google-closure-compiler-macos /
317
394
- name : Download Windows image
318
395
uses : actions/download-artifact@v4
319
396
with :
@@ -327,7 +404,8 @@ jobs:
327
404
- name : Mark binaries executable
328
405
run : |
329
406
chmod 755 packages/google-closure-compiler-linux/compiler
330
- chmod 755 packages/google-closure-compiler-osx/compiler
407
+ chmod 755 packages/google-closure-compiler-linux-arm64/compiler
408
+ chmod 755 packages/google-closure-compiler-macos/compiler
331
409
chmod 755 packages/google-closure-compiler-windows/compiler.exe
332
410
- name : Get yarn cache directory path
333
411
run : echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
0 commit comments