Skip to content

Commit f78c0d5

Browse files
committed
ci: Add wasm sdk installation script.
1 parent 91599e9 commit f78c0d5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

scripts/install_wasm_sdk.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===//
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2025 Apple Inc. and the Swift.org project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
## See CONTRIBUTORS.txt for the list of Swift.org project authors
11+
##
12+
## SPDX-License-Identifier: Apache-2.0
13+
##
14+
##===----------------------------------------------------------------------===//
15+
16+
# TODO: Remove this file once there is a valid reference available in github from
17+
# this PR: https://github.com/apple/swift-nio/pull/3159
18+
19+
set -euo pipefail
20+
21+
version="$(swiftc --version | head -n1)"
22+
tag="$(curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/tag-by-version.json" | jq -e -r --arg v "$version" '.[$v] | .[-1]')"
23+
curl -sL "https://raw.githubusercontent.com/swiftwasm/swift-sdk-index/refs/heads/main/v1/builds/$tag.json" | jq -r '.["swift-sdks"]["wasm32-unknown-wasi"] | "swift sdk install \"\(.url)\" --checksum \"\(.checksum)\""' | sh -x

0 commit comments

Comments
 (0)