1414 runs-on : ubuntu-latest
1515 env :
1616 UV_PYTHON : " 3.13"
17+ PYODIDE_VERSION : " 0.29.3"
1718 concurrency :
1819 group : release-ducpy
1920 cancel-in-progress : false
@@ -69,49 +70,18 @@ jobs:
6970 fi
7071 working-directory : ./packages/ducpy
7172
72- - name : Install Pyodide build tooling
73+ - name : Setup Pyodide build tooling
7374 id : pyodide_tooling
7475 if : steps.release.outputs.status == 'success'
75- run : |
76- python -m pip install --upgrade pip
77- pip install "pyodide-build==0.29.3" "wheel<0.44"
78- pyodide xbuildenv install 0.29.3
79- XBUILD_DIR="$(pwd)/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
80- if [ ! -d "$XBUILD_DIR/pyodide-root" ]; then
81- XBUILD_DIR="$HOME/.pyodide-xbuildenv-0.29.3/0.29.3/xbuildenv"
82- fi
83- export PYODIDE_ROOT="$XBUILD_DIR/pyodide-root"
84-
85- # Get Emscripten version (needed for emsdk setup)
86- EMSCRIPTEN_VERSION=$(python3 -c "
87- import os
88- os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
89- from pyodide_build.build_env import get_build_environment_vars
90- from pathlib import Path
91- print(get_build_environment_vars(Path(os.environ['PYODIDE_ROOT']))['PYODIDE_EMSCRIPTEN_VERSION'])
92- ")
93- echo "emscripten_version=${EMSCRIPTEN_VERSION}" >> $GITHUB_OUTPUT
94-
95- # Verify wheel platform tag is pyodide_* (not pyemscripten_*)
96- TAG=$(python3 -c "
97- import os
98- os.environ['PYODIDE_ROOT'] = '$PYODIDE_ROOT'
99- from pyodide_build.build_env import wheel_platform
100- print(wheel_platform())
101- ")
102- echo "Pyodide wheel platform tag: $TAG"
103- if echo "$TAG" | grep -q "pyodide_"; then
104- echo "Wheel platform tag is pyodide_* — OK"
105- else
106- echo "ERROR: Wheel platform tag is '$TAG', expected pyodide_*"
107- exit 1
108- fi
76+ uses : ./.github/actions/setup-pyodide-build
77+ with :
78+ pyodide-version : ${{ env.PYODIDE_VERSION }}
10979
11080 - name : Setup Emscripten SDK
11181 if : steps.release.outputs.status == 'success'
11282 uses : mymindstorm/setup-emsdk@v14
11383 with :
114- version : ${{ steps.pyodide_tooling.outputs.emscripten_version }}
84+ version : ${{ steps.pyodide_tooling.outputs.emscripten-version }}
11585
11686 - name : Setup Rust nightly for Pyodide
11787 if : steps.release.outputs.status == 'success'
@@ -122,13 +92,34 @@ jobs:
12292 - name : Build Pyodide wheel
12393 if : steps.release.outputs.status == 'success'
12494 working-directory : ./packages/ducpy
95+ env :
96+ PYODIDE_ROOT : ${{ steps.pyodide_tooling.outputs.pyodide-root }}
12597 run : |
12698 TAG=$(git describe --tags --abbrev=0 --match 'ducpy@*')
12799 VERSION="${TAG#ducpy@}"
128100 echo "Building Pyodide wheel for version ${VERSION}"
129101 uv run python scripts/sync_schema.py
130102 RUSTUP_TOOLCHAIN=nightly SETUPTOOLS_SCM_PRETEND_VERSION="${VERSION}" pyodide build --outdir dist
131103
104+ - name : Verify wheel platform tag
105+ if : steps.release.outputs.status == 'success'
106+ working-directory : ./packages/ducpy
107+ run : |
108+ WHEEL=$(find dist -name '*.whl' | head -1)
109+ if [ -z "$WHEEL" ]; then
110+ echo "ERROR: No wheel found in dist/"
111+ exit 1
112+ fi
113+ echo "Built wheel: $WHEEL"
114+ EXPECTED_TAG="${{ steps.pyodide_tooling.outputs.wheel-platform-tag }}"
115+ if echo "$WHEEL" | grep -q "$EXPECTED_TAG"; then
116+ echo "Wheel filename contains expected tag '$EXPECTED_TAG' — OK"
117+ else
118+ echo "ERROR: Wheel filename does not contain expected tag '$EXPECTED_TAG'"
119+ echo "This means the built wheel is incompatible with the Pyodide ${{ env.PYODIDE_VERSION }} runtime."
120+ exit 1
121+ fi
122+
132123 - name : Upload wheels to GitHub release
133124 if : steps.release.outputs.status == 'success'
134125 env :
@@ -158,4 +149,4 @@ jobs:
158149 event-type : trigger-web-deployment
159150 token : ${{ secrets.GITHUB_TOKEN }}
160151 client-payload : |
161- {"source": "release-ducpy", "web_changed": "false", "success": "true"}
152+ {"source": "release-ducpy", "web_changed": "false", "success": "true"}
0 commit comments