build-wasm #123
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-wasm | |
| on: [workflow_call, workflow_dispatch] | |
| env: | |
| PYODIDE_VERSION: "0.28.3" | |
| RUST_VERSION: "nightly-2025-02-01" | |
| PYTHON_VERSION: "3.13" | |
| jobs: | |
| build-wasm: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Install Nightly Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| components: rust-src, rustfmt, clippy | |
| - name: Install Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Python packages | |
| run: pip install -r python/requirements.txt | |
| #- name: Cache Emscripten | |
| # id: cache-emsdk | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: pyodide/emsdk | |
| # key: emscripten-${{ runner.os }}-pyodide-${{ env.PYODIDE_VERSION }} | |
| # restore-keys: | | |
| # emscripten-${{ runner.os }}- | |
| - name: Build Emscripten for Pyodide | |
| if: steps.cache-emsdk.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| git clone --branch ${{ env.PYODIDE_VERSION }} --depth 1 https://github.com/pyodide/pyodide.git pyodide | |
| cd pyodide | |
| make emsdk | |
| - name: Build wheel | |
| run: | | |
| source pyodide/emsdk/emsdk/emsdk_env.sh | |
| make build-wasm | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pyxel-wasm | |
| path: dist/* |