mirror of
https://github.com/sstent/NixOS_ARM_SDImages.git
synced 2026-01-25 14:41:41 +00:00
Update main.yml
This commit is contained in:
57
.github/workflows/main.yml
vendored
57
.github/workflows/main.yml
vendored
@@ -1,33 +1,40 @@
|
|||||||
on: [push, pull_request,workflow_dispatch]
|
name: Build OS Image
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
armv7_job:
|
build-default-image:
|
||||||
# The host should always be Linux
|
name: Build OS image
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
name: Build on ubuntu-18.04 armv7
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2.3.4
|
||||||
- uses: uraimo/run-on-arch-action@v2
|
|
||||||
name: Run commands
|
- uses: cachix/install-nix-action@v13
|
||||||
id: runcmd
|
|
||||||
with:
|
with:
|
||||||
arch: aarch64
|
# Pin because the latest all-hardware profile changes
|
||||||
distro: ubuntu22.04
|
# https://github.com/NixOS/nixpkgs/pull/128532
|
||||||
|
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/c23146505c35a07bafbecf36af4f9ebde2bb7dfd.tar.gz
|
||||||
|
extra_nix_config: |
|
||||||
|
extra-platforms = aarch64-linux
|
||||||
|
|
||||||
# Not required, but speeds up builds by storing container images in
|
|
||||||
# a GitHub package registry.
|
|
||||||
githubToken: ${{ github.token }}
|
|
||||||
|
|
||||||
# Set an output parameter `uname` for use in subsequent steps
|
- run: |
|
||||||
run: |
|
sudo apt -y install qemu-user-static
|
||||||
uname -a
|
|
||||||
echo ::set-output name=uname::$(uname -a)
|
|
||||||
apt-get update
|
|
||||||
apt install -y docker.io
|
|
||||||
docker ps
|
|
||||||
docker run nixos/nix nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./sd-image.nix
|
|
||||||
|
|
||||||
- name: Get the output
|
- name: Test binfmt
|
||||||
# Echo the `uname` output parameter from the `runcmd` step
|
|
||||||
run: |
|
run: |
|
||||||
echo "The uname output was ${{ steps.runcmd.outputs.uname }}"
|
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
|
||||||
|
/usr/bin/qemu-aarch64-static --version
|
||||||
|
|
||||||
|
- name: Build SD Image
|
||||||
|
run: |
|
||||||
|
nix-build '<nixpkgs/nixos>' \
|
||||||
|
-A config.system.build.sdImage \
|
||||||
|
-I nixos-config=./sd-image.nix \
|
||||||
|
--argstr system aarch64-linux \
|
||||||
|
--option sandbox false
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: sd-image.img
|
||||||
|
path: ./result/sd-image/*.img*
|
||||||
|
|||||||
Reference in New Issue
Block a user