feat: support to build on windows #183
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Web SDK - Build & Release | |
| on: | |
| push: | |
| paths: | |
| - 'sdk/runanywhere-web/**' | |
| - 'sdk/runanywhere-commons/**' | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'sdk/runanywhere-web/**' | |
| - 'sdk/runanywhere-commons/**' | |
| workflow_dispatch: | |
| inputs: | |
| build_backends: | |
| description: 'Build backends (all, llamacpp, whispercpp, onnx, none)' | |
| required: false | |
| default: 'all' | |
| jobs: | |
| typecheck: | |
| name: TypeScript Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| working-directory: sdk/runanywhere-web | |
| run: npm install | |
| - name: Typecheck | |
| working-directory: sdk/runanywhere-web/packages/core | |
| run: npx tsc --noEmit | |
| build-wasm: | |
| name: Build WASM (${{ matrix.backends }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| backends: [core-only, all-backends] | |
| include: | |
| - backends: core-only | |
| flags: '' | |
| - backends: all-backends | |
| flags: '--all-backends' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: '3.1.51' | |
| - name: Verify Emscripten | |
| run: emcc --version | |
| - name: Build WASM | |
| working-directory: sdk/runanywhere-web | |
| run: ./wasm/scripts/build.sh ${{ matrix.flags }} | |
| - name: Upload WASM artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-${{ matrix.backends }} | |
| path: | | |
| sdk/runanywhere-web/packages/core/wasm/racommons.js | |
| sdk/runanywhere-web/packages/core/wasm/racommons.wasm | |
| retention-days: 30 | |
| build-ts: | |
| name: Build TypeScript | |
| runs-on: ubuntu-latest | |
| needs: typecheck | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| working-directory: sdk/runanywhere-web | |
| run: npm install | |
| - name: Build | |
| working-directory: sdk/runanywhere-web/packages/core | |
| run: npx tsc | |
| - name: Upload dist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-sdk-dist | |
| path: sdk/runanywhere-web/packages/core/dist/ | |
| retention-days: 30 |