Skip to content

Commit 363ccd2

Browse files
committed
CI, Web: Build the Web (Emscripten) version...
...no deployment at this time, only a zip file with the artifacts.
1 parent 14af399 commit 363ccd2

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/scripts/build-web.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh -xe
2+
3+
if [ "$1" = "release" ]; then
4+
BUILD_TYPE="Release"
5+
ENABLE_LTO="ON"
6+
else
7+
BUILD_TYPE="Debug"
8+
ENABLE_LTO="OFF"
9+
fi
10+
11+
cd ..
12+
git clone https://github.com/emscripten-core/emsdk.git --depth 1
13+
cd emsdk
14+
./emsdk install latest
15+
./emsdk activate latest
16+
cd ../solvespace
17+
source ../emsdk/emsdk_env.sh
18+
mkdir build
19+
cd build
20+
emcmake cmake .. \
21+
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
22+
-DENABLE_CLI="OFF" \
23+
-DENABLE_TESTS="OFF" \
24+
-DENABLE_COVERAGE="OFF" \
25+
-DENABLE_OPENMP="OFF" \
26+
-DENABLE_LTO="ON"
27+
cmake --build . --config "${BUILD_TYPE}" -j$(nproc)

.github/scripts/install-web.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh -xe
2+
3+
git submodule update --init

.github/workflows/cd.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,26 @@ jobs:
150150
name: macos
151151
path: build/bin/SolveSpace.dmg
152152

153+
build_release_web:
154+
# needs: [test_ubuntu, test_windows, test_macos]
155+
name: Build Release Web
156+
runs-on: ubuntu-latest
157+
steps:
158+
- uses: actions/checkout@v4
159+
- name: Install Dependencies
160+
run: .github/scripts/install-web.sh
161+
- name: Build & Pack
162+
run: |
163+
.github/scripts/build-web.sh release
164+
cd build/bin
165+
rm *.a || true
166+
zip -r solvespace_web.zip .
167+
- name: Upload artifact
168+
uses: actions/upload-artifact@v4
169+
with:
170+
name: solvespace_web
171+
path: build/bin/solvespace_web.zip
172+
153173
# deploy_snap_amd64:
154174
# needs: [test_ubuntu, test_windows, test_macos]
155175
# name: Deploy AMD64 Snap

0 commit comments

Comments
 (0)