-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v3.8.5] Release spine wasm/asmjs package by CI (#17757)
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Build wasm/asmjs libraryies | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: "Select a library" | ||
required: true | ||
default: "Spine" | ||
type: choice | ||
options: | ||
- Spine | ||
|
||
jobs: | ||
build_spine_wasm_asmjs: | ||
name: "Build spine wasm/asmjs libs" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup emsdk | ||
uses: dumganhar/setup-emsdk@997d2cde2deabda085a11f98e86e842915b0e846 | ||
with: | ||
version: 3.1.41 | ||
actions-cache-folder: 'emsdk-cache' | ||
|
||
- 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: Build Spine WASM | ||
run: | | ||
cd ./native/cocos/editor-support/spine-wasm | ||
mkdir build-wasm | ||
cd build-wasm | ||
emcmake cmake .. -GNinja | ||
ninja | ||
ls -l | ||
- name: Build Spine ASMJS | ||
run: | | ||
cd ./native/cocos/editor-support/spine-wasm | ||
sed -i 's/set(BUILD_WASM 1)/set(BUILD_WASM 0)/g' CMakeLists.txt | ||
mkdir build-asmjs | ||
cd build-asmjs | ||
emcmake cmake .. -GNinja | ||
ninja | ||
ls -l | ||
- name: Copy files to dist directory | ||
run: | | ||
mkdir dist | ||
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.wasm ./dist/ | ||
cp ./native/cocos/editor-support/spine-wasm/build-wasm/spine.js ./dist/spine.wasm.js | ||
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js.mem ./dist/ | ||
cp ./native/cocos/editor-support/spine-wasm/build-asmjs/spine.js ./dist/spine.asm.js | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: spine-emscripten | ||
path: dist |