Build qqq IDE #14
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 qqq IDE | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| vscode_tag: | |
| description: 'VS Code tag (1.77.3 = last Win7-compatible Electron 19)' | |
| default: '1.77.3' | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| timeout-minutes: 120 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout private workflow assets | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: kkn1n/qqqworkflow | |
| token: ${{ secrets.GH_PAT }} | |
| path: qqqworkflow | |
| ref: qq | |
| # vscode 1.77 era: Node 16.14 + yarn 1.x + python 3.10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '16.14.2' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Setup yarn 1.22 | |
| run: npm install -g yarn@1.22.19 | |
| # ============================================================ | |
| # Phase 1: Build qqq-core extension (produces dist/*.vsix) | |
| # ============================================================ | |
| - name: Build qqq-core extension | |
| shell: pwsh | |
| run: | | |
| npm install --ignore-scripts | |
| node qqqworkflow/esbuild.config.js | |
| npx @vscode/vsce package -o dist/qqq-universal.vsix --allow-missing-repository --allow-star-activation --no-dependencies | |
| Write-Host "qqq-core vsix:" -ForegroundColor Green | |
| Get-ChildItem dist/*.vsix | ForEach-Object { Write-Host " $($_.Name) ($([math]::Round($_.Length/1MB,2)) MB)" } | |
| # ============================================================ | |
| # Phase 2: Build qqq-ai extension (produces ai/dist/) | |
| # ============================================================ | |
| - name: Build qqq-ai extension | |
| shell: pwsh | |
| run: | | |
| Push-Location ai | |
| npm install --ignore-scripts | |
| node esbuild.config.js | |
| Pop-Location | |
| if (Test-Path "ai/dist/extension.js") { | |
| Write-Host "qqq-ai built OK" -ForegroundColor Green | |
| } else { | |
| Write-Host "::error::ai/dist/extension.js not found" | |
| exit 1 | |
| } | |
| # ============================================================ | |
| # Phase 2.5: Build ghrun (component manager) | |
| # ============================================================ | |
| - name: Build ghrun | |
| shell: pwsh | |
| run: | | |
| Push-Location ide/ghrun | |
| # Use stable Rust from the runner | |
| rustup target add x86_64-pc-windows-msvc | |
| cargo build --release --target x86_64-pc-windows-msvc | |
| $bin = "target/x86_64-pc-windows-msvc/release/ghrun.exe" | |
| if (Test-Path $bin) { | |
| Copy-Item $bin "../../dist/ghrun.exe" -Force | |
| Write-Host "ghrun.exe: $([math]::Round((Get-Item $bin).Length/1KB,0)) KB" -ForegroundColor Green | |
| } else { | |
| Write-Host "::error::ghrun.exe not found" | |
| exit 1 | |
| } | |
| Pop-Location | |
| # ============================================================ | |
| # Phase 3: Build IDE Shell (Code-OSS 1.77.3 + all patches) | |
| # ============================================================ | |
| - name: Run IDE build script | |
| shell: pwsh | |
| run: | | |
| Set-Location ide | |
| .\build.ps1 -Target win32-x64 -VscodeTag ${{ inputs.vscode_tag }} | |
| - name: Locate compiled artifact | |
| id: locate | |
| shell: pwsh | |
| run: | | |
| $candidates = @( | |
| "ide/.build/VSCode-win32-x64", | |
| "VSCode-win32-x64" | |
| ) | |
| # Also search one level up from code-oss (gulp output pattern) | |
| $gulpOut = Get-ChildItem "ide/.build" -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -match "VSCode" } | |
| if ($gulpOut) { $candidates += $gulpOut.FullName } | |
| foreach ($c in $candidates) { | |
| if (Test-Path $c) { | |
| $abs = (Resolve-Path $c).Path | |
| Write-Host "Found: $abs" | |
| "ARTIFACT_DIR=$abs" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| exit 0 | |
| } | |
| } | |
| Write-Host "::error::artifact dir not found" | |
| Get-ChildItem "ide/.build" -Directory -ErrorAction SilentlyContinue | ForEach-Object { Write-Host " $($_.FullName)" } | |
| exit 1 | |
| - name: Verify artifact integrity | |
| shell: pwsh | |
| run: | | |
| $art = "${{ steps.locate.outputs.ARTIFACT_DIR }}" | |
| $exe = Get-ChildItem $art -Filter "*.exe" -File | Where-Object { $_.Name -notmatch 'crashpad|unins' } | Select-Object -First 1 | |
| if (-not $exe) { Write-Host "::error::no main exe"; exit 1 } | |
| Write-Host "exe: $($exe.Name) ($([math]::Round($exe.Length/1MB,2)) MB)" | |
| # Check portable f/ structure (QDIR protocol) | |
| if (Test-Path "$art/f/.qqq-portable") { | |
| Write-Host "QDIR portable: f/a/e OK" | |
| } elseif (Test-Path "$art/data/.qqq-portable") { | |
| Write-Host "Stock portable: data/ OK (3g patch may not have applied)" | |
| } else { | |
| Write-Host "::warning::portable marker not found" | |
| } | |
| # Check pre-installed extensions | |
| $extDir = if (Test-Path "$art/f/e") { "$art/f/e" } else { "$art/data/extensions" } | |
| if (Test-Path "$extDir/qqq-core") { Write-Host "qqq-core: pre-installed" } | |
| if (Test-Path "$extDir/qqq-ai") { Write-Host "qqq-ai: pre-installed" } | |
| # Check settings seed | |
| $settingsPath = if (Test-Path "$art/f/a/User/settings.json") { "$art/f/a/User/settings.json" } else { "$art/data/user-data/User/settings.json" } | |
| if (Test-Path $settingsPath) { Write-Host "settings.json: seeded" } | |
| $sz = (Get-ChildItem $art -Recurse -File | Measure-Object Length -Sum).Sum | |
| Write-Host "Total: $([math]::Round($sz/1MB,2)) MB" | |
| - name: Upload qqq IDE artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qqq-ide-win32-x64 | |
| path: ${{ steps.locate.outputs.ARTIFACT_DIR }} | |
| retention-days: 90 | |
| compression-level: 6 |