mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-10 07:58:12 -05:00
ci: add script to generate release table (#32)
Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
This commit is contained in:
34
.ci/generate_release_table.sh
Normal file
34
.ci/generate_release_table.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#! /bin/bash
|
||||
|
||||
FILES=("linux.amd64" "darwin.arm64" "darwin.amd64" "windows.amd64")
|
||||
output_string=""
|
||||
|
||||
# Write the table header
|
||||
output_string+="| **os/arch** | **sha256** |\n"
|
||||
output_string+="|------|---------------|\n"
|
||||
|
||||
# Loop through all files matching the pattern "toolbox.*.*"
|
||||
for file in "${FILES[@]}"
|
||||
do
|
||||
# Extract OS and ARCH from the filename
|
||||
OS=$(echo "$file" | cut -d '.' -f 1)
|
||||
ARCH=$(echo "$file" | cut -d '.' -f 2)
|
||||
|
||||
# Get release URL
|
||||
URL=https://storage.googleapis.com/genai-toolbox/$VERSION/$OS/$ARCH/toolbox
|
||||
|
||||
curl "$URL" --fail --output toolbox || exit 1
|
||||
|
||||
# Calculate the SHA256 checksum of the file
|
||||
# Running from mac
|
||||
SHA256=$(shasum -a 256 toolbox | awk '{print $1}')
|
||||
# Running from non-mac
|
||||
# SHA256=$(sha256sum toolbox | awk '{print $1}')
|
||||
|
||||
# Write the table row
|
||||
output_string+="| [$OS/$ARCH]($URL) | $SHA256 |\n"
|
||||
|
||||
rm toolbox
|
||||
done
|
||||
echo "$output_string"
|
||||
|
||||
Reference in New Issue
Block a user