@@ -15,16 +15,31 @@ jobs:
1515 - uses : actions/checkout@v4
1616
1717 # Install the specific Swift development snapshot required for WASM builds
18+ # Toolchain comes from SwiftWasm releases (includes WASM support)
1819 - name : Install Swift Toolchain
1920 run : |
20- SWIFT_URL="https://download. swift.org/development/ubuntu2404 /swift-${SWIFT_TOOLCHAIN_VERSION}/swift-${SWIFT_TOOLCHAIN_VERSION}-ubuntu24.04 .tar.gz"
21+ SWIFT_URL="https://github.com/swiftwasm/ swift/releases/download /swift-wasm- ${SWIFT_TOOLCHAIN_VERSION}/swift-wasm- ${SWIFT_TOOLCHAIN_VERSION}-ubuntu24.04_x86_64 .tar.gz"
2122 echo "Downloading Swift toolchain from: $SWIFT_URL"
22- curl -sL "$SWIFT_URL" | tar xz --strip-components=1 -C /opt
23- echo "/opt/usr/bin" >> $GITHUB_PATH
23+ mkdir -p /opt/swift
24+ curl -sL "$SWIFT_URL" | tar xz --strip-components=1 -C /opt/swift
25+ echo "/opt/swift/usr/bin" >> $GITHUB_PATH
2426
2527 - name : Verify Swift Installation
2628 run : swift --version
2729
30+ # Install the matching WASM SDK
31+ - name : Install WASM SDK
32+ run : |
33+ SDK_URL="https://github.com/swiftwasm/swift/releases/download/swift-wasm-${SWIFT_TOOLCHAIN_VERSION}/swift-wasm-${SWIFT_TOOLCHAIN_VERSION}-wasm32-unknown-wasip1-threads.artifactbundle.zip"
34+ echo "Installing WASM SDK from: $SDK_URL"
35+ swift sdk install "$SDK_URL" || true
36+ echo "Installed SDKs:"
37+ swift sdk list
38+
39+ # Set environment variable to signal the correct toolchain is installed
40+ - name : Set Toolchain Environment
41+ run : echo "SWIFT_WASM_TOOLCHAIN_VERIFIED=1" >> $GITHUB_ENV
42+
2843 # Wasmtime is required because `swift test` doesn't work for WebAssembly targets.
2944 # For WASM, we must build tests separately and run them with a WASM runtime.
3045 # See: https://book.swiftwasm.org/getting-started/testing.html
0 commit comments