@@ -144,7 +144,7 @@ jobs:
144144
145145 # Build the main binary
146146 ${{ matrix.settings.build }}
147-
147+
148148 # Build the WASI module for Linux targets
149149 if [ "${{ matrix.settings.target }}" = "x86_64-unknown-linux-gnu" ]; then
150150 echo "===== Building fix-python-soname WASI module ====="
@@ -181,16 +181,25 @@ jobs:
181181 ls -la target/wasm32-wasip1/ 2>/dev/null || echo "No wasm32-wasip1 directory"
182182 ls -la target/wasm32-wasip1/release/ 2>/dev/null || echo "No release directory"
183183 echo "===== Copying WASM to root ====="
184- # WASM binaries might not have .wasm extension, try both
184+ # Check both local and parent target directories (workspace)
185185 if [ -f "target/wasm32-wasip1/release/fix-python-soname.wasm" ]; then
186186 cp target/wasm32-wasip1/release/fix-python-soname.wasm ..
187- echo "Copied .wasm file"
187+ echo "Copied .wasm file from local target"
188+ elif [ -f "../target/wasm32-wasip1/release/fix-python-soname.wasm" ]; then
189+ cp ../target/wasm32-wasip1/release/fix-python-soname.wasm ..
190+ echo "Copied .wasm file from workspace target"
188191 elif [ -f "target/wasm32-wasip1/release/fix-python-soname" ]; then
189192 cp target/wasm32-wasip1/release/fix-python-soname ../fix-python-soname.wasm
190- echo "Copied binary file as .wasm"
193+ echo "Copied binary file as .wasm from local target"
194+ elif [ -f "../target/wasm32-wasip1/release/fix-python-soname" ]; then
195+ cp ../target/wasm32-wasip1/release/fix-python-soname ../fix-python-soname.wasm
196+ echo "Copied binary file as .wasm from workspace target"
191197 else
192198 echo "ERROR: No WASM or binary file found"
193- ls -la target/wasm32-wasip1/release/ 2>/dev/null || echo "No release directory"
199+ echo "Local target:"
200+ ls -la target/wasm32-wasip1/release/ 2>/dev/null || echo "No local release directory"
201+ echo "Workspace target:"
202+ ls -la ../target/wasm32-wasip1/release/ 2>/dev/null || echo "No workspace release directory"
194203 exit 1
195204 fi
196205 cd ..
@@ -408,25 +417,29 @@ jobs:
408417 image : ${{ steps.docker.outputs.IMAGE }}
409418 options : -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }} -e CI=true -e GITHUB_ACTIONS=true
410419 run : |
420+ # Install Python 3.x
421+ apt-get update -y
422+ apt-get install -y python3 python3-dev patchelf
423+
411424 corepack disable
412425 npm i -gf pnpm
413426 pnpm install --prefer-offline
414-
427+
415428 # Check what files we have
416429 echo "Current directory contents:"
417430 ls -la
418-
431+
419432 # Look for WASM files
420433 echo "Looking for WASM files:"
421434 find . -name "*.wasm" -type f | head -20
422-
435+
423436 # Debug: Check Python version and libraries available
424437 echo "Checking Python installation..."
425438 which python3 || true
426439 python3 --version || true
427440 echo "Looking for Python libraries..."
428441 find /usr/lib -name "libpython*.so*" 2>/dev/null | head -20 || true
429-
442+
430443 # Try to download the WASM file if not present
431444 if [ ! -f "fix-python-soname.wasm" ]; then
432445 echo "WASM file not found locally. Checking if we can get it from artifacts..."
@@ -447,7 +460,7 @@ jobs:
447460 echo "fix-python-soname.js not found"
448461 fi
449462 fi
450-
463+
451464 pnpm test
452465
453466 publish :
@@ -478,11 +491,11 @@ jobs:
478491 # Find the WASM and JS files from Linux artifacts
479492 WASM_FILE=$(find artifacts -name "fix-python-soname.wasm" | head -n 1)
480493 JS_FILE=$(find artifacts -name "fix-python-soname.js" | head -n 1)
481-
494+
482495 if [ -n "$WASM_FILE" ] && [ -n "$JS_FILE" ]; then
483496 echo "Found WASM file: $WASM_FILE"
484497 echo "Found JS file: $JS_FILE"
485-
498+
486499 # Copy to all Linux npm directories
487500 for dir in npm/*/; do
488501 if [[ "$dir" == *"linux"* ]]; then
0 commit comments