Add main entry point to standalone wasm module (#17) #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build WebAssembly Hello World | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Emscripten SDK | |
| uses: mymindstorm/setup-emsdk@v12 | |
| with: | |
| version: 3.1.50 | |
| - name: Compile C89 hello world to WebAssembly | |
| run: | | |
| emcc \ | |
| -std=c89 \ | |
| -s STANDALONE_WASM=1 \ | |
| wasm/hello.c \ | |
| -o wasm/hello.wasm | |
| - name: Upload WebAssembly artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hello-wasm | |
| path: wasm/hello.wasm |