6060 - name : Install packages
6161 run : yarn install --colors=always
6262 - 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
6464 run : unset ANDROID_HOME && ./build-scripts/build_compiler.js
6565 - name : Tests
6666 run : node_modules/.bin/mocha --colors
8181 build-linux :
8282 name : Build Linux Native Image
8383 needs : build-compiler
84- runs-on : ' ubuntu-24.04'
84+ runs-on : ubuntu-24.04
8585 env :
86- NODE_VERSION : ' 18 .x'
86+ NODE_VERSION : ' 20 .x'
8787 FORCE_COLOR : ' 1'
8888 steps :
8989 - name : Setup Java
@@ -106,7 +106,7 @@ jobs:
106106 native-image-job-reports : ' true'
107107 - name : Setup upx
108108 run : |
109- UPX_VERSION=3.96
109+ UPX_VERSION=5.0.0
110110 curl --fail --show-error --location --remote-name "https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz"
111111 tar -xf upx-$UPX_VERSION-amd64_linux.tar.xz
112112 mv ./upx-$UPX_VERSION-amd64_linux/upx /usr/local/bin/upx
@@ -146,13 +146,84 @@ jobs:
146146 name : Linux image
147147 path : packages/google-closure-compiler-linux/compiler
148148
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+
149220 # Build the native image on MacOS
150221 build-macos :
151222 name : Build MacOS Native Image
152223 needs : build-compiler
153224 runs-on : macos-latest
154225 env :
155- NODE_VERSION : ' 20 .x'
226+ NODE_VERSION : ' 22 .x'
156227 FORCE_COLOR : ' 1'
157228 steps :
158229 - name : Setup Java
@@ -199,7 +270,7 @@ jobs:
199270 - name : Install packages
200271 run : yarn install --colors=always
201272 - name : Build image
202- working-directory : packages/google-closure-compiler-osx
273+ working-directory : packages/google-closure-compiler-macos
203274 run : |
204275 cp ../google-closure-compiler-java/compiler.jar compiler.jar
205276 yarn run build
@@ -210,15 +281,15 @@ jobs:
210281 uses : actions/upload-artifact@v4
211282 with :
212283 name : MacOS image
213- path : packages/google-closure-compiler-osx /compiler
284+ path : packages/google-closure-compiler-macos /compiler
214285
215286 # Build the native image on Windows
216287 build-windows :
217288 name : Build Windows Native Image
218289 needs : build-compiler
219290 runs-on : windows-latest
220291 env :
221- NODE_VERSION : ' 20 .x'
292+ NODE_VERSION : ' 22 .x'
222293 FORCE_COLOR : ' 1'
223294 steps :
224295 - name : Setup Java
@@ -284,12 +355,13 @@ jobs:
284355 runs-on : ubuntu-latest
285356 if : ${{ github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
286357 env :
287- NODE_VERSION : ' 20 .x'
358+ NODE_VERSION : ' 22 .x'
288359 COMPILER_NIGHTLY : ${{ github.event_name == 'schedule' }}
289360 NODE_AUTH_TOKEN : ${{ secrets.NPM_PUBLISH_AUTH_TOKEN }}
290361 FORCE_COLOR : ' 1'
291362 needs :
292363 - build-linux
364+ - build-linux-arm64
293365 - build-macos
294366 - build-windows
295367 steps :
@@ -309,11 +381,16 @@ jobs:
309381 with :
310382 name : Linux image
311383 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/
312389 - name : Download MacOS image
313390 uses : actions/download-artifact@v4
314391 with :
315392 name : MacOS image
316- path : packages/google-closure-compiler-osx /
393+ path : packages/google-closure-compiler-macos /
317394 - name : Download Windows image
318395 uses : actions/download-artifact@v4
319396 with :
@@ -327,7 +404,8 @@ jobs:
327404 - name : Mark binaries executable
328405 run : |
329406 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
331409 chmod 755 packages/google-closure-compiler-windows/compiler.exe
332410 - name : Get yarn cache directory path
333411 run : echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV
0 commit comments