Team Ai
Apppublic

Xenobd/whisper.cpp

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
examples-wasm.yml92 linesDownload Raw Back to workflows
1name: Examples WASM2on:3  push:4    branches: ["master"]5 6  workflow_dispatch:7 8permissions:9  contents: read10  pages: write11  id-token: write12 13concurrency:14  group: "pages"15  cancel-in-progress: false16 17jobs:18  deploy-wasm-github-pages:19    environment:20      name: github-pages21      url: ${{ steps.deployment.outputs.page_url }}22    runs-on: ubuntu-latest23    steps:24      - name: Checkout25        uses: actions/checkout@v426 27      - name: Setup Pages28        uses: actions/configure-pages@v429 30      - name: Setup emsdk31        uses: mymindstorm/setup-emsdk@v1432 33      - name: Build WASM Examples34        # Enable for real build later in whisper.cpp35        run: |36          mkdir -p build-em && cd build-em37          emcmake cmake .. -DCMAKE_BUILD_TYPE=Release38          make -j39 40      - name: Create staging directory41        run: mkdir -p staging42 43      - name: Create .nojekyll file in staging directory44        run: touch staging/.nojekyll45 46      - name: Copy application files47        run: |48          build_dir=build-em/bin49 50          ls ${build_dir}51 52          # command.wasm53          target_dir=staging/command.wasm54          mkdir -p ${target_dir}55          cp ${build_dir}/command.wasm/{index.html,command.js,helpers.js} ${target_dir}56          cp ${build_dir}/libcommand.js ${target_dir}57 58          # bench.wasm59          target_dir=staging/bench.wasm60          mkdir -p ${target_dir}61          cp ${build_dir}/bench.wasm/{index.html,bench.js,helpers.js} ${target_dir}62          cp ${build_dir}/libbench.js ${target_dir}63 64          # stream.wasm65          target_dir=staging/stream.wasm66          mkdir -p ${target_dir}67          cp ${build_dir}/stream.wasm/{index.html,stream.js,helpers.js} ${target_dir}68          cp ${build_dir}/libstream.js ${target_dir}69 70          # whisper.wasm (this will be the main example page)71          target_dir=staging72          mkdir -p ${target_dir}73          cp ${build_dir}/whisper.wasm/{index.html,main.js,helpers.js} ${target_dir}74          cp ${build_dir}/libmain.js ${target_dir}75 76          # Copy Cross-Origin Isolation service worker77          cp -v examples/coi-serviceworker.js staging/78 79      - name: List files in staging directory (for debugging)80        run: |81          echo "Files in staging directory:"82          find staging -type f | sort83 84      - name: Upload artifact85        uses: actions/upload-pages-artifact@v386        with:87          path: ./staging88 89      - name: Deploy to GitHub Pages90        id: deployment91        uses: actions/deploy-pages@v492