release.sh: add ability to select a run id for download

This commit is contained in:
classabbyamp 2024-03-12 07:28:47 -04:00
parent f9551cb9ae
commit 6a2d3620f3
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
1 changed files with 13 additions and 2 deletions

View File

@ -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
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."