feat(ci): use binfmt for aarch64 #79
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
jobs: | |
Build: | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- double: aarch64-linux # target we are building for | |
emulated: true # whether this build host is being emulated | |
runner: ubuntu-24.04 # GitHub runner the build is running on | |
flake: bundled # flake part to build | |
- double: x86_64-linux | |
runner: ubuntu-24.04 | |
flake: bundled | |
- double: aarch64-darwin | |
runner: macos-latest | |
flake: bundled | |
- double: x86_64-darwin | |
runner: macos-13 | |
flake: bundled | |
- double: x86_64-windows | |
runner: ubuntu-24.04 | |
flake: bundled-windows | |
runs-on: ${{ matrix.target.runner }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: QEMU | |
if: ${{ matrix.target.emulated }} | |
run: sudo apt-get install -y qemu-user-binfmt | |
- name: Nix | |
if: ${{ !matrix.target.emulated }} | |
uses: DeterminateSystems/nix-installer-action@v10 | |
- name: Nix (emulated) | |
if: ${{ matrix.target.emulated }} | |
uses: DeterminateSystems/nix-installer-action@v10 | |
with: | |
extra-conf: system = ${{ matrix.target.double }} | |
- name: Cache | |
uses: DeterminateSystems/magic-nix-cache-action@v4 | |
- name: Build | |
run: nix build -L .#${{ matrix.target.flake }} | |
- name: Set interpreter | |
if: ${{ matrix.target.double == 'x86_64-linux'}} | |
run: | | |
cp -rL result output | |
rm -rf result | |
chmod +w output/bin/d4 | |
nix run nixpkgs#patchelf -- --set-interpreter /lib64/ld-linux-x86-64.so.2 output/bin/d4 | |
chmod -w output/bin/d4 | |
mv output result | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: d4-${{ matrix.target.double }} | |
path: result |