Skip to content

ARM64-Build

ARM64-Build #54

Workflow file for this run

---
name: ARM64-Build
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 1,7 * * 6' # every Saturday at 01:00 UTC and 07:00 UT
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
param:
- opi1
- opi2
- opi3
- opi4
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix with KVM enabled
uses: cachix/install-nix-action@V27
with:
nix_path: nixpkgs=channel:nixos-unstable
enable_kvm: true
extra_nix_config: |
extra-platforms = aarch64-linux
- name: Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Prepare host for ARM64 emulation
run: |
sudo apt update -y
sudo apt -y install qemu-user-static
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
/usr/bin/qemu-aarch64-static --version
- name: Connect to Tailscale network
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:gh
- name: Attic cache
uses: ryanccn/attic-action@v0
with:
endpoint: "http://atticd:8080"
cache: atro
token: ${{ secrets.ATTIC_TOKEN }}
- name: Build
id: build
continue-on-error: true
run: |
# Updating flake lock, then adding substituters and keys, then fake media directory, then building
nix flake update
export SUBS="$(nix show-config substituters) https://hyprland.cachix.org https://staging.attic.rs/attic-ci"
export SUBSKEYS="$(nix show-config trusted-public-keys) hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc= attic-ci:U5Sey4mUxwBXM3iFapmP0/ogODXywKLRNgRPQpEXxbo="
nix build .#nixosConfigurations.${{ matrix.param }}.config.system.build.toplevel -L --substituters "$SUBS" --trusted-public-keys "$SUBSKEYS"
- name: BuildRetry
id: buildretry
if: steps.build.outcome != 'success'
continue-on-error: true
run: |
export SUBS="$(nix show-config substituters) https://hyprland.cachix.org https://staging.attic.rs/attic-ci"
export SUBSKEYS="$(nix show-config trusted-public-keys) hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc= attic-ci:U5Sey4mUxwBXM3iFapmP0/ogODXywKLRNgRPQpEXxbo="
nix build .#nixosConfigurations.${{ matrix.param }}.config.system.build.toplevel -L --substituters "$SUBS" --trusted-public-keys "$SUBSKEYS"
- name: Send message on build fail
if: steps.build.outcome != 'success' && steps.buildretry.outcome != 'success'
run: |
echo "Build failed, sending message to Matrix."
curl -X POST -F "body=Github action has failed for NixOS ARM64 Build for ${{ matrix.param }}. Go to ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} for details." "${{ secrets.EXIT_URL }}"