84
84
run : make wasi-libc
85
85
- name : Install fpm
86
86
run : |
87
- sudo apt-get install ruby ruby-dev
88
87
sudo gem install --no-document fpm
89
88
- name : Build TinyGo release
90
89
run : |
94
93
- name : Publish release artifact
95
94
uses : actions/upload-artifact@v2
96
95
with :
97
- name : release -double-zipped
96
+ name : linux-amd64 -double-zipped
98
97
path : |
99
98
/tmp/tinygo.linux-amd64.tar.gz
100
99
/tmp/tinygo_amd64.deb
@@ -116,7 +115,7 @@ jobs:
116
115
- name : Download release artifact
117
116
uses : actions/download-artifact@v2
118
117
with :
119
- name : release -double-zipped
118
+ name : linux-amd64 -double-zipped
120
119
- name : Extract release tarball
121
120
run : |
122
121
mkdir -p ~/lib
@@ -242,3 +241,108 @@ jobs:
242
241
- run : make smoketest
243
242
- run : make wasmtest
244
243
- run : make tinygo-baremetal
244
+ build-linux-arm :
245
+ # Build ARM Linux binaries, ready for release.
246
+ # This intentionally uses an older Linux image, so that we compile against
247
+ # an older glibc version and therefore are compatible with a wide range of
248
+ # Linux distributions.
249
+ # It is set to "needs: build-linux" because it modifies the release created
250
+ # in that process to avoid doing lots of duplicate work and to avoid
251
+ # complications around precompiled libraries such as compiler-rt shipped as
252
+ # part of the release tarball.
253
+ runs-on : ubuntu-18.04
254
+ needs : build-linux
255
+ steps :
256
+ - name : Checkout
257
+ uses : actions/checkout@v2
258
+ - name : Install apt dependencies
259
+ run : |
260
+ sudo apt-get install --no-install-recommends \
261
+ qemu-user \
262
+ g++-arm-linux-gnueabihf \
263
+ libc6-dev-armhf-cross
264
+ - name : Install Go
265
+ uses : actions/setup-go@v2
266
+ with :
267
+ go-version : ' 1.17'
268
+ - name : Cache Go
269
+ uses : actions/cache@v2
270
+ with :
271
+ key : go-cache-linux-arm-v2-${{ hashFiles('go.mod') }}
272
+ path : |
273
+ ~/.cache/go-build
274
+ ~/go/pkg/mod
275
+ - name : Cache LLVM source
276
+ uses : actions/cache@v2
277
+ id : cache-llvm-source
278
+ with :
279
+ key : llvm-source-14-linux-v1
280
+ path : |
281
+ llvm-project/clang/lib/Headers
282
+ llvm-project/clang/include
283
+ llvm-project/compiler-rt
284
+ llvm-project/lld/include
285
+ llvm-project/llvm/include
286
+ - name : Download LLVM source
287
+ if : steps.cache-llvm-source.outputs.cache-hit != 'true'
288
+ run : make llvm-source
289
+ - name : Cache LLVM build
290
+ uses : actions/cache@v2
291
+ id : cache-llvm-build
292
+ with :
293
+ key : llvm-build-14-linux-arm-v1
294
+ path : llvm-build
295
+ - name : Build LLVM
296
+ if : steps.cache-llvm-build.outputs.cache-hit != 'true'
297
+ run : |
298
+ # fetch LLVM source
299
+ rm -rf llvm-project
300
+ make llvm-source
301
+ # Install build dependencies.
302
+ sudo apt-get install --no-install-recommends ninja-build
303
+ # build!
304
+ make llvm-build CROSS=arm-linux-gnueabihf
305
+ # Remove unnecessary object files (to reduce cache size).
306
+ find llvm-build -name CMakeFiles -prune -exec rm -r '{}' \;
307
+ - name : Cache Binaryen
308
+ uses : actions/cache@v2
309
+ id : cache-binaryen
310
+ with :
311
+ key : binaryen-linux-arm-v1
312
+ path : build/wasm-opt
313
+ - name : Build Binaryen
314
+ if : steps.cache-binaryen.outputs.cache-hit != 'true'
315
+ run : |
316
+ sudo apt-get install --no-install-recommends ninja-build
317
+ git submodule update --init lib/binaryen
318
+ make CROSS=arm-linux-gnueabihf binaryen
319
+ - name : Install fpm
320
+ run : |
321
+ sudo gem install --no-document fpm
322
+ - name : Build TinyGo binary
323
+ run : |
324
+ make CROSS=arm-linux-gnueabihf
325
+ - name : Download amd64 release
326
+ uses : actions/download-artifact@v2
327
+ with :
328
+ name : linux-amd64-double-zipped
329
+ - name : Extract amd64 release
330
+ run : |
331
+ mkdir -p build/release
332
+ tar -xf tinygo.linux-amd64.tar.gz -C build/release tinygo
333
+ - name : Modify release
334
+ run : |
335
+ cp -p build/tinygo build/release/tinygo/bin
336
+ cp -p build/wasm-opt build/release/tinygo/bin
337
+ - name : Create arm release
338
+ run : |
339
+ make release deb RELEASEONLY=1 DEB_ARCH=armhf
340
+ cp -p build/release.tar.gz /tmp/tinygo.linux-arm.tar.gz
341
+ cp -p build/release.deb /tmp/tinygo_armhf.deb
342
+ - name : Publish release artifact
343
+ uses : actions/upload-artifact@v2
344
+ with :
345
+ name : linux-arm-double-zipped
346
+ path : |
347
+ /tmp/tinygo.linux-arm.tar.gz
348
+ /tmp/tinygo_armhf.deb
0 commit comments