Skip to content

Commit 53c0ff1

Browse files
docs: Fix failing docs-cli-help.yml (#24443)
## Description Describe the changes or additions included in this PR. ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] Indexing Framework:
1 parent 781155b commit 53c0ff1

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

.github/workflows/docs-cli-help.yml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,52 @@ jobs:
4242
set -euo pipefail
4343
TAG="${{ steps.release.outputs.tag }}"
4444
mkdir -p ".cache/sui/${TAG}"
45-
URL="https://github.com/MystenLabs/sui/releases/download/${TAG}/sui-linux-x86_64"
46-
echo "Downloading $URL"
47-
curl -L -o ".cache/sui/${TAG}/sui" "$URL"
48-
chmod +x ".cache/sui/${TAG}/sui"
45+
46+
# Try different possible asset names
47+
ASSETS=(
48+
"sui-mainnet-v${TAG#testnet-v}-ubuntu-x86_64.tgz"
49+
"sui-testnet-v${TAG#testnet-v}-ubuntu-x86_64.tgz"
50+
"sui-${TAG}-ubuntu-x86_64.tgz"
51+
"sui-linux-x86_64"
52+
)
53+
54+
DOWNLOADED=false
55+
for ASSET in "${ASSETS[@]}"; do
56+
URL="https://github.com/MystenLabs/sui/releases/download/${TAG}/${ASSET}"
57+
echo "Trying: $URL"
58+
59+
if curl -fsSL -o "/tmp/sui-download" "$URL" 2>/dev/null; then
60+
echo "Successfully downloaded: $ASSET"
61+
62+
# Check if it's a tarball
63+
if [[ "$ASSET" == *.tgz ]]; then
64+
tar -xzf /tmp/sui-download -C ".cache/sui/${TAG}/"
65+
# Find the sui binary in extracted files
66+
find ".cache/sui/${TAG}/" -name "sui" -type f -executable -exec mv {} ".cache/sui/${TAG}/sui" \;
67+
else
68+
mv /tmp/sui-download ".cache/sui/${TAG}/sui"
69+
fi
70+
71+
chmod +x ".cache/sui/${TAG}/sui"
72+
DOWNLOADED=true
73+
break
74+
fi
75+
done
76+
77+
if [ "$DOWNLOADED" = false ]; then
78+
echo "Failed to download sui binary from any known location"
79+
echo "Available assets for ${TAG}:"
80+
curl -s "https://api.github.com/repos/MystenLabs/sui/releases/tags/${TAG}" | jq -r '.assets[].name'
81+
exit 1
82+
fi
83+
84+
# Verify it's actually a binary
85+
if ! file ".cache/sui/${TAG}/sui" | grep -q "executable"; then
86+
echo "Downloaded file is not an executable:"
87+
file ".cache/sui/${TAG}/sui"
88+
head -n 5 ".cache/sui/${TAG}/sui"
89+
exit 1
90+
fi
4991
5092
- name: Generate MDX snippets (sh fenced)
5193
run: |

0 commit comments

Comments
 (0)