step 1 login to github and open new project call wasm
name: Compile C to WebAssembly
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
shell: bash
- name: Compile C to WebAssembly
run: |
source emsdk/emsdk_env.sh
emcc hello.c -o hello.html
shell: bash
- name: Upload WebAssembly files
uses: actions/upload-artifact@v4
with:
name: wasm
path: hello.*




No comments:
Post a Comment