Skip to content

Commit

Permalink
ci: fix sui mainnet installation
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakBomjan committed Sep 17, 2024
1 parent 99eba89 commit 84ae144
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/install_sui.sh
Original file line number Diff line number Diff line change
@@ -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
which sui

0 comments on commit 84ae144

Please sign in to comment.