name: Desktop installers # Builds the two files a person downloads to install Javis like an app: # JavisOS-Setup.exe (Windows, Inno Setup) packaging/windows/ # JavisOS-macOS.dmg (macOS, drag to Applications) packaging/macos/ # On branches and PRs it checks that an installer change still builds and installs. Since 2026-12-01 the # installers people download are built on the cloud machine and published at # https://git.javisos.com/dl/desktop/JavisOS-Setup.exe # https://git.javisos.com/dl/desktop/JavisOS-macOS.zip # (tools/image/publish_download.py), so a merge to main no longer rebuilds them here. The old "desktop" # release tag is only updated by "Run workflow" on main (for example to have SignPath sign the .exe). # # Both installers are thin: they clone the newest Javis on first run, so they only need a # rebuild when the installer files themselves change, not on every release. on: push: branches: [ 'claude/**' ] paths: - "packaging/**" - "install.ps1" - "install.sh" - "open-javis.vbs" - "start-javis.vbs" - "bin/javis-start.sh" - "bin/javis-autostart.sh" - ".github/workflows/desktop-installers.yml" pull_request: paths: - "packaging/**" - "install.ps1" - "install.sh" - "open-javis.vbs" - "start-javis.vbs" - "bin/javis-start.sh" - "bin/javis-autostart.sh" - ".github/workflows/desktop-installers.yml" workflow_dispatch: concurrency: group: desktop-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: windows: runs-on: windows-latest timeout-minutes: 60 outputs: artifact-id: ${{ steps.upload.outputs.artifact-id }} steps: - uses: actions/checkout@v4 - name: Inno Setup shell: pwsh run: | $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" if (-not (Test-Path $iscc)) { choco install innosetup -y --no-progress | Out-Null } if (-not (Test-Path $iscc)) { throw "ISCC.exe not found after install" } "ISCC=$iscc" >> $env:GITHUB_ENV # Parse every PowerShell file the installers run, with the parser of Windows PowerShell 5.1 # (what customers have), so a syntax slip fails here instead of on a customer's PC. - name: PowerShell syntax check shell: powershell run: | $bad = 0 foreach ($f in @("install.ps1", "stop-javis.ps1", "javis-autostart.ps1", "packaging\windows\bootstrap.ps1", "packaging\windows\get-javis.ps1")) { $errs = $null [void][System.Management.Automation.Language.Parser]::ParseFile((Resolve-Path $f), [ref]$null, [ref]$errs) if ($errs) { $bad++; $errs | ForEach-Object { Write-Host "::error file=$f::$($_.Message) (line $($_.Extent.StartLineNumber))" } } else { Write-Host "ok $f" } } if ($bad) { exit 1 } # Vietnamese wizard text is an unofficial Inno translation, not bundled with the compiler. - name: Vietnamese wizard text (best-effort) shell: pwsh run: | try { Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/Vietnamese.isl" -OutFile packaging/windows/Vietnamese.isl -UseBasicParsing } catch { Write-Host "Vietnamese.isl unavailable, building English only: $($_.Exception.Message)" } # Code signing with the project's OWN certificate file. OPTIONAL and off until the owner adds # two repository secrets (the free route through SignPath is the sign-windows job below): # WINDOWS_CERT_PFX_BASE64 the code signing certificate (.pfx) as base64 # WINDOWS_CERT_PASSWORD its password # With them, Inno Setup signs both the setup .exe and its uninstaller (SignTool=javis in # javis-setup.iss), so Windows shows the publisher name instead of "Unknown publisher". # Without them the build is unsigned, exactly as before. Fork PRs never see secrets. - name: Build JavisOS-Setup.exe shell: pwsh env: CERT_B64: ${{ secrets.WINDOWS_CERT_PFX_BASE64 }} CERT_PWD: ${{ secrets.WINDOWS_CERT_PASSWORD }} run: | $v = (Get-Content VERSION -Raw).Trim() $sign = @() if ($env:CERT_B64) { $pfx = Join-Path $env:RUNNER_TEMP "javis-sign.pfx" [IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:CERT_B64)) $tool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1 if (-not $tool) { throw "signtool.exe not found" } # Inno replaces $f with the file to sign and $q with a double quote. $sign = @("/DSign", "/Sjavis=`$q$($tool.FullName)`$q sign /f `$q$pfx`$q /p `$q$($env:CERT_PWD)`$q /fd sha256 /tr http://timestamp.digicert.com /td sha256 `$f") Write-Host "Signing enabled" } else { Write-Host "No WINDOWS_CERT_PFX_BASE64 secret: building unsigned" } & $env:ISCC "/DAppVersion=$v" @sign packaging\windows\javis-setup.iss if ($LASTEXITCODE -ne 0 -and (Test-Path packaging/windows/Vietnamese.isl)) { # A translation written for a newer Inno can carry messages this compiler rejects: # ship English rather than no installer at all. Write-Host "::warning::Build with Vietnamese.isl failed, retrying English only" Remove-Item packaging/windows/Vietnamese.isl & $env:ISCC "/DAppVersion=$v" @sign packaging\windows\javis-setup.iss } if ($LASTEXITCODE -ne 0) { exit 1 } if ($env:CERT_B64) { Remove-Item $pfx -Force $sig = Get-AuthenticodeSignature dist\JavisOS-Setup.exe Write-Host "Signature: $($sig.Status) $($sig.SignerCertificate.Subject)" if ($sig.Status -ne "Valid") { throw "JavisOS-Setup.exe is not validly signed" } } Get-Item dist\JavisOS-Setup.exe | Format-List Name, Length # Real install of THIS commit on a clean runner, all four CLI brains included: bootstrap # clones the checkout and runs install.ps1 (venv, deps, Claude Code, Codex, Antigravity, # Grok, autostart). Then the server's own finders must see all four brains, and Javis # must answer /health. Installed where the wizard installs (%USERPROFILE%\JavisOS), so the # next step can run the real Setup.exe over it. - name: Smoke test - full install, four brains, Javis starts shell: pwsh timeout-minutes: 45 run: | git branch -f smoke-install HEAD $dir = Join-Path $env:USERPROFILE "JavisOS" powershell -NoProfile -ExecutionPolicy Bypass -File packaging\windows\bootstrap.ps1 -Dir $dir -Repo $env:GITHUB_WORKSPACE -Branch smoke-install -NoPause -LogFile (Join-Path $env:RUNNER_TEMP "install.log") if ($LASTEXITCODE -ne 0) { Get-Content (Join-Path $env:RUNNER_TEMP "install.log") -Tail 80; exit 1 } $vpy = Join-Path $dir ".venv\Scripts\python.exe" if (-not (Test-Path $vpy)) { throw "venv missing" } if (-not (Test-Path (Join-Path $dir "open-javis.vbs"))) { throw "open-javis.vbs missing" } & $vpy (Join-Path $dir "packaging\check_brains.py") if ($LASTEXITCODE -ne 0) { throw "a brain CLI is missing after install" } Start-Process wscript.exe -ArgumentList "//nologo `"$dir\start-javis.vbs`"" -WorkingDirectory $dir $ok = $false for ($i = 0; $i -lt 90; $i++) { Start-Sleep -Seconds 2 try { if ((Invoke-WebRequest http://127.0.0.1:7777/health -UseBasicParsing -TimeoutSec 3).StatusCode -eq 200) { $ok = $true; break } } catch { } } if (-not $ok) { Get-Content (Join-Path $dir "server\javis.log") -Tail 80 -ErrorAction SilentlyContinue; throw "Javis did not answer /health" } Write-Host "Javis is up after a fresh install" & (Join-Path $dir "stop-javis.bat") # The wizard itself: JavisOS-Setup.exe runs bootstrap.ps1 HIDDEN and shows its lines in the # Setup window (no black console). Silent mode runs the same [Code], so this proves on a real # Windows that the hidden run starts, its lines reach the wizard and it ends on its own. The # clone from the step above is already there, so this takes about a minute. - name: Smoke test - Setup.exe runs the bootstrap hidden and reads its output shell: pwsh timeout-minutes: 20 run: | $p = Start-Process -FilePath dist\JavisOS-Setup.exe -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=`"$env:RUNNER_TEMP\setup.log`"" -PassThru $null = $p.Handle if (-not $p.WaitForExit(15 * 60000)) { taskkill /PID $p.Id /T /F; throw "Setup.exe did not end within 15 minutes" } $log = Join-Path $env:LOCALAPPDATA "Programs\JAVIS OS\install.log" if (-not (Test-Path $log)) { Get-Content "$env:RUNNER_TEMP\setup.log" -Tail 60; throw "the wizard wrote no install.log" } $text = Get-Content $log -Raw Write-Host "---- install.log as the wizard captured it ----" Write-Host $text if ($p.ExitCode -ne 0) { throw "Setup.exe exit code $($p.ExitCode)" } foreach ($want in @("[A] Kiem tra Git", "[2] Cai thu vien Python", "BO NAO SAN SANG", "Xong. Lan sau mo Javis")) { if (-not $text.Contains($want)) { throw "install.log misses: $want" } } if ($text.Contains("[LOI]")) { throw "the bootstrap reported an error" } if ($text.Contains("CLIXML")) { throw "CLIXML leaked into the wizard log" } if (-not (Test-Path (Join-Path $env:LOCALAPPDATA "Programs\JAVIS OS\bootstrap.ps1"))) { throw "bootstrap.ps1 not installed" } # SignPath signs this very artifact, by its id: it checks that the file came out of this run. - uses: actions/upload-artifact@v4 id: upload with: name: JavisOS-Setup path: dist/JavisOS-Setup.exe if-no-files-found: error macos: runs-on: macos-latest timeout-minutes: 60 steps: - uses: actions/checkout@v4 - name: Build JavisOS-macOS.dmg run: bash packaging/macos/build-dmg.sh - name: Check the disk image run: | set -e mnt="$(hdiutil attach -nobrowse -readonly dist/JavisOS-macOS.dmg | awk -F'\t' '/\/Volumes\//{print $NF}')" app="$mnt/JAVIS OS.app" test -x "$app/Contents/MacOS/javis" test -f "$app/Contents/Resources/bootstrap.sh" test -f "$app/Contents/Resources/javis.icns" test -L "$mnt/Applications" plutil -lint "$app/Contents/Info.plist" bash -n "$app/Contents/MacOS/javis" bash -n "$app/Contents/Resources/bootstrap.sh" bash -n packaging/macos/get-javis.sh test -f "$mnt/.VolumeIcon.icns" GetFileInfo -a "$mnt" | grep -q C && echo "volume has the Javis icon" || echo "::warning::volume custom-icon flag not set" hdiutil detach "$mnt" # The same first-run path a customer takes (bootstrap.sh -> install.sh), on this commit: # clone, venv, Node, all four CLI brains, LaunchAgent. The runner already has the # Command Line Tools and a Python 3.10+, so the xcode-select and uv branches are skipped. - name: Smoke test - full install, four brains, Javis starts timeout-minutes: 45 run: | set -e git branch -f smoke-install HEAD export JAVIS_HOME="$RUNNER_TEMP/JavisOS" JAVIS_REPO="$GITHUB_WORKSPACE" JAVIS_BRANCH=smoke-install bash packaging/macos/bootstrap.sh < /dev/null export PATH="$HOME/.local/bin:$HOME/.javis/node/bin:$PATH" "$JAVIS_HOME/.venv/bin/python" "$JAVIS_HOME/packaging/check_brains.py" for i in $(seq 1 60); do curl -sf -m 3 -o /dev/null http://127.0.0.1:7777/health && { echo "Javis is up after a fresh install"; exit 0; } sleep 2 done tail -80 "$JAVIS_HOME/server/javis.log" 2>/dev/null || true echo "Javis did not answer /health"; exit 1 - uses: actions/upload-artifact@v4 with: name: JavisOS-macOS path: dist/JavisOS-macOS.dmg if-no-files-found: error # Free code signing for open source through SignPath Foundation: the policy, and what the owner # sets up once, are in docs/code-signing-policy.md. The job is OFF until these exist: # secret SIGNPATH_API_TOKEN # variable SIGNPATH_ORGANIZATION_ID, SIGNPATH_PROJECT_SLUG, SIGNPATH_SIGNING_POLICY_SLUG # variable SIGNPATH_ARTIFACT_CONFIGURATION_SLUG (optional: the project's default otherwise) # Only from main, and only when the publish job is about to replace the .exe: every request # waits for a person to approve it at SignPath, so a run that keeps the published file must # not ask. SignPath takes the unsigned .exe from the windows job's artifact and hands back the # signed one. A request nobody approves in two hours fails the job, and nothing is published. # TEST MODE: while SIGNPATH_SIGNING_POLICY_SLUG starts with "test" (SignPath's test-signing # policy, a self-signed certificate Windows does not trust), the job signs and checks that a # signature is there, keeps the result as the artifact JavisOS-Setup-testsigned to download # and look at, and the release keeps the UNSIGNED .exe: a test certificate never reaches users. sign-windows: needs: [ windows ] if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && vars.SIGNPATH_ORGANIZATION_ID != '' runs-on: windows-latest timeout-minutes: 150 env: TEST_SIGNING: ${{ startsWith(vars.SIGNPATH_SIGNING_POLICY_SLUG, 'test') }} outputs: signed: ${{ steps.plan.outputs.replace == 'true' && !startsWith(vars.SIGNPATH_SIGNING_POLICY_SLUG, 'test') }} steps: - uses: actions/checkout@v4 - name: Will the published .exe be replaced? id: plan shell: bash env: GH_TOKEN: ${{ github.token }} SIGNED: ${{ !startsWith(vars.SIGNPATH_SIGNING_POLICY_SLUG, 'test') }} FORCE: ${{ github.event_name == 'workflow_dispatch' }} run: bash packaging/publish-desktop.sh --plan - name: Sign JavisOS-Setup.exe at SignPath (waits for the approval) if: steps.plan.outputs.replace == 'true' uses: signpath/github-action-submit-signing-request@v3 with: api-token: ${{ secrets.SIGNPATH_API_TOKEN }} organization-id: ${{ vars.SIGNPATH_ORGANIZATION_ID }} project-slug: ${{ vars.SIGNPATH_PROJECT_SLUG }} signing-policy-slug: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }} artifact-configuration-slug: ${{ vars.SIGNPATH_ARTIFACT_CONFIGURATION_SLUG }} github-artifact-id: ${{ needs.windows.outputs.artifact-id }} wait-for-completion: true wait-for-completion-timeout-in-seconds: 7200 output-artifact-directory: signed - name: Check the signature if: steps.plan.outputs.replace == 'true' shell: pwsh run: | $f = Get-ChildItem signed -Recurse -Filter JavisOS-Setup.exe | Select-Object -First 1 if (-not $f) { throw "SignPath returned no JavisOS-Setup.exe" } $sig = Get-AuthenticodeSignature $f.FullName Write-Host "Signature: $($sig.Status) $($sig.SignerCertificate.Subject)" if ($env:TEST_SIGNING -eq "true") { # A test certificate is self-signed, so Windows reports UnknownError, not Valid. if (-not $sig.SignerCertificate) { throw "JavisOS-Setup.exe carries no signature" } if ($sig.Status -in @("NotSigned", "HashMismatch")) { throw "test signature is broken: $($sig.Status)" } Write-Host "Test signing works. The release keeps the unsigned .exe until the policy is release-signing." } elseif ($sig.Status -ne "Valid") { throw "JavisOS-Setup.exe is not validly signed" } New-Item -ItemType Directory -Force dist | Out-Null Copy-Item $f.FullName dist\JavisOS-Setup.exe -Force - uses: actions/upload-artifact@v4 if: steps.plan.outputs.replace == 'true' with: name: ${{ env.TEST_SIGNING == 'true' && 'JavisOS-Setup-testsigned' || 'JavisOS-Setup-signed' }} path: dist/JavisOS-Setup.exe if-no-files-found: error publish: needs: [ windows, macos, sign-windows ] # always(): sign-windows is skipped until SignPath is set up, and a skipped job would skip # this one too. A FAILED signing still stops the publish: never an unsigned file over a signed one. if: >- always() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && needs.windows.result == 'success' && needs.macos.result == 'success' && (needs.sign-windows.result == 'success' || needs.sign-windows.result == 'skipped') runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 # By name, never "all artifacts": the signed and the unsigned .exe carry the same file name. - uses: actions/download-artifact@v4 with: name: JavisOS-macOS path: out - uses: actions/download-artifact@v4 with: name: JavisOS-Setup path: out - uses: actions/download-artifact@v4 if: needs.sign-windows.outputs.signed == 'true' with: name: JavisOS-Setup-signed path: out-signed - name: Take the signed .exe when this run signed one if: needs.sign-windows.outputs.signed == 'true' run: cp -f out-signed/JavisOS-Setup.exe out/JavisOS-Setup.exe # The .dmg is replaced every time. The unsigned .exe only when something inside it # changed, so its file hash (all that Edge, SmartScreen and antivirus engines know it by) # stays the same between installer changes. "Run workflow" by hand always replaces it. # The reasons are in the header of packaging/publish-desktop.sh. - name: Publish on the "desktop" release env: GH_TOKEN: ${{ github.token }} SIGNED: ${{ secrets.WINDOWS_CERT_PFX_BASE64 != '' || (vars.SIGNPATH_ORGANIZATION_ID != '' && !startsWith(vars.SIGNPATH_SIGNING_POLICY_SLUG, 'test')) }} FORCE: ${{ github.event_name == 'workflow_dispatch' }} run: bash packaging/publish-desktop.sh out