From 84ae14449e9071b34d7e4401d45328ec9cf1a18e Mon Sep 17 00:00:00 2001 From: Deepak Bomjan Date: Tue, 17 Sep 2024 12:09:25 +0545 Subject: [PATCH] ci: fix sui mainnet installation --- scripts/install_sui.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/install_sui.sh b/scripts/install_sui.sh index 7ad34724..010103db 100644 --- a/scripts/install_sui.sh +++ b/scripts/install_sui.sh @@ -1,12 +1,11 @@ #!/bin/bash ## Install sui binary from latest mainnet release echo $PWD -repo_url="https://api.github.com/repos/MystenLabs/sui/releases/latest" -latest_tag=$(curl -sSL "$repo_url" | jq -r '.tag_name') +repo_url="https://api.github.com/repos/MystenLabs/sui/releases" +latest_tag=$(curl -sSL "$repo_url" | jq -r '.[] | select(.tag_name | contains("mainnet")) | .tag_name' | head -n 1) ubuntu_artifact="sui-mainnet-${latest_tag#mainnet-}-ubuntu-x86_64.tgz" -browser_download_url=$(curl -sSL "$repo_url" | jq -r --arg ua "$ubuntu_artifact" '.assets[] | select(.name == $ua) | .browser_download_url') +browser_download_url=$(curl -sSL "$repo_url" | jq -r --arg ua "$ubuntu_artifact" '.[] | select(.tag_name == "'$latest_tag'") | .assets[] | select(.name == $ua) | .browser_download_url') wget -qO "$ubuntu_artifact" "$browser_download_url" - sudo tar -xzvf "$ubuntu_artifact" -C /usr/local/bin rm "$ubuntu_artifact" -which sui \ No newline at end of file +which sui