name: WASM

on:
  workflow_dispatch:
  pull_request:
    branches:
      - master
      - develop
  release:
    types:
      - published

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build-pyodide:
    name: Pyodide cibuildwheel
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: true
          fetch-depth: 0

      - uses: pypa/cibuildwheel@v3.3
        env:
          CIBW_PLATFORM: pyodide

      - name: Upload wheels
        uses: actions/upload-artifact@v6
        with:
          name: pyodide-wheel
          path: wheelhouse/*.whl
