mirror of
https://github.com/zhaofengli/attic.git
synced 2025-03-05 16:27:06 +00:00
.github/build: Build packages on ARM
Need to move most matrix handling to Nix later.
This commit is contained in:
parent
9d387c01db
commit
4d654d13e7
1 changed files with 29 additions and 4 deletions
33
.github/workflows/build.yml
vendored
33
.github/workflows/build.yml
vendored
|
@ -9,10 +9,20 @@ jobs:
|
|||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
include:
|
||||
- label: x86_64-linux
|
||||
image: ubuntu-latest
|
||||
- label: aarch64-linux
|
||||
image: ubuntu-latest
|
||||
system: aarch64-linux
|
||||
- label: x86_64-darwin
|
||||
image: macos-latest
|
||||
system: x86_64-darwin
|
||||
- label: aarch64-darwin
|
||||
image: macos-latest
|
||||
system: aarch64-darwin
|
||||
name: ${{ matrix.label }}
|
||||
runs-on: ${{ matrix.image }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
|
||||
|
@ -24,6 +34,21 @@ jobs:
|
|||
- uses: DeterminateSystems/nix-installer-action@v14
|
||||
continue-on-error: true # Self-hosted runners already have Nix installed
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.2.0
|
||||
if: matrix.system == 'aarch64-linux'
|
||||
|
||||
- name: Generate System Flags
|
||||
run: |
|
||||
LOCAL_SYSTEM=$(nix-instantiate --eval --json -E 'builtins.currentSystem' | jq -r)
|
||||
HOST_SYSTEM=${HOST_SYSTEM:-$LOCAL_SYSTEM}
|
||||
if [[ "$LOCAL_SYSTEM" != "$HOST_SYSTEM" ]]; then
|
||||
echo "system_flags=--system $HOST_SYSTEM" >>"$GITHUB_ENV"
|
||||
echo "extra-platforms = $HOST_SYSTEM" | sudo tee -a /etc/nix/nix.conf
|
||||
fi
|
||||
env:
|
||||
HOST_SYSTEM: '${{ matrix.system }}'
|
||||
|
||||
- name: Install Attic
|
||||
run: |
|
||||
if ! command -v attic &> /dev/null; then
|
||||
|
|
Loading…
Add table
Reference in a new issue