From 83e03032f222f0ae26f0e2a2b43822c4d431ebf8 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 8 Oct 2024 20:50:46 -0400 Subject: [PATCH] tool/fetch-release-artifacts: push to git the script in use for bundling release artifacts --- tool/fetch-release-artifacts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tool/fetch-release-artifacts diff --git a/tool/fetch-release-artifacts b/tool/fetch-release-artifacts new file mode 100755 index 00000000..8d3ebf9e --- /dev/null +++ b/tool/fetch-release-artifacts @@ -0,0 +1,26 @@ +#! /usr/bin/env bash +set -e +heredir=$(realpath "$(dirname "$0")/..") +( + [ -d out/dist-unzipped-nested-tmp ] && rm -rf out/dist-unzipped-nested-tmp + mkdir -p out/dist-unzipped-nested-tmp + cd out/dist-unzipped-nested-tmp + gh run download -n wheels-apple -n wheels-linux -n aarch64-apple-darwin.tar -n aarch64-apple-darwin.tar.sha256sum -n aarch64-pc-windows-msvc.tar -n aarch64-pc-windows-msvc.tar.sha256sum -n aarch64-unknown-linux-gnu.tar -n aarch64-unknown-linux-gnu.tar.sha256sum -n aarch64-unknown-linux-musl.tar -n aarch64-unknown-linux-musl.tar.sha256sum -n armv7-unknown-linux-gnueabihf.tar -n armv7-unknown-linux-gnueabihf.tar.sha256sum -n armv7-unknown-linux-musleabihf.tar -n armv7-unknown-linux-musleabihf.tar.sha256sum -n x86_64-pc-windows-msvc.tar -n x86_64-pc-windows-msvc.tar.sha256sum -n x86_64-unknown-linux-gnu.tar -n x86_64-unknown-linux-gnu.tar.sha256sum -n x86_64-unknown-linux-musl.tar -n x86_64-unknown-linux-musl.tar.sha256sum + ( + mkdir dist-unzipped-tmp + find . -type f | while read f + do mv "$f" "dist-unzipped-tmp/$(basename "$f")" + done + ( + mkdir dist-tmp + find . -type f | while read f + do zip -r "$f.zip" "$f" && mv "$f.zip" "dist-tmp/$(basename "$f").zip" + done + [ -d "$heredir/out/dist" ] && rm -rf "$heredir/out/dist" + [ -d "$heredir/out" ] || mkdir -p "$heredir/out" + mv dist-tmp "$heredir/out/dist" + echo "$heredir/out/dist" + ) + ) +) +