Skip to content

Expose both the skin property and the setSkin method interface for the Spine skeleton across native and web implementations. #20408

Expose both the skin property and the setSkin method interface for the Spine skeleton across native and web implementations.

Expose both the skin property and the setSkin method interface for the Spine skeleton across native and web implementations. #20408

Workflow file for this run

name: <Web> npm test
on: [push, pull_request]
# github.head_ref is only defined on pull_request events
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
npm_test:
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.41
- name: Verify
run: |
which emcc
emcc -v
- name: Install ninja
run: |
if ! command -v ninja &> /dev/null; then
echo "Ninja not found, installing..."
# sudo apt update
sudo apt install ninja-build
else
echo "Ninja is already installed."
fi
which ninja
- name: Download external
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos/cocos-engine-external native/external
- name: Apply emscripten patches
run: |
echo "--------------------------------- Save bind.cpp ---------------------------------"
cp $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp.bak
echo "--------------------------------- Apply embind bind.cpp patches ---------------------------------"
cp -f ./.github/workflows/emscripten-patches/embind/bind.cpp $EMSDK/upstream/emscripten/system/lib/embind/
echo "--------------------------------- Apply patches DONE! ---------------------------------"
cat $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp
- name: Build Spine 3.8 WASM
run: |
cd ./native/cocos/editor-support/spine-wasm
rm -rf build-wasm
mkdir build-wasm
cd build-wasm
emcmake cmake .. -GNinja
ninja
ls -l
- name: Build Spine 3.8 ASMJS
run: |
cd ./native/cocos/editor-support/spine-wasm
sed -i 's/set(BUILD_WASM 1)/set(BUILD_WASM 0)/g' CMakeLists.txt
rm -rf build-asmjs
mkdir build-asmjs
cd build-asmjs
emcmake cmake .. -GNinja
ninja
ls -l
- name: Copy Spine 3.8 files to external directory
run: |
SPINE_VERSION="3.8"
DIST_PATH="dist/3.8"
rm -rf $DIST_PATH
mkdir -p $DIST_PATH
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.wasm ./$DIST_PATH/
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.js ./$DIST_PATH/spine.wasm.js
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js.mem ./$DIST_PATH/
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js ./$DIST_PATH/spine.asm.js
mkdir -p ./native/external/emscripten/spine/$SPINE_VERSION
echo "-------- Before replace spine wasm -----------"
ls -l ./native/external/emscripten/spine/$SPINE_VERSION
cp -f ./$DIST_PATH/* ./native/external/emscripten/spine/$SPINE_VERSION
echo "-------- After replace spine wasm ------------"
ls -l ./native/external/emscripten/spine/$SPINE_VERSION
echo "-----------------------------------------------"
cd ./native/external
git status
- name: Build Spine 4.2 WASM
run: |
cd ./native/cocos/editor-support/spine-wasm
sed -i 's/set(BUILD_WASM 0)/set(BUILD_WASM 1)/g' CMakeLists.txt
sed -i 's/set(SPINE_VERSION "3.8")/set(SPINE_VERSION "4.2")/g' CMakeLists.txt
rm -rf build-wasm
mkdir build-wasm
cd build-wasm
emcmake cmake .. -GNinja
ninja
ls -l
- name: Build Spine 4.2 ASMJS
run: |
cd ./native/cocos/editor-support/spine-wasm
sed -i 's/set(SPINE_VERSION "3.8")/set(SPINE_VERSION "4.2")/g' CMakeLists.txt
sed -i 's/set(BUILD_WASM 1)/set(BUILD_WASM 0)/g' CMakeLists.txt
rm -rf build-asmjs
mkdir build-asmjs
cd build-asmjs
emcmake cmake .. -GNinja
ninja
ls -l
- name: Copy Spine 4.2 files to external directory
run: |
DIST_PATH="dist/4.2"
rm -rf $DIST_PATH
mkdir -p $DIST_PATH
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.wasm ./$DIST_PATH/
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.js ./$DIST_PATH/spine.wasm.js
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js.mem ./$DIST_PATH/
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js ./$DIST_PATH/spine.asm.js
mkdir -p ./native/external/emscripten/spine/4.2/
echo "-------- Before replace spine wasm -----------"
ls -l ./native/external/emscripten/spine/4.2/
cp -f ./$DIST_PATH/* ./native/external/emscripten/spine/4.2/
echo "-------- After replace spine wasm ------------"
ls -l ./native/external/emscripten/spine/4.2/
echo "-----------------------------------------------"
cd ./native/external
git status
- name: npm install
run: |
npm install
- name: build-debug-infos
run: |
npm run build:debug-infos
- name: run test
run: |
export NODE_OPTIONS="--max-old-space-size=8192"
npm test