docs: Windows runner on the VDS (Server 2022 eval in a KVM VM, CRT user level, windows:host); desktop.yml comments

This commit is contained in:
CRTkafa 2026-10-10 22:59:02 +00:00
parent 882544dfdb
commit 67e490520b
2 changed files with 43 additions and 8 deletions

View file

@ -1,7 +1,7 @@
# storebound desktop: Linux (AppImage + deb) and Windows (NSIS, per user, unsigned) installers.
# macOS is built, signed and notarized on the owner's Mac (tools/desktop-release.ts mac); the updater signing key
# never reaches a runner: the Mac signs these installers after downloading them (tools/desktop-release.ts add).
# Runner setup (Forgejo runner on the VDS for Linux in Docker, a Windows runner later): docs/desktop-release.md.
# Runner setup (Forgejo runners on the VDS: Linux in Docker, Windows in a KVM VM): docs/desktop-release.md.
# Publishes nothing: the installers are workflow artifacts only (14 days); `tools/desktop-release.ts add` on the Mac
# signs and stages them, and only `publish` puts anything on storebound.dev.
name: desktop
@ -96,7 +96,7 @@ jobs:
windows:
# only on a manual run with "windows" ticked (a tag push never sets it), so without a Windows runner it is skipped
if: ${{ github.event_name == 'workflow_dispatch' && inputs.windows }}
# a Windows runner registered with the "windows" label (host mode): Rust (MSVC), Bun, 7-Zip
# the Windows runner on the VDS ("windows" label, host mode): Rust (MSVC), Bun, 7-Zip, pwsh
runs-on: windows
timeout-minutes: 90
env:

View file

@ -131,8 +131,8 @@ and choose Open Anyway (once).
## Windows and Linux (Forgejo Actions)
`.forgejo/workflows/desktop.yml` runs on a `desktop-v*` tag or by hand (workflow_dispatch; tick "windows" only when
a Windows runner exists).
`.forgejo/workflows/desktop.yml` runs on a `desktop-v*` tag or by hand (workflow_dispatch; tick "windows" for the
Windows installer too: a tag push builds Linux only).
- **Linux** (`runs-on: ubuntu-22.04`, a container): AppImage and .deb built with the path-free environment, then:
- self-tests of the extracted AppImage and the unpacked .deb;
@ -179,11 +179,46 @@ site/). Workflow artifacts of this public repository can be downloaded by anyone
set before bundling (linuxdeploy's own patchelf corrupts the bun executable; with the rpath already set it
leaves the file alone). The self-tests start the sidecar from the AppImage and the .deb, so a broken sidecar
fails the job.
3. **Windows runner (later).** The owner has no Windows machine yet. On one (Windows 10/11 x64):
- install Rust (MSVC, with the Visual Studio Build Tools), Bun and 7-Zip;
- run `forgejo-runner register --labels windows:host`, then `forgejo-runner daemon` as a service.
3. **Windows runner on the VDS (done).** Windows Server 2022 Standard (evaluation) in a KVM virtual machine, in
Docker (`dockurr/windows:6.05`), `/srv/windows-runner/`. Forgejo runner 13.2.0 (`vds-windows`, label
`windows:host`, capacity 1, job timeout 3 h), registered at the **CRT user level**: every CRT repository can use
it (storebound, Demo App, ...).
- **Resources:** 8 vCPUs, 12 GB RAM, a 150 GB disk (`storage/data.img`, sparse). `restart: unless-stopped`.
- **Network:** nothing public. The web viewer (8006), RDP (3389) and the VM's OpenSSH (22, as host port 2223) are
bound to 127.0.0.1 on the VDS; use an SSH tunnel (`ssh -L 8006:127.0.0.1:8006 root@<vds>`, then
http://127.0.0.1:8006). The VM reaches the internet and git.crt.fyi through the container's NAT. No host folders
but its own storage and `oem/` (copied into the VM once, at install).
- **Accounts:** `builder` (local admin, auto sign-in; password in `/srv/windows-runner/.env`, mode 600) and
`runner` (no admin rights, random password known only to Windows) for the service. OpenSSH takes only the key
in `/srv/windows-runner/ssh/` (`./vmssh`, `./vmscp` on the VDS).
- **Files:** `compose.yml`; `oem/install.bat` + `oem/setup.ps1` (first boot: OpenSSH, Windows Update policy, time
zone UTC+8); `provision.ps1` (build tools, idempotent, pinned downloads; log in `provision.log`);
`runner-setup.ps1` (account, `config.yml`, registration with a token on stdin, WinSW service);
`build/runner/` (forgejo-runner built from the v13.2.0 tag with `GOOS=windows`: Forgejo ships no Windows
binary).
- **Toolchain** (machine-wide, on the PATH the service sees): VS 2022 Build Tools 17.14 (MSVC x64/x86 and ARM64,
Windows 11 SDK 10.0.26100), rustup in `C:\rust` (stable-x86_64-pc-windows-msvc, writable by `runner`, so jobs
can `rustup target add`), Bun 1.4.0 (`bun`, `bunx`) in `C:\bun`, Git for Windows 2.56 (Git Bash's `bash` on the
PATH for `shell: bash`; `core.autocrlf false`, `core.longpaths true`), PowerShell 7.6 (`shell: pwsh`), Node 24
(JavaScript actions), 7-Zip 26.04, WebView2 runtime. Tauri fetches NSIS itself.
- **Service:** `forgejo-runner` (WinSW 2.12, delayed automatic start, restarts on failure) runs
`C:\forgejo-runner\forgejo-runner.exe daemon` as `runner`; jobs work in `C:\actions` (a daily task removes job
folders older than a day). Defender stays on, with exclusions for `C:\actions`, `C:\storebound-target`,
`C:\rust` and `C:\bun`.
- **Windows Update:** installs daily at 03:00 (UTC+8) and never restarts on its own while `builder` is signed
in (it always is); active hours 07:00 to 23:00. A restart for updates is manual:
`./vmssh "Restart-Computer -Force"` when no job runs.
- **Licensing:** the evaluation edition runs 180 days, then shuts down every hour. Extend it with
`slmgr /rearm` (6 rearms left at install, 180 days each; the VM was installed in October 2026) or rebuild the VM (delete `storage/`, `docker compose up -d`, run `provision.ps1`
and `runner-setup.ps1` again). The evaluation license is for evaluation and testing; for a permanent build
machine, buy a Windows Server (or Windows 11 Pro) license and enter the key.
- **Re-register** (a new token from CRT's user settings > Actions > Runners, or
`GET /api/v1/user/actions/runners/registration-token`): on the VDS, delete `C:\forgejo-runner\.runner` in the
VM and pipe the token into `./vmssh "powershell -File C:\provision\runner-setup.ps1"`.
- **Shared runner:** any workflow of any CRT repository with `runs-on: windows` runs here, as `runner`, with
internet access. Keep workflows of fork pull requests off it (as ci.yml does for Linux).
Until then, Windows waits; the workflow's Windows job only runs when "windows" is ticked.
The workflow's Windows job runs only when "windows" is ticked (from the API, `"inputs": {"windows": "on"}`).
4. **Windows code signing (later).** Buy a code-signing certificate, then sign the installer before `add` and pass
`--code-signed`.