@@ -29,7 +29,40 @@ 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+ fetch-depth : 0
38+ - name : Install Rust toolchain
39+ uses : dtolnay/rust-toolchain@stable
40+ with :
41+ targets : wasm32-wasip1
42+ - name : Cache cargo
43+ uses : actions/cache@v4
44+ with :
45+ path : |
46+ ~/.cargo/registry/index/
47+ ~/.cargo/registry/cache/
48+ ~/.cargo/git/db/
49+ .cargo-cache
50+ target/
51+ key : wasm-cargo-cache-${{ hashFiles('**/Cargo.lock') }}
52+ - name : Build WASM
53+ run : |
54+ cargo build --manifest-path $PWD/fix-python-soname/Cargo.toml --target wasm32-wasip1 --release
55+ cp fix-python-soname/target/wasm32-wasip1/release/fix-python-soname.wasm .
56+ - name : Upload WASM artifacts
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : wasm-bindings
60+ path : |
61+ fix-python-soname.wasm
62+ fix-python-soname.js
63+
3264 build :
65+ needs : build-wasm
3366 strategy :
3467 fail-fast : false
3568 matrix :
5790 runs-on : ${{ matrix.settings.host }}
5891 steps :
5992 - uses : actions/checkout@v4
93+ - name : Download WASM artifacts
94+ uses : actions/download-artifact@v4
95+ with :
96+ name : wasm-bindings
97+ path : .
6098 - uses : webfactory/ssh-agent@v0.9.0
6199 with :
62100 ssh-private-key : |
@@ -149,7 +187,6 @@ jobs:
149187 git config --global url."ssh://git@github.com-http-handler/platformatic/http-handler.git".insteadOf "ssh://git@github.com/platformatic/http-handler.git"
150188 git config --global url."ssh://git@github.com-http-rewriter/platformatic/http-rewriter.git".insteadOf "ssh://git@github.com/platformatic/http-rewriter.git"
151189
152- npm run build:wasm
153190 ${{ matrix.settings.build }}
154191 - name : Build
155192 run : ${{ matrix.settings.build }}
@@ -431,7 +468,7 @@ jobs:
431468 exit 1
432469 fi
433470 shell : bash
434- - name : Copy fix-python-soname files to Linux packages
471+ - name : Copy fix-python-soname files to Linux and macOS packages
435472 run : |
436473 # Find the WASM and JS files from Linux artifacts
437474 WASM_FILE=$(find artifacts -name "fix-python-soname.wasm" | head -n 1)
@@ -441,9 +478,9 @@ jobs:
441478 echo "Found WASM file: $WASM_FILE"
442479 echo "Found JS file: $JS_FILE"
443480
444- # Copy to all Linux npm directories
481+ # Copy to all Linux and macOS npm directories
445482 for dir in npm/*/; do
446- if [[ "$dir" == *"linux"* ]]; then
483+ if [[ "$dir" == *"linux"* ]] || [[ "$dir" == *"darwin"* ]] ; then
447484 echo "Copying files to $dir"
448485 cp "$WASM_FILE" "$dir"
449486 cp "$JS_FILE" "$dir"
0 commit comments