Skip to content

fix(win): fetch a current sd asset (cpu x64), image binary was silent… #8

fix(win): fetch a current sd asset (cpu x64), image binary was silent…

fix(win): fetch a current sd asset (cpu x64), image binary was silent… #8

Workflow file for this run

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
env:
# True when the private-repo token is configured, so we bundle Pro (same as
# the Mac release build). Falsey on a fork / missing secret → core-only exe.
# Can't reference `secrets` directly in a step `if`, so surface it as env.
HAS_PRO_TOKEN: ${{ secrets.PRO_REPO_TOKEN != '' }}
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.
# Private pro source into pro/ → __OFFGRID_PRO__ true, so the exe bundles the
# Pro layer (mirrors release.yml). Needed to exercise the Pro "coming soon"
# gate on Windows. Pro stays license-gated at runtime; launch with
# OFFGRID_PRO=1 to force it on for testing without a license. Skipped (core
# build) when PRO_REPO_TOKEN isn't available.
- uses: actions/checkout@v4
if: env.HAS_PRO_TOKEN == 'true'
with:
repository: off-grid-ai/desktop-pro
token: ${{ secrets.PRO_REPO_TOKEN }}
path: pro
fetch-depth: 1
- name: Drop nested .git from pro/
if: env.HAS_PRO_TOKEN == 'true'
shell: bash
run: rm -rf pro/.git # don't nest a repo inside the build tree
- 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