Skip to content

Commit

Permalink
ci: use script to download artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakBomjan committed May 9, 2024
1 parent 05599f6 commit c0d51ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/sui-move-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ jobs:
submodules: recursive

- name: Install sui
run: |
echo "Testing"
latest_tag=$(curl -sSL https://api.github.com/repos/MystenLabs/sui/releases/latest | jq -r '.tag_name')
ubuntu_artifact="sui-mainnet-${latest_tag#mainnet-}-ubuntu-x86_64.tgz"
browser_download_url=$(curl -sSL https://api.github.com/repos/MystenLabs/sui/releases/latest | jq -r '.assets[] | select(.name == "${ubuntu_artifact}") | .browser_download_url')
echo $browser_download_url
curl -LO ${browser_download_url}
sudo tar -xzvf ${ubuntu_artifact} sui -C /usr/local/bin
run: bash -x ./scripts/install_sui.sh

- name: build and test
run: bash ./scripts/optimize-move.sh
Expand Down
9 changes: 9 additions & 0 deletions scripts/install_sui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
## Install sui binary from latest mainnet release
repo_url="https://api.github.com/repos/MystenLabs/sui/releases/latest"
latest_tag=$(curl -sSL "$repo_url" | jq -r '.tag_name')
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')
curl -sSL -o "$ubuntu_artifact" "$browser_download_url"
sudo tar -xzvf "$ubuntu_artifact" sui -C /usr/local/bin
rm "$ubuntu_artifact"

0 comments on commit c0d51ec

Please sign in to comment.