@@ -37,16 +37,16 @@ jobs:
3737 attempt=1
3838 while true; do
3939 echo "Attempt $attempt to fetch release info..."
40- RELEASES=$( curl -sSf "$API_URL")
41- if [ $? -eq 0 ] && echo "$RELEASES" | jq -e '. | length > 0' > /dev/null; then
40+ curl -sSf "$API_URL" > /tmp/releases.json
41+ if [ $? -eq 0 ] && jq -e '. | length > 0' /tmp/releases.json > /dev/null; then
4242 # Filter for the latest non-draft, non-prerelease wallet release (tag starts with "v")
43- RELEASE_INFO=$(echo "$RELEASES" | jq '[.[] | select(.draft == false and .prerelease == false and (.tag_name | startswith("v")))][0]')
44-
43+ jq '[.[] | select(.draft == false and .prerelease == false and (.tag_name | startswith("v")))][0]' /tmp/releases.json > /tmp/release_info.json
44+
4545 # Check if we found a valid release
46- if [ "$RELEASE_INFO " != "null" ] && echo "$RELEASE_INFO" | jq -e '.assets' > /dev/null; then
46+ if [ "$(cat /tmp/release_info.json) " != "null" ] && jq -e '.assets' /tmp/release_info.json > /dev/null; then
4747 break
4848 fi
49-
49+
5050 echo "No stable release found, retrying..."
5151 fi
5252
6060 done
6161
6262 ## Extract the tag name, tar URL, and checksum URL from the release info
63- TAG_NAME=$(echo "$RELEASE_INFO" | jq -r '.tag_name')
64- TAR_URL=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url')
65- CHECKSUM_URL=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | endswith("-sha256-checksum.txt")) | .browser_download_url')
63+ TAG_NAME=$(jq -r '.tag_name' /tmp/release_info.json )
64+ TAR_URL=$(jq -r '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url' /tmp/release_info.json )
65+ CHECKSUM_URL=$(jq -r '.assets[] | select(.name | endswith("-sha256-checksum.txt")) | .browser_download_url' /tmp/release_info.json )
6666
6767 ## Store the tag name, tar URL, and checksum URL in the GitHub output
6868 echo "latest_tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
0 commit comments