Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: ['23', '24', '25', 'latest']
# SDK 23 introduced ARM64 on Linux and macOS (which also changed the URL format to its current form).
# SDK 26 introduced Windows on ARM64.
# arm64-linux, arm64-macos, arm64-windows, x86_64-linux, x86_64-macos, x86_64-windows
os: [ubuntu-24.04-arm, macos-latest, windows-11-arm, ubuntu-latest, macos-15-intel, windows-latest]
version: ['26', 'latest']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
29 changes: 22 additions & 7 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ def calculate_version_and_tag(version: str):
('30.0', 'wasi-sdk-30')
>>> calculate_version_and_tag('30.10')
('30.10', 'wasi-sdk-30.10')
>>> latest = calculate_version_and_tag('latest')
>>> float(latest[0]) > 0
True
>>> latest[1].startswith('wasi-sdk-')
True
>>> float(latest[1].removeprefix('wasi-sdk-')) > 0
True
"""
if version == 'latest':
tag = retrieve_latest_tag()
Expand All @@ -74,14 +81,22 @@ def calculate_artifact_url(version: str, tag: str, arch: str, os_name: str):
'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz'
>>> calculate_artifact_url('25.1', 'wasi-sdk-25.1', 'arm64', 'Darwin')
'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25.1/wasi-sdk-25.1-arm64-macos.tar.gz'
>>> calculate_artifact_url('30.0', 'wasi-sdk-30', 'aarch64', 'Linux')
'https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-30/wasi-sdk-30.0-arm64-linux.tar.gz'
"""
base = 'https://github.com/WebAssembly/wasi-sdk/releases/download'
if os_name == 'Darwin':
os_name = 'macos'
else:
os_name = os_name.lower()
if arch.lower() == 'amd64':
arch = 'x86_64'
match os_name.lower():
case 'darwin':
os_name = 'macos'
case rest:
os_name = rest
match arch.lower():
case 'amd64':
arch = 'x86_64'
case 'aarch64':
arch = 'arm64'
case rest:
arch = rest
return f'{base}/{tag}/wasi-sdk-{version}-{arch}-{os_name}.tar.gz'


Expand Down Expand Up @@ -205,7 +220,7 @@ def main(version: str, install_dir: str, add_to_path: bool):
logging.getLogger().name = os.path.basename(__file__)

if args.test_only:
failures, _ = doctest.testmod()
failures, _ = doctest.testmod(verbose=args.verbose)
if failures:
sys.exit(1)
else:
Expand Down