Skip to content

Commit 101c617

Browse files
Fix linux ARM64 Github builds
1 parent 450b2cb commit 101c617

1 file changed

Lines changed: 35 additions & 10 deletions

File tree

‎.github/workflows/release.yaml‎

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ jobs:
1414
- {
1515
name: Linux,
1616
arch: x86_64,
17+
docker-arch: linux/amd64,
18+
docker-image: eclipse-temurin:11,
1719
image: ubuntu-latest,
1820
cmake: "-DCMAKE_CXX_FLAGS='-march=x86-64'"
1921
}
20-
# - {
21-
# name: Linux,
22-
# arch: aarch64,
23-
# image: ubuntu-latest,
24-
# cmake: "-DCMAKE_CXX_FLAGS='-march=armv8-a'"
25-
# }
22+
- {
23+
# Sure do love the many ways to refer to ARM 64 bit
24+
# The platform passed to docker must be linux/arm64 to pull in the right image
25+
# But then we need aarch64 for the CMake invocation. Maybe we can switch CMake to using arm64?
26+
name: Linux,
27+
docker-arch: linux/arm64,
28+
docker-image: eclipse-temurin:11,
29+
arch: aarch64,
30+
image: ubuntu-latest,
31+
cmake: "-DCMAKE_CXX_FLAGS='-march=armv8-a'"
32+
}
2633
- {
2734
name: Mac,
2835
arch: x86_64,
@@ -52,23 +59,41 @@ jobs:
5259
uses: actions/checkout@v4
5360
with:
5461
submodules: recursive
62+
- name: Set up QEMU
63+
if: ${{ matrix.target.name == 'Linux' }}
64+
uses: docker/setup-qemu-action@v1
65+
with:
66+
platforms: ${{ matrix.target.docker-arch }}
5567
- name: CMake (Windows)
5668
if: ${{ matrix.target.name == 'Windows' }}
5769
shell: cmd
5870
run: |
5971
cd scripts && .\build.bat ${{ matrix.target.cmake }} -DOS_NAME=${{ matrix.target.name }} -DOS_ARCH=${{ matrix.target.arch }}
60-
- name: CMake (Unix)
61-
if: ${{ matrix.target.name != 'Windows' }}
72+
- name: CMake (Linux)
73+
if: ${{ matrix.target.name == 'Linux' }}
74+
run: |
75+
docker run \
76+
--rm \
77+
-v $(pwd):/${{ github.workspace }} \
78+
-w ${{ github.workspace }} \
79+
--platform ${{ matrix.target.docker-arch }} \
80+
${{ matrix.target.docker-image }} \
81+
sh -c "apt-get update && apt-get install -y cmake openjdk-11-jdk git build-essential && cd scripts && ./build.sh ${{ matrix.target.cmake }} -DOS_NAME=${{ matrix.target.name }} -DOS_ARCH=${{ matrix.target.arch }}"
82+
# The above apt-get commands can be moved to a Dockerfile, but then
83+
# the image needs to be built for the docker-arch architecture,
84+
# which means using the docker/setup-buildx-action
85+
- name: CMake (Mac)
86+
if: ${{ matrix.target.name == 'Mac' }}
6287
shell: bash
6388
run: |
6489
cd scripts && ./build.sh ${{ matrix.target.cmake }} -DOS_NAME=${{ matrix.target.name }} -DOS_ARCH=${{ matrix.target.arch }}
65-
- name: Upload Unix Artifact
90+
- name: Upload Windows Artifact
6691
if: ${{ matrix.target.name == 'Windows' }}
6792
uses: actions/upload-artifact@v3
6893
with:
6994
name: artifacts
7095
path: ${{ github.workspace }}\src\main\resources\de\kherud\llama\
71-
- name: Upload Windows Artifact
96+
- name: Upload Unix Artifact
7297
if: ${{ matrix.target.name != 'Windows' }}
7398
uses: actions/upload-artifact@v3
7499
with:

0 commit comments

Comments
 (0)