Skip to content

Commit 89564f6

Browse files
fatbobmanclaude
andcommitted
fix: Improve Swift manual installation with better error handling
- Switch to curl for more reliable downloads with better error reporting - Try Swift 6.0.2 first, fallback to 6.0.1 if download fails - Add dependency installation (curl) before downloading - Use dynamic directory detection for extracted Swift - Add detailed logging for troubleshooting download issues - Improve robustness of fallback Swift installation process 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent abd6535 commit 89564f6

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

.github/workflows/linux-compatibility.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,35 @@ jobs:
2929
run: |
3030
echo "Swift setup failed, attempting manual installation..."
3131
32-
# Download Swift
33-
wget -q https://download.swift.org/swift-6.0.3-release/ubuntu2004/swift-6.0.3-RELEASE-ubuntu20.04.tar.gz
32+
# Install dependencies
33+
sudo apt-get update
34+
sudo apt-get install -y curl
35+
36+
# Try Swift 6.0.2 (more stable release)
37+
SWIFT_URL="https://download.swift.org/swift-6.0.2-release/ubuntu2004/swift-6.0.2-RELEASE-ubuntu20.04.tar.gz"
38+
echo "Downloading Swift from: $SWIFT_URL"
39+
40+
# Download with better error handling
41+
if ! curl -fsSL -o swift.tar.gz "$SWIFT_URL"; then
42+
echo "Failed to download Swift, trying alternative version..."
43+
# Try Swift 6.0.1 as fallback
44+
SWIFT_URL="https://download.swift.org/swift-6.0.1-release/ubuntu2004/swift-6.0.1-RELEASE-ubuntu20.04.tar.gz"
45+
curl -fsSL -o swift.tar.gz "$SWIFT_URL"
46+
fi
3447
3548
# Extract Swift
36-
tar xzf swift-6.0.3-RELEASE-ubuntu20.04.tar.gz
49+
echo "Extracting Swift..."
50+
tar xzf swift.tar.gz
51+
52+
# Find the extracted directory
53+
SWIFT_DIR=$(find . -maxdepth 1 -name "swift-6.0*-ubuntu20.04" -type d | head -1)
54+
echo "Swift directory: $SWIFT_DIR"
3755
3856
# Add to PATH
39-
echo "$PWD/swift-6.0.3-RELEASE-ubuntu20.04/usr/bin" >> $GITHUB_PATH
57+
echo "$PWD/$SWIFT_DIR/usr/bin" >> $GITHUB_PATH
4058
4159
# Verify installation
42-
$PWD/swift-6.0.3-RELEASE-ubuntu20.04/usr/bin/swift --version
60+
"$PWD/$SWIFT_DIR/usr/bin/swift" --version
4361
4462
- name: Verify Swift installation
4563
run: |

0 commit comments

Comments
 (0)