From 3edbec18c0e66ed6373057ed872cfa3f3c66466a Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:35:35 +1000 Subject: [PATCH] switch to hercules ci --- .github/workflows/build.yml | 25 ---------------- bors.toml | 9 ++---- build-images.sh | 16 ++++++---- flake.lock | 58 +++++++++++++++++++++++++++++++++++++ flake.nix | 31 ++++++++++++++++++-- 5 files changed, 98 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/build.yml 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..59a0050 100755 --- a/build-images.sh +++ b/build-images.sh @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -p nix -p coreutils -p bash -p gh -i bash +#!nix-shell -I nixpkgs=channel:nixos-unstable-small -p nix -p coreutils -p bash -p gh -i bash # shellcheck shell=bash set -xeuo pipefail shopt -s lastpipe @@ -26,12 +26,14 @@ build_kexec_installer() { } 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 +42,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}"