@@ -2,15 +2,16 @@ name: Build and Deploy
22
33on :
44  workflow_dispatch :
5+   pull_request :
56  push :
67    branches :
78    - main 
8-      
9+ 
910permissions :
1011  contents : read 
1112  pages : write 
1213  id-token : write 
13-      
14+ 
1415jobs :
1516  build :
1617    runs-on : ${{ matrix.os }} 
@@ -20,44 +21,36 @@ jobs:
2021      matrix :
2122        include :
2223          - name : Github-page 
23-             os : macos-15 
24-             emsdk_ver : " 3.1.73" 
24+             os : ubuntu-24.04 
2525    steps :
2626      - uses : actions/checkout@v4 
2727        with :
2828          fetch-depth : 0 
29-          
29+ 
3030      - name : install mamba 
3131        uses : mamba-org/setup-micromamba@main 
3232        with :
33+           environment-file : environment-wasm-build.yml 
3334          init-shell : bash 
35+           environment-name : xeus-cpp-wasm-build 
3436
3537      - name : Setup default Build Type on *nux 
3638        if : ${{ runner.os != 'windows' }} 
3739        run : | 
3840          echo "ncpus=$(nproc --all)" >> $GITHUB_ENV 
39-            
40- name : Setup emsdk 
41-         shell : bash -l {0} 
42-         run : | 
43-           cd $HOME 
44-           git clone --depth=1 https://github.com/emscripten-core/emsdk.git 
45-           cd emsdk 
46-           ./emsdk install  ${{ matrix.emsdk_ver }}     
4741
4842name : Build xeus-cpp 
4943        shell : bash -l {0} 
5044        run : | 
51-           $HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}} 
52-           source $HOME/emsdk/emsdk_env.sh 
5345          micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 
54-            
46+ 
5547          mkdir build 
5648          pushd build 
5749
50+           export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build 
5851          export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host  
5952          echo "PREFIX=$PREFIX" >> $GITHUB_ENV 
60-           export SYSROOT_PATH=$HOME /emsdk/upstream/emscripten/cache/sysroot 
53+           export SYSROOT_PATH=$BUILD_PREFIX/opt /emsdk/upstream/emscripten/cache/sysroot 
6154
6255          emcmake cmake \ 
6356            -DCMAKE_BUILD_TYPE=Release                        \ 
6659            -DCMAKE_FIND_ROOT_PATH=$PREFIX                    \ 
6760            -DSYSROOT_PATH=$SYSROOT_PATH                      \ 
6861            .. 
69-           emmake make -j   ${{ env.ncpus }} install 
62+           emmake make -j ${{ env.ncpus }} install 
7063
71- name : Jupyter Lite integration   
64+ name : Jupyter Lite integration 
7265        shell : bash -l {0} 
7366        run : | 
7467          micromamba create -n xeus-lite-host jupyterlite-core jupyter_server 
7871              --XeusAddon.prefix=${{ env.PREFIX }} \ 
7972              --contents README.md \ 
8073              --contents notebooks/xeus-cpp-lite-demo.ipynb \ 
74+               --contents notebooks/images/marie.png \ 
75+               --contents notebooks/audio/audio.wav \ 
8176              --output-dir dist 
8277
8378name : Upload artifact 
@@ -87,12 +82,15 @@ jobs:
8782
8883  deploy :
8984    needs : build 
85+     if : github.ref == 'refs/heads/main' 
9086    permissions :
9187      pages : write 
9288      id-token : write 
89+ 
9390    environment :
9491      name : github-pages 
9592      url : ${{ steps.deployment.outputs.page_url }} 
93+ 
9694    runs-on : ubuntu-24.04 
9795    steps :
9896      - name : Deploy to GitHub Pages 
0 commit comments