Skip to content

Commit

Permalink
[v3.8.5] Release spine wasm/asmjs package by CI (#17757)
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar authored Oct 22, 2024
1 parent 3046336 commit 3e17c0b
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build-wasm-libs.yml
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

0 comments on commit 3e17c0b

Please sign in to comment.