ARM64-Build #33
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: 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 | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 360 | |
max_attempts: 5 | |
command: | | |
# 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" |