From 8a3d7906fe0e6e02c32198f4d6a41627ff7c28f9 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 9 Nov 2026 13:01:02 -0500 Subject: [PATCH 1/4] ci(pyodide): build wheels for Pyodide 0.29.5 and 314.0.7 Build one wheel per Pyodide ABI with a matrix, and keep the wheels that are already published so older shinylive releases can still download them. --- .github/workflows/pyodide.yml | 47 +++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index bbc66e9a..a345ae8f 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -6,13 +6,24 @@ on: workflow_dispatch: env: - PYTHON_VERSION: 3.12.2 - PYODIDE_VERSION: 0.26.3 - EMSCRIPTEN_VERSION: 3.1.58 + PYODIDE_BUILD_VERSION: 0.39.3 jobs: build-pyodide: runs-on: macos-latest + strategy: + fail-fast: false + matrix: + # Each Pyodide ABI needs its own wheel. The host Python has to match the + # Python that Pyodide ships, and Emscripten has to match its build. + # `pyodide xbuildenv search --all` lists all three for each release. + include: + - pyodide: 0.29.5 + python: "3.13" + emscripten: 4.0.9 + - pyodide: 314.0.7 + python: "3.14" + emscripten: 5.0.3 steps: - uses: actions/checkout@v4 with: @@ -20,24 +31,38 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: ${{ matrix.python }} - run: | - # Match pyodide version - # https://github.com/posit-dev/shinylive/blob/main/Makefile#L20C19-L20C25 - pip install pyodide-build==0.26.3 - if [ -z "${{ env.EMSCRIPTEN_VERSION }}"]; then - echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV - fi + pip install pyodide-build==${{ env.PYODIDE_BUILD_VERSION }} + pyodide xbuildenv install ${{ matrix.pyodide }} - uses: mymindstorm/setup-emsdk@v14 with: - version: ${{ env.EMSCRIPTEN_VERSION }} + version: ${{ matrix.emscripten }} - run: pyodide build + - uses: actions/upload-artifact@v4 + with: + name: wheel-${{ matrix.pyodide }} + path: dist/*.whl + + deploy: + needs: build-pyodide + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheel-* + path: dist + merge-multiple: true + - name: Deploy uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist + # Add to the wheels already published instead of replacing them. + # Released versions of shinylive download older wheels from here. + keep_files: true From 77c0652c179c680e300e3a8c9896a066dc853244 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 9 Nov 2026 13:07:53 -0500 Subject: [PATCH 2/4] ci(pyodide): keep building the cp312 wheel for Pyodide 0.26.3 Released versions of shinylive download it. It needs the old pyodide-build, since newer versions name the wheel pyemscripten_2024_0 instead of pyodide_2024_0. --- .github/workflows/pyodide.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index a345ae8f..1fdb6844 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -5,9 +5,6 @@ on: branches: [dev] workflow_dispatch: -env: - PYODIDE_BUILD_VERSION: 0.39.3 - jobs: build-pyodide: runs-on: macos-latest @@ -18,12 +15,21 @@ jobs: # Python that Pyodide ships, and Emscripten has to match its build. # `pyodide xbuildenv search --all` lists all three for each release. include: + # Wheel used by shinylive releases before the move off Pyodide 0.27. + # Newer pyodide-build names it `pyemscripten_2024_0` instead of + # `pyodide_2024_0`, so keep the old one. It needs `wheel<0.46`. + - pyodide: 0.26.3 + python: "3.12" + emscripten: 3.1.58 + pyodide-build: 'pyodide-build==0.26.3 "wheel<0.46"' - pyodide: 0.29.5 python: "3.13" emscripten: 4.0.9 + pyodide-build: "pyodide-build==0.39.3" - pyodide: 314.0.7 python: "3.14" emscripten: 5.0.3 + pyodide-build: "pyodide-build==0.39.3" steps: - uses: actions/checkout@v4 with: @@ -34,7 +40,7 @@ jobs: python-version: ${{ matrix.python }} - run: | - pip install pyodide-build==${{ env.PYODIDE_BUILD_VERSION }} + pip install ${{ matrix.pyodide-build }} pyodide xbuildenv install ${{ matrix.pyodide }} - uses: mymindstorm/setup-emsdk@v14 From 4170cde964184ca6d15004380656ef0b991eb8a9 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 9 Nov 2026 13:12:29 -0500 Subject: [PATCH 3/4] ci(pyodide): build on pull requests without deploying --- .github/workflows/pyodide.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index 1fdb6844..916c7324 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -3,6 +3,8 @@ name: Build pyodide wheel on: push: branches: [dev] + pull_request: + branches: [dev] workflow_dispatch: jobs: @@ -55,6 +57,9 @@ jobs: path: dist/*.whl deploy: + # Pull requests only build, so the wheels can be checked before they are + # published. + if: github.event_name != 'pull_request' needs: build-pyodide runs-on: ubuntu-latest steps: From a08be2c75a82f9747efd3cde45008e0d04f4542d Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 9 Nov 2026 14:54:18 -0500 Subject: [PATCH 4/4] ci(pyodide): build on Intel macOS runners GitHub is short on macOS arm64 runners, and matrix jobs waiting for one were cancelled. Linux isn't an option: setup.py passes -std=gnu++0x to the C file there, which Emscripten rejects. --- .github/workflows/pyodide.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index 916c7324..876a7ca5 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -9,7 +9,10 @@ on: jobs: build-pyodide: - runs-on: macos-latest + # macOS because setup.py's Linux flags break the Emscripten build. Intel + # because GitHub is short on macOS arm64 runners, and jobs waiting for one + # were cancelled. + runs-on: macos-15-intel strategy: fail-fast: false matrix: