forked from um/web
ci: use emsdk instead of download emsdk each build.
This commit is contained in:
parent
79f1fd2b48
commit
e21456d38f
@ -4,12 +4,16 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: build-wasm
|
||||||
|
image: emscripten/emsdk:3.0.0
|
||||||
|
commands:
|
||||||
|
- ./scripts/build-wasm.sh
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: node:16.18-bullseye
|
image: node:16.18-bullseye
|
||||||
commands:
|
commands:
|
||||||
- apt-get update
|
- apt-get update
|
||||||
- apt-get install -y cmake jq zip
|
- apt-get install -y jq zip
|
||||||
- ./scripts/build-wasm.sh
|
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run test
|
- npm run test
|
||||||
- ./scripts/build-and-package.sh legacy
|
- ./scripts/build-and-package.sh legacy
|
||||||
|
@ -8,29 +8,31 @@ CURR_DIR="${PWD}"
|
|||||||
|
|
||||||
BUILD_TYPE="$1"
|
BUILD_TYPE="$1"
|
||||||
if [ -z "$BUILD_TYPE" ]; then
|
if [ -z "$BUILD_TYPE" ]; then
|
||||||
BUILD_TYPE=Release
|
BUILD_TYPE=Release
|
||||||
|
fi
|
||||||
|
|
||||||
|
# CI: already had emsdk installed.
|
||||||
|
if ! command -v emcc; then
|
||||||
|
if [ ! -d ../../build/emsdk ]; then
|
||||||
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd ../../build/emsdk
|
||||||
|
./emsdk install 3.0.0
|
||||||
|
./emsdk activate 3.0.0
|
||||||
|
source ./emsdk_env.sh
|
||||||
|
popd # ../../build/emsdk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p build/wasm
|
mkdir -p build/wasm
|
||||||
if [ ! -d ../../build/emsdk ]; then
|
|
||||||
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd ../../build/emsdk
|
|
||||||
#git pull
|
|
||||||
./emsdk install 3.0.0
|
|
||||||
./emsdk activate 3.0.0
|
|
||||||
source ./emsdk_env.sh
|
|
||||||
popd # ../../build/emsdk
|
|
||||||
|
|
||||||
pushd build/wasm
|
pushd build/wasm
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
||||||
make -j
|
make -j
|
||||||
TARGET_FILES="
|
TARGET_FILES="
|
||||||
KgmLegacy.js
|
KgmLegacy.js
|
||||||
KgmWasm.js
|
KgmWasm.js
|
||||||
KgmWasm.wasm
|
KgmWasm.wasm
|
||||||
KgmWasmBundle.js
|
KgmWasmBundle.js
|
||||||
"
|
"
|
||||||
|
|
||||||
cp $TARGET_FILES "${CURR_DIR}/"
|
cp $TARGET_FILES "${CURR_DIR}/"
|
||||||
|
@ -8,28 +8,31 @@ CURR_DIR="${PWD}"
|
|||||||
|
|
||||||
BUILD_TYPE="$1"
|
BUILD_TYPE="$1"
|
||||||
if [ -z "$BUILD_TYPE" ]; then
|
if [ -z "$BUILD_TYPE" ]; then
|
||||||
BUILD_TYPE=Release
|
BUILD_TYPE=Release
|
||||||
|
fi
|
||||||
|
|
||||||
|
# CI: already had emsdk installed.
|
||||||
|
if ! command -v emcc; then
|
||||||
|
if [ ! -d ../../build/emsdk ]; then
|
||||||
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd ../../build/emsdk
|
||||||
|
./emsdk install 3.0.0
|
||||||
|
./emsdk activate 3.0.0
|
||||||
|
source ./emsdk_env.sh
|
||||||
|
popd # ../../build/emsdk
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p build/wasm
|
mkdir -p build/wasm
|
||||||
if [ ! -d ../../build/emsdk ]; then
|
|
||||||
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd ../../build/emsdk
|
|
||||||
./emsdk install 3.0.0
|
|
||||||
./emsdk activate 3.0.0
|
|
||||||
source ./emsdk_env.sh
|
|
||||||
popd # ../../build/emsdk
|
|
||||||
|
|
||||||
pushd build/wasm
|
pushd build/wasm
|
||||||
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
||||||
make -j
|
make -j
|
||||||
TARGET_FILES="
|
TARGET_FILES="
|
||||||
QmcLegacy.js
|
QmcLegacy.js
|
||||||
QmcWasm.js
|
QmcWasm.js
|
||||||
QmcWasm.wasm
|
QmcWasm.wasm
|
||||||
QmcWasmBundle.js
|
QmcWasmBundle.js
|
||||||
"
|
"
|
||||||
|
|
||||||
cp $TARGET_FILES "${CURR_DIR}/"
|
cp $TARGET_FILES "${CURR_DIR}/"
|
||||||
|
Loading…
Reference in New Issue
Block a user