16
16
# Build Linux binaries, ready for release.
17
17
# This runs inside an Alpine Linux container so we can more easily create a
18
18
# statically linked binary.
19
- runs-on : ubuntu-latest
19
+ strategy :
20
+ matrix :
21
+ goarch : [ amd64, arm64 ]
22
+ include :
23
+ - goarch : amd64
24
+ os : ubuntu-latest
25
+ - goarch : arm64
26
+ os : ubuntu-24.04-arm # TODO: use a -latest variant?
27
+ runs-on : ${{ matrix.os }}
20
28
container :
21
29
image : golang:1.23-alpine
22
30
outputs :
40
48
- name : Cache Go
41
49
uses : actions/cache@v4
42
50
with :
43
- key : go-cache-linux-alpine-v1-${{ hashFiles('go.mod') }}
51
+ key : go-cache-linux-alpine-${{ matrix.goarch }}- v1-${{ hashFiles('go.mod') }}
44
52
path : |
45
53
~/.cache/go-build
46
54
~/go/pkg/mod
73
81
uses : actions/cache/restore@v4
74
82
id : cache-llvm-build
75
83
with :
76
- key : llvm-build-19-linux-alpine-v1
84
+ key : llvm-build-19-linux-alpine-${{ matrix.goarch }}- v1
77
85
path : llvm-build
78
86
- name : Build LLVM
79
87
if : steps.cache-llvm-build.outputs.cache-hit != 'true'
97
105
uses : actions/cache@v4
98
106
id : cache-binaryen
99
107
with :
100
- key : binaryen-linux-alpine-v1
108
+ key : binaryen-linux-alpine-${{ matrix.goarch }}- v1
101
109
path : build/wasm-opt
102
110
- name : Build Binaryen
103
111
if : steps.cache-binaryen.outputs.cache-hit != 'true'
@@ -125,15 +133,15 @@ jobs:
125
133
- name : Build TinyGo release
126
134
run : |
127
135
make release deb -j3 STATIC=1
128
- cp -p build/release.tar.gz /tmp/tinygo${{ steps.version.outputs.version }}.linux-amd64 .tar.gz
129
- cp -p build/release.deb /tmp/tinygo_${{ steps.version.outputs.version }}_amd64 .deb
136
+ cp -p build/release.tar.gz /tmp/tinygo${{ steps.version.outputs.version }}.linux-${{ matrix.goarch }} .tar.gz
137
+ cp -p build/release.deb /tmp/tinygo_${{ steps.version.outputs.version }}_${{ matrix.goarch }} .deb
130
138
- name : Publish release artifact
131
139
uses : actions/upload-artifact@v4
132
140
with :
133
- name : linux-amd64 -double-zipped-${{ steps.version.outputs.version }}
141
+ name : linux-${{ matrix.goarch }} -double-zipped-${{ steps.version.outputs.version }}
134
142
path : |
135
- /tmp/tinygo${{ steps.version.outputs.version }}.linux-amd64 .tar.gz
136
- /tmp/tinygo_${{ steps.version.outputs.version }}_amd64 .deb
143
+ /tmp/tinygo${{ steps.version.outputs.version }}.linux-${{ matrix.goarch }} .tar.gz
144
+ /tmp/tinygo_${{ steps.version.outputs.version }}-${{ matrix.goarch }} .deb
137
145
test-linux-build :
138
146
# Test the binaries built in the build-linux job by running the smoke tests.
139
147
runs-on : ubuntu-latest
@@ -289,11 +297,8 @@ jobs:
289
297
# part of the release tarball.
290
298
strategy :
291
299
matrix :
292
- goarch : [ arm, arm64 ]
300
+ goarch : [ arm ]
293
301
include :
294
- - goarch : arm64
295
- toolchain : aarch64-linux-gnu
296
- libc : arm64
297
302
- goarch : arm
298
303
toolchain : arm-linux-gnueabihf
299
304
libc : armhf
0 commit comments