Skip to content

Commit 45f3ef8

Browse files
committed
ci: use native arm64 builder for arm64 binaries
1 parent 632e5f9 commit 45f3ef8

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/linux.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ jobs:
1616
# Build Linux binaries, ready for release.
1717
# This runs inside an Alpine Linux container so we can more easily create a
1818
# 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 }}
2028
container:
2129
image: golang:1.25-alpine
2230
outputs:
@@ -40,7 +48,7 @@ jobs:
4048
- name: Cache Go
4149
uses: actions/cache@v4
4250
with:
43-
key: go-cache-linux-alpine-v1-${{ hashFiles('go.mod') }}
51+
key: go-cache-linux-alpine-${{ matrix.goarch }}-v1-${{ hashFiles('go.mod') }}
4452
path: |
4553
~/.cache/go-build
4654
~/go/pkg/mod
@@ -73,7 +81,7 @@ jobs:
7381
uses: actions/cache/restore@v4
7482
id: cache-llvm-build
7583
with:
76-
key: llvm-build-19-linux-alpine-v1
84+
key: llvm-build-19-linux-alpine-${{ matrix.goarch }}-v1
7785
path: llvm-build
7886
- name: Build LLVM
7987
if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -97,7 +105,7 @@ jobs:
97105
uses: actions/cache@v4
98106
id: cache-binaryen
99107
with:
100-
key: binaryen-linux-alpine-v1
108+
key: binaryen-linux-alpine-${{ matrix.goarch }}-v1
101109
path: build/wasm-opt
102110
- name: Build Binaryen
103111
if: steps.cache-binaryen.outputs.cache-hit != 'true'
@@ -116,15 +124,15 @@ jobs:
116124
- name: Build TinyGo release
117125
run: |
118126
make release deb -j3 STATIC=1
119-
cp -p build/release.tar.gz /tmp/tinygo${{ steps.version.outputs.version }}.linux-amd64.tar.gz
120-
cp -p build/release.deb /tmp/tinygo_${{ steps.version.outputs.version }}_amd64.deb
127+
cp -p build/release.tar.gz /tmp/tinygo${{ steps.version.outputs.version }}.linux-${{ matrix.goarch }}.tar.gz
128+
cp -p build/release.deb /tmp/tinygo_${{ steps.version.outputs.version }}_${{ matrix.goarch }}.deb
121129
- name: Publish release artifact
122130
uses: actions/upload-artifact@v4
123131
with:
124-
name: linux-amd64-double-zipped-${{ steps.version.outputs.version }}
132+
name: linux-${{ matrix.goarch }}-double-zipped-${{ steps.version.outputs.version }}
125133
path: |
126-
/tmp/tinygo${{ steps.version.outputs.version }}.linux-amd64.tar.gz
127-
/tmp/tinygo_${{ steps.version.outputs.version }}_amd64.deb
134+
/tmp/tinygo${{ steps.version.outputs.version }}.linux-${{ matrix.goarch }}.tar.gz
135+
/tmp/tinygo_${{ steps.version.outputs.version }}-${{ matrix.goarch }}.deb
128136
test-linux-build:
129137
# Test the binaries built in the build-linux job by running the smoke tests.
130138
runs-on: ubuntu-latest
@@ -272,11 +280,8 @@ jobs:
272280
# part of the release tarball.
273281
strategy:
274282
matrix:
275-
goarch: [ arm, arm64 ]
283+
goarch: [ arm ]
276284
include:
277-
- goarch: arm64
278-
toolchain: aarch64-linux-gnu
279-
libc: arm64
280285
- goarch: arm
281286
toolchain: arm-linux-gnueabihf
282287
libc: armhf

0 commit comments

Comments
 (0)