mirror of
https://github.com/sstent/NixOS_ARM_SDImages.git
synced 2025-12-06 06:01:42 +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:
|
||||
armv7_job:
|
||||
# The host should always be Linux
|
||||
runs-on: ubuntu-22.04
|
||||
name: Build on ubuntu-18.04 armv7
|
||||
build-default-image:
|
||||
name: Build OS image
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: uraimo/run-on-arch-action@v2
|
||||
name: Run commands
|
||||
id: runcmd
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- uses: cachix/install-nix-action@v13
|
||||
with:
|
||||
arch: aarch64
|
||||
distro: ubuntu22.04
|
||||
# Pin because the latest all-hardware profile changes
|
||||
# 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: |
|
||||
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
|
||||
- run: |
|
||||
sudo apt -y install qemu-user-static
|
||||
|
||||
- name: Get the output
|
||||
# Echo the `uname` output parameter from the `runcmd` step
|
||||
- name: Test binfmt
|
||||
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