diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 1634062..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "Build" -on: - repository_dispatch: - workflow_dispatch: - push: - branches: - - main -jobs: - images: - strategy: - fail-fast: false - matrix: - tag: - - nixos-22.11 - - nixos-unstable - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 - with: - nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz - - name: Build image - run: ./build-images.sh "${{matrix.tag}}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bors.toml b/bors.toml index 9247e10..a6bf5e6 100644 --- a/bors.toml +++ b/bors.toml @@ -1,10 +1,5 @@ cut_body_after = "" # don't include text from the PR body in the merge commit message status = [ - # garnix - "Evaluate flake.nix", - "package netboot-nixos-2211 [x86_64-linux]", - "package kexec-installer-nixos-2211 [x86_64-linux]", - "package kexec-installer-nixos-unstable [x86_64-linux]", - "check kexec-installer-unstable [x86_64-linux]", - "package netboot-nixos-unstable [x86_64-linux]" + "ci/hercules/onPush/default", + "ci/hercules/evaluation", ] diff --git a/build-images.sh b/build-images.sh index 2a426b6..048e111 100755 --- a/build-images.sh +++ b/build-images.sh @@ -1,12 +1,10 @@ -#!/usr/bin/env nix-shell -#!nix-shell -p nix -p coreutils -p bash -p gh -i bash -# shellcheck shell=bash +#!/usr/bin/env bash set -xeuo pipefail shopt -s lastpipe build_netboot_image() { declare -r tag=$1 arch=$2 tmp=$3 - img=$(nix build --print-out-paths --option accept-flake-config true -L ".#packages.${arch}.netboot-${tag//./}") + img=$(nix build --extra-experimental-features 'nix-command flakes' --print-out-paths --option accept-flake-config true -L ".#packages.${arch}.netboot-${tag//./}") ln -s "${img}/bzImage" "${tmp}/bzImage-${arch}" echo "${tmp}/bzImage-${arch}" ln -s "${img}/initrd" "${tmp}/initrd-${arch}" @@ -21,17 +19,19 @@ build_netboot_image() { build_kexec_installer() { declare -r tag=$1 arch=$2 tmp=$3 - out=$(nix build --print-out-paths --option accept-flake-config true -L ".#packages.${arch}.kexec-installer-${tag//./}") + out=$(nix build --extra-experimental-features 'nix-command flakes' --print-out-paths --option accept-flake-config true -L ".#packages.${arch}.kexec-installer-${tag//./}") echo "${out}/nixos-kexec-installer-${arch}.tar.gz" } main() { - declare -r tag=${1:-nixos-unstable} arch=${2:-x86_64-linux} + declare -r tag=$1 tmp="$(mktemp -d)" trap 'rm -rf -- "$tmp"' EXIT ( - build_kexec_installer "${tag}" "${arch}" "${tmp}" - build_netboot_image "${tag}" "${arch}" "${tmp}" + for arch in x86_64-linux aarch64-linux; do + build_kexec_installer "${tag}" "${arch}" "${tmp}" + build_netboot_image "${tag}" "${arch}" "${tmp}" + done ) | readarray -t assets for asset in "${assets[@]}"; do pushd "$(dirname "${asset}")" @@ -40,9 +40,11 @@ main() { done assets+=("${TMP}/sha256sums") + cat "${TMP}/sha256sums" + # Since we cannot atomically update a release, we delete the old one before - gh release delete "${tag}"