From: Daniel Bevenius Date: Thu, 4 Jun 2026 12:25:15 +0000 (+0200) Subject: ci : use emscripten-core and pin version (#3857) X-Git-Tag: upstream/1.9.2~271 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ad17783d3499d54bd64f8afd19932ea7b0d5d175;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ci : use emscripten-core and pin version (#3857) This commit updates the setup emscripten sdk jobs to use emscripten-core instead of mymindstorm and also pins the commit sha for the version instead of using a version tag. --- diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 42a9401a..d2891eda 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -40,7 +40,7 @@ jobs: uses: actions/checkout@v6 - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v14 + uses: emscripten-core/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 - name: Verify run: emcc -v diff --git a/.github/workflows/deploy-examples-wasm.yml b/.github/workflows/deploy-examples-wasm.yml new file mode 100644 index 00000000..e7fdae77 --- /dev/null +++ b/.github/workflows/deploy-examples-wasm.yml @@ -0,0 +1,97 @@ +name: Examples WASM +on: + push: + branches: ["master"] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy-wasm-github-pages: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Setup emsdk + uses: emscripten-core/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 + + - name: Build WASM Examples + # Enable for real build later in whisper.cpp + run: | + mkdir -p build-em && cd build-em + emcmake cmake .. -DCMAKE_BUILD_TYPE=Release + make -j + + - name: Create staging directory + run: mkdir -p staging + + - name: Create .nojekyll file in staging directory + run: touch staging/.nojekyll + + - name: Copy application files + run: | + build_dir=build-em/bin + + ls ${build_dir} + + # command.wasm + target_dir=staging/command.wasm + mkdir -p ${target_dir} + cp ${build_dir}/command.wasm/{index.html,command.js,helpers.js} ${target_dir} + cp ${build_dir}/libcommand.js ${target_dir} + + # bench.wasm + target_dir=staging/bench.wasm + mkdir -p ${target_dir} + cp ${build_dir}/bench.wasm/{index.html,bench.js,helpers.js} ${target_dir} + cp ${build_dir}/libbench.js ${target_dir} + + # stream.wasm + target_dir=staging/stream.wasm + mkdir -p ${target_dir} + cp ${build_dir}/stream.wasm/{index.html,stream.js,helpers.js} ${target_dir} + cp ${build_dir}/libstream.js ${target_dir} + + # wchess.wasm + target_dir=staging/wchess.wasm + mkdir -p ${target_dir} + cp -r ${build_dir}/wchess.wasm/{index.html,css,img,js} ${target_dir} + cp ${build_dir}/wchess.wasm.js ${target_dir} + + # whisper.wasm (this will be the main example page) + target_dir=staging + mkdir -p ${target_dir} + cp ${build_dir}/whisper.wasm/{index.html,main.js,helpers.js} ${target_dir} + cp ${build_dir}/libmain.js ${target_dir} + + # Copy Cross-Origin Isolation service worker + cp -v examples/coi-serviceworker.js staging/ + + - name: List files in staging directory (for debugging) + run: | + echo "Files in staging directory:" + find staging -type f | sort + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: ./staging + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/examples-wasm.yml b/.github/workflows/examples-wasm.yml deleted file mode 100644 index 927438cd..00000000 --- a/.github/workflows/examples-wasm.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Examples WASM -on: - push: - branches: ["master"] - - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - deploy-wasm-github-pages: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v14 - - - name: Build WASM Examples - # Enable for real build later in whisper.cpp - run: | - mkdir -p build-em && cd build-em - emcmake cmake .. -DCMAKE_BUILD_TYPE=Release - make -j - - - name: Create staging directory - run: mkdir -p staging - - - name: Create .nojekyll file in staging directory - run: touch staging/.nojekyll - - - name: Copy application files - run: | - build_dir=build-em/bin - - ls ${build_dir} - - # command.wasm - target_dir=staging/command.wasm - mkdir -p ${target_dir} - cp ${build_dir}/command.wasm/{index.html,command.js,helpers.js} ${target_dir} - cp ${build_dir}/libcommand.js ${target_dir} - - # bench.wasm - target_dir=staging/bench.wasm - mkdir -p ${target_dir} - cp ${build_dir}/bench.wasm/{index.html,bench.js,helpers.js} ${target_dir} - cp ${build_dir}/libbench.js ${target_dir} - - # stream.wasm - target_dir=staging/stream.wasm - mkdir -p ${target_dir} - cp ${build_dir}/stream.wasm/{index.html,stream.js,helpers.js} ${target_dir} - cp ${build_dir}/libstream.js ${target_dir} - - # wchess.wasm - target_dir=staging/wchess.wasm - mkdir -p ${target_dir} - cp -r ${build_dir}/wchess.wasm/{index.html,css,img,js} ${target_dir} - cp ${build_dir}/wchess.wasm.js ${target_dir} - - # whisper.wasm (this will be the main example page) - target_dir=staging - mkdir -p ${target_dir} - cp ${build_dir}/whisper.wasm/{index.html,main.js,helpers.js} ${target_dir} - cp ${build_dir}/libmain.js ${target_dir} - - # Copy Cross-Origin Isolation service worker - cp -v examples/coi-serviceworker.js staging/ - - - name: List files in staging directory (for debugging) - run: | - echo "Files in staging directory:" - find staging -type f | sort - - - name: Upload artifact - uses: actions/upload-pages-artifact@v4 - with: - path: ./staging - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4