Skip to content

Commit 486836b

Browse files
committed
ci: use native arm64 builder for arm64 binaries
1 parent 17bb1fe commit 486836b

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/linux.yml

+18-13
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.23-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'
@@ -125,15 +133,15 @@ jobs:
125133
- name: Build TinyGo release
126134
run: |
127135
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
130138
- name: Publish release artifact
131139
uses: actions/upload-artifact@v4
132140
with:
133-
name: linux-amd64-double-zipped-${{ steps.version.outputs.version }}
141+
name: linux-{{ matrix.goarch }}-double-zipped-${{ steps.version.outputs.version }}
134142
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
137145
test-linux-build:
138146
# Test the binaries built in the build-linux job by running the smoke tests.
139147
runs-on: ubuntu-latest
@@ -289,11 +297,8 @@ jobs:
289297
# part of the release tarball.
290298
strategy:
291299
matrix:
292-
goarch: [ arm, arm64 ]
300+
goarch: [ arm ]
293301
include:
294-
- goarch: arm64
295-
toolchain: aarch64-linux-gnu
296-
libc: arm64
297302
- goarch: arm
298303
toolchain: arm-linux-gnueabihf
299304
libc: armhf

0 commit comments

Comments
 (0)