Build Windows #29
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: Build Windows | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**' | |
| - 'package.json' | |
| - 'electron.vite.config.ts' | |
| - '.github/workflows/**' | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install setuptools (provides distutils) | |
| run: python -m pip install setuptools | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Download Claude binary | |
| run: | | |
| echo "Downloading Claude binary for Windows..." | |
| echo "Node version: $(node --version)" | |
| echo "Bun version: $(bun --version)" | |
| echo "Current directory: $(Get-Location)" | |
| echo "Platform: $env:OS" | |
| node scripts/download-claude-binary.mjs | |
| if ($LASTEXITCODE -ne 0) { | |
| echo "✗ Download script failed with exit code $LASTEXITCODE" | |
| exit 1 | |
| } | |
| if (Test-Path "resources\bin\win32-x64\claude.exe") { | |
| echo "✓ Binary downloaded successfully" | |
| $file = Get-Item "resources\bin\win32-x64\claude.exe" | |
| echo "File size: $($file.Length) bytes" | |
| } else { | |
| echo "✗ Binary not found after download" | |
| echo "Checking resources\bin directory:" | |
| if (Test-Path "resources\bin") { | |
| Get-ChildItem -Recurse "resources\bin" -ErrorAction SilentlyContinue | Select-Object FullName | |
| } else { | |
| echo "resources\bin directory does not exist" | |
| } | |
| exit 1 | |
| } | |
| - name: Build application | |
| run: bun run build | |
| - name: Package for Windows | |
| run: bun run package:win | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-build | |
| path: release/*.exe | |
| retention-days: 30 | |
| - name: Upload portable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-portable | |
| path: release/1Code*.exe | |
| if-no-files-found: ignore | |
| retention-days: 30 |