@@ -29,7 +29,41 @@ concurrency:
2929 cancel-in-progress : true
3030
3131jobs :
32+ build-wasm :
33+ runs-on : ubuntu-latest
34+ steps :
35+ - uses : actions/checkout@v4
36+ with :
37+ sparse-checkout : |
38+ fix-python-soname
39+ sparse-checkout-cone-mode : false
40+ - name : Install Rust toolchain
41+ uses : dtolnay/rust-toolchain@stable
42+ with :
43+ targets : wasm32-wasip1
44+ - name : Cache cargo
45+ uses : actions/cache@v4
46+ with :
47+ path : |
48+ ~/.cargo/registry/index/
49+ ~/.cargo/registry/cache/
50+ ~/.cargo/git/db/
51+ .cargo-cache
52+ target/
53+ key : wasm-cargo-cache-${{ hashFiles('**/Cargo.lock') }}
54+ - name : Build WASM
55+ working-directory : fix-python-soname
56+ run : |
57+ cargo build --target wasm32-wasip1 --release
58+ cp target/wasm32-wasip1/release/fix-python-soname.wasm ../fix-python-soname.wasm
59+ - name : Upload WASM artifacts
60+ uses : actions/upload-artifact@v4
61+ with :
62+ name : wasm-bindings
63+ path : fix-python-soname.wasm
64+
3265 build :
66+ needs : build-wasm
3367 strategy :
3468 fail-fast : false
3569 matrix :
5791 runs-on : ${{ matrix.settings.host }}
5892 steps :
5993 - uses : actions/checkout@v4
94+ - name : Download WASM artifacts
95+ uses : actions/download-artifact@v4
96+ with :
97+ name : wasm-bindings
98+ path : .
6099 - uses : webfactory/ssh-agent@v0.9.0
61100 with :
62101 ssh-private-key : |
@@ -149,7 +188,6 @@ jobs:
149188 git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git"
150189 git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git"
151190
152- npm run build:wasm
153191 ${{ matrix.settings.build }}
154192 - name : Build
155193 run : ${{ matrix.settings.build }}
@@ -431,7 +469,7 @@ jobs:
431469 exit 1
432470 fi
433471 shell : bash
434- - name : Copy fix-python-soname files to Linux packages
472+ - name : Copy fix-python-soname files to Linux and macOS packages
435473 run : |
436474 # Find the WASM and JS files from Linux artifacts
437475 WASM_FILE=$(find artifacts -name "fix-python-soname.wasm" | head -n 1)
@@ -441,9 +479,9 @@ jobs:
441479 echo "Found WASM file: $WASM_FILE"
442480 echo "Found JS file: $JS_FILE"
443481
444- # Copy to all Linux npm directories
482+ # Copy to all Linux and macOS npm directories
445483 for dir in npm/*/; do
446- if [[ "$dir" == *"linux"* ]]; then
484+ if [[ "$dir" == *"linux"* ]] || [[ "$dir" == *"darwin"* ]] ; then
447485 echo "Copying files to $dir"
448486 cp "$WASM_FILE" "$dir"
449487 cp "$JS_FILE" "$dir"
0 commit comments