https://github.com/bytecodealliance/setup-wasi-sdk-action
GitHub action to install wasi-sdk
https://github.com/bytecodealliance/setup-wasi-sdk-action
Last synced: 27 days ago
JSON representation
GitHub action to install wasi-sdk
- Host: GitHub
- URL: https://github.com/bytecodealliance/setup-wasi-sdk-action
- Owner: bytecodealliance
- License: apache-2.0
- Created: 2025-12-10T18:13:36.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-02-25T20:25:04.000Z (2 months ago)
- Last Synced: 2026-03-31T00:38:36.589Z (29 days ago)
- Language: Python
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# `setup-wasi-sdk-action`
A [Bytecode Alliance](https://bytecodealliance.org/) project
[](https://github.com/bytecodealliance/setup-wasi-sdk-action/actions/workflows/cross-platform.yml)
[](https://github.com/bytecodealliance/setup-wasi-sdk-action/actions/workflows/cmake.yml)
[](https://github.com/bytecodealliance/setup-wasi-sdk-action/actions/workflows/env-safe.yml)
[](https://github.com/bytecodealliance/setup-wasi-sdk-action/actions/workflows/unit-tests.yml)
This GitHub Action will install the [WASI SDK] toolchain for compiling to WebAssembly on a GitHub
runner:
- Downloads and installs the specified version of WASI SDK (see [releases])
- Optionally adds WASI SDK to the GitHub runner `PATH`
- Sets up [environment variables] and [output variables]
[WASI SDK]: https://github.com/WebAssembly/wasi-sdk
[releases]: https://github.com/WebAssembly/wasi-sdk/releases
[environment variables]: #environment-variables
[output variables]: #output-variables
### Usage
```yaml
- uses: bytecodealliance/setup-wasi-sdk-action@v1
# Now, use `clang` or `$CC` to compile C/C++ to WebAssembly:
- run: $CC hello.c -o hello.wasm
```
For more advanced usage, see the following examples:
- [Use with CMake](.github/workflows/cmake.yml)
- [Use without overriding environment](.github/workflows/env-safe.yml)
### Inputs
| Input | Description | Required | Default |
| -------------- | -------------------------------------------| -------- | ----------------------------- |
| `version` | WASI SDK version to install (e.g., `25`) | No | `latest` |
| `install-path` | Directory to install WASI SDK to | No | `$RUNNER_TOOL_CACHE/wasi-sdk` |
| `add-to-path` | Add WASI SDK `bin` directory to the `PATH` | No | `true` |
| `github-token` | GitHub token for API requests | No | `${{ github.token }}` |
Note that passing `latest` as the `version` will attempt to retrieve the latest [release
tag][releases]. See GitHub's [variables reference] for a description of `RUNNER_TOOL_CACHE`; other
`setup-*` actions store their artifacts here.
[variables reference]: https://docs.github.com/en/actions/reference/workflows-and-actions/variables
### Outputs
| Output | Description |
| ------------------ | ---------------------------------------- |
| `wasi-sdk-path` | Path to the installed WASI SDK toolchain |
| `wasi-sdk-version` | Version of WASI SDK that was installed |
| `clang-path` | Path to the `clang` executable |
| `sysroot-path` | Path to the WASI `sysroot` |
### Environment Variables
The action always sets the following environment variables:
- `WASI_SDK_PATH`: Path to the WASI SDK installation
- `WASI_SDK_VERSION`: Version of WASI SDK that was installed
When `add-to-path` is `true` (the default), the action also adds the WASI SDK `bin` directory to
the GitHub runner `PATH` and sets:
- `CC`: Clang compiler with WASI sysroot configured
- `CXX`: Clang++ compiler with WASI sysroot configured
### Platform Support
This action should be usable on all GitHub runners; open an [issue] if this is not the case.
[issue]: https://github.com/bytecodealliance/setup-wasi-sdk-action/issues
| OS | Architecture | Support |
| ------- | ------------ | ------- |
| Linux | x86_64 | ✅ |
| Linux | arm64 | ✅ |
| macOS | Any | ✅ |
| Windows | Any | ✅ |
### License
`setup-wasi-sdk-action` is released under the [Apache License Version 2.0][license]. By contributing to
the project, you agree to the license and copyright terms therein and release your contribution
under these terms.
[license]: LICENSE