Skip to content

Commit e243a37

Browse files
authored
Use Emscripten in WASM build workflow (#16)
1 parent 9832932 commit e243a37

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

.github/workflows/build-wasm.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@ jobs:
1414
- name: Check out repository
1515
uses: actions/checkout@v4
1616

17-
- name: Download wasi-sdk
18-
run: |
19-
WASI_TAG_VERSION=20
20-
WASI_ASSET_VERSION="${WASI_TAG_VERSION}.0"
21-
WASI_RELEASE="wasi-sdk-${WASI_TAG_VERSION}"
22-
WASI_PACKAGE="wasi-sdk-${WASI_ASSET_VERSION}-linux.tar.gz"
23-
curl -L "https://github.com/WebAssembly/wasi-sdk/releases/download/${WASI_RELEASE}/${WASI_PACKAGE}" -o wasi-sdk.tar.gz
24-
tar -xzf wasi-sdk.tar.gz
25-
mv "wasi-sdk-${WASI_ASSET_VERSION}" wasi-sdk
17+
- name: Set up Emscripten SDK
18+
uses: mymindstorm/setup-emsdk@v12
19+
with:
20+
version: 3.1.50
2621

2722
- name: Compile C89 hello world to WebAssembly
2823
run: |
29-
./wasi-sdk/bin/clang \
30-
--sysroot=./wasi-sdk/share/wasi-sysroot \
24+
emcc \
3125
-std=c89 \
26+
-s STANDALONE_WASM=1 \
3227
wasm/hello.c \
3328
-o wasm/hello.wasm
3429

0 commit comments

Comments
 (0)