From 6a2d3620f3e90aefc93bacf4147ccf7c0b100228 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 12 Mar 2024 07:28:47 -0400 Subject: [PATCH] release.sh: add ability to select a run id for download --- release.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 748686f..f10b418 100755 --- a/release.sh +++ b/release.sh @@ -5,7 +5,7 @@ set -e usage() { echo "release.sh start [-l LIVE_ARCHS] [-f LIVE_VARIANTS] [-a ROOTFS_ARCHS]" echo " [-p PLATFORMS] [-i SBC_IMGS] [-d DATE] [-r REPOSITORY] -- [gh args...]" - echo "release.sh dl [gh args...]" + echo "release.sh dl [run id] -- [gh args...]" echo "release.sh sign DATE SHASUMFILE" exit 1 } @@ -42,8 +42,19 @@ start_build() { # wish it could be better but alas: # https://github.com/cli/cli/issues/4001 download_build() { + local run check_programs gh - run="$(gh run list -s success -w gen-images.yml --json databaseId -q '.[].databaseId' "$@" | sort -r | head -1)" + if [ -n "$1" ] && [ "$1" != "--" ]; then + run="$1" + shift + else + run="$(gh run list -s success -w gen-images.yml --json databaseId -q '.[].databaseId' "$@" | sort -r | head -1)" + fi + if [ -n "$1" ] && [ "$1" != "--" ]; then + usage + elif [ "$1" == "--" ]; then + shift + fi echo "Downloading artifacts from run ${run} [this may take a while] ..." gh run download "$run" -p 'void-live*' "$@" echo "Done."