Windows Build (branch) #6
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: Windows Build (branch) | |
| # Standalone Windows build for the feat/windows-support branch. Kept separate | |
| # from release.yml (macOS core+pro) on purpose: this neither bumps the version | |
| # nor publishes to Releases — it packages the NSIS installer and uploads it as a | |
| # workflow artifact you can download. Re-fold a windows-2022 job into release.yml | |
| # once a build is verified on a real Windows machine. | |
| on: | |
| push: | |
| branches: | |
| - feat/windows-support | |
| workflow_dispatch: # lets you trigger a build manually from the Actions tab | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-win: | |
| # windows-2022 = VS 2022 toolchain. windows-latest ships VS 2026 (VS 18), | |
| # which node-gyp 11 can't parse — breaking native-module (better-sqlite3, | |
| # node-llama-cpp) compiles. Pin until node-gyp catches up. | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: false # the repo's LFS binaries are macOS-only; Windows runtimes | |
| # come from fetch-win-binaries.ps1, so don't pull ~235MB of | |
| # dylibs we won't ship. | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| # node-gyp (better-sqlite3-multiple-ciphers) fails on Python 3.13+; pin 3.12. | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Fetch Windows native binaries (llama/whisper/sd/ffmpeg) | |
| shell: pwsh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # raises the GitHub API rate limit | |
| run: ./scripts/fetch-win-binaries.ps1 | |
| - name: Build (typecheck + bundle) | |
| run: npm run build | |
| - name: Package Windows installer (NSIS) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Optional Windows code signing (no-op if absent → unsigned; SmartScreen | |
| # will warn until you add a cert via these secrets). | |
| CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | |
| CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | |
| run: npx electron-builder --win --publish never | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: off-grid-ai-windows | |
| path: | | |
| dist/*.exe | |
| dist/*.zip | |
| if-no-files-found: error |