From 0241c127d0b641d2286fc3a0967c4f6c959aad5b Mon Sep 17 00:00:00 2001 From: Arian van Putten Date: Wed, 22 May 2024 23:25:29 +0200 Subject: [PATCH] Use 'tested' aggregate job What we were doing before was slightly incorrect. We'd upload AMIs for NixOS evals that wouldn't end up as channel bumps. By using the 'tested' job (like https://status.nixos.org) we actually upload the correct thing --- .github/workflows/upload-legacy-ami.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-legacy-ami.yml b/.github/workflows/upload-legacy-ami.yml index 1538c46..3451dc6 100644 --- a/.github/workflows/upload-legacy-ami.yml +++ b/.github/workflows/upload-legacy-ami.yml @@ -36,7 +36,8 @@ jobs: id: download_ami run: | set -o pipefail - out=$(curl --location --silent --fail-with-body --header 'Accept: application/json' https://hydra.nixos.org/job/nixos/${{ matrix.release }}/nixos.amazonImage.${{ matrix.system }}/latest-finished | jq --raw-output '.buildoutputs.out.path') + build_id=$(curl -sSL -H 'Accept: application/json https://hydra.nixos.org/job/nixos/${{ matrix.release }}/tested/latest-finished | jq -r '.id') + out=$(curl -sSL -H 'Accept: application/json' https://hydra.nixos.org/build/${build_id}/constituents | jq -r '.[] | select(.job == "nixos.amazonImage.${{ matrix.system }}") | .buildoutputs.out.path') nix-store --realise "$out" --add-root ./result echo "image_info=$out/nix-support/image-info.json" >> "$GITHUB_OUTPUT"