@@ -223,10 +223,49 @@ jobs:
223223 name : emlearn-micropython-build-macos
224224 path : dist
225225
226+ build-webassembly :
227+ runs-on : ubuntu-latest
228+ env :
229+ MPY_DIR : ./micropython
230+ MICROPYTHON_BIN : ./micropython/ports/unix/build-nomodules/micropython
231+ steps :
232+ - uses : actions/checkout@v4
233+ with :
234+ submodules : true
235+ - name : Install OS dependencies
236+ run : sudo add-apt-repository universe
237+ - uses : actions/setup-python@v5
238+ with :
239+ python-version : ' 3.10'
240+ - uses : actions/checkout@v4
241+ with :
242+ repository : jonnor/micropython
243+ path : micropython
244+ ref : webassembly-extra-cflags
245+ - name : Install Python dependencies
246+ run : pip install -r requirements.txt
247+ - name : Setup MicroPython
248+ working-directory : micropython
249+ run : |
250+ npm install terser
251+ git clone https://github.com/emscripten-core/emsdk.git
252+ (cd emsdk && ./emsdk install 4.0.21 && ./emsdk activate 4.0.21)
253+ make -C mpy-cross CFLAGS_EXTRA=-Wno-error
254+ - name : Build Webassembly
255+ run : |
256+ source ${MPY_DIR}/emsdk/emsdk_env.sh
257+ make -C ${MPY_DIR}/ports/webassembly submodules
258+ make webassembly V=1
259+ - name : Archive dist artifacts
260+ uses : actions/upload-artifact@v4
261+ with :
262+ name : emlearn-micropython-build-webassembly
263+ path : dist
264+
226265 deploy-pages :
227266 permissions :
228267 contents : write
229- needs : [build-linux, build-arm, build-esp32, build-macos, build-riscv]
268+ needs : [build-linux, build-arm, build-esp32, build-macos, build-riscv, build-webassembly ]
230269 runs-on : ubuntu-latest
231270
232271 steps :
0 commit comments