Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/scripts/build-web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -eo pipefail

REPO_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
EMSDK_DIR="${RUNNER_TEMP:-$(dirname "$REPO_ROOT")}/emsdk"
BUILD_DIR="$REPO_ROOT/build"

if [ "$1" = "release" ]; then
BUILD_TYPE="Release"
else
BUILD_TYPE="Debug"
fi

git clone https://github.com/emscripten-core/emsdk.git --depth 1 "$EMSDK_DIR"
(
cd "$EMSDK_DIR"
./emsdk install latest
./emsdk activate latest
)
source "$EMSDK_DIR"/emsdk_env.sh
emcmake cmake -S "$REPO_ROOT" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
cmake --build "$BUILD_DIR" --config "${BUILD_TYPE}" --parallel $(nproc)
36 changes: 35 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
c_compiler: cl

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true

Expand Down Expand Up @@ -95,6 +95,40 @@ jobs:
# A file, directory or wildcard pattern that describes what to upload
path: ${{ steps.strings.outputs.build-output-dir }}/examples/win32/${{ matrix.build_type }}/libspnavdev_test.exe

build_web:
needs: build
name: Build Release Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build & Pack
run: |
.github/scripts/build-web.sh release
cd build/examples/web
rm -rf CMakeFiles || true
- name: Upload web version as artifact
id: upload_web
uses: actions/upload-pages-artifact@v3
with:
path: build/examples/web/

deploy_web:
# If you want deployment only on pushes to master (not manual runs on master), use:
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master'
needs: build_web
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

upload_release_assets:
name: Upload Release Assets
needs: [build]
Expand Down
Loading