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:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
include:
|
||||||
- ubuntu-latest
|
- label: x86_64-linux
|
||||||
- macos-latest
|
image: ubuntu-latest
|
||||||
runs-on: ${{ matrix.os }}
|
- 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:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
|
@ -24,6 +34,21 @@ jobs:
|
||||||
- uses: DeterminateSystems/nix-installer-action@v14
|
- uses: DeterminateSystems/nix-installer-action@v14
|
||||||
continue-on-error: true # Self-hosted runners already have Nix installed
|
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
|
- name: Install Attic
|
||||||
run: |
|
run: |
|
||||||
if ! command -v attic &> /dev/null; then
|
if ! command -v attic &> /dev/null; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue