CI: harden Windows build for the self-hosted China runner
Some checks failed
CI / Windows build (push) Has been cancelled
Some checks failed
CI / Windows build (push) Has been cancelled
Make the Gitea CI maximally likely to produce a usable Windows .exe on a self-hosted runner behind the GFW, since compilation must go through CI: - Build is the priority: format/analyze/test now run with continue-on-error so a toolchain-version lint difference can never block the actual compile. - ONNX Runtime download: default HTTP(S)_PROXY to the local proxy (http://127.0.0.1:7890, overridable via repo secrets) so CMake's file(DOWNLOAD) can fetch it; documented system-install alternative. - Checkout stays on the gitea.com mirror, with a commented manual-checkout fallback (clones from the local Gitea) if gitea.com is unreachable. - Artifact upload is best-effort; an explicit step prints the Release output path so the binary is findable even if upload fails. - Dropped the optional server job to keep the Windows build focused. - README: documented the runner prerequisites (Flutter on PATH, VS C++ build tools, proxy, gitea.com, host-mode runner) that the workflow can't set. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
README.md
31
README.md
@@ -46,12 +46,31 @@ flutter build windows --release
|
||||
|
||||
## Continuous integration
|
||||
|
||||
`.gitea/workflows/ci.yml` runs format + analyze + test + Windows release build on
|
||||
a self-hosted **Windows** runner. It is written for runners behind the GFW:
|
||||
actions come from the `gitea.com` mirror, Flutter is expected to be
|
||||
pre-installed on the runner, and pub uses the `flutter-io.cn` mirror. If
|
||||
`gitea.com` is unreachable too, set `DEFAULT_ACTIONS_URL=https://gitea.com` (or
|
||||
your own mirror) in the runner config and use bare `actions/checkout@v4`.
|
||||
`.gitea/workflows/ci.yml` builds a Windows release on a self-hosted **Windows**
|
||||
runner. Format/analyze/test run but are non-blocking, so a usable `.exe` is
|
||||
produced whenever the compile itself succeeds. It is written for runners behind
|
||||
the GFW: the checkout action comes from the `gitea.com` mirror, Flutter is
|
||||
expected to be pre-installed on the runner, pub uses `flutter-io.cn`, and the
|
||||
sqlite3 native binary is vendored.
|
||||
|
||||
### Self-hosted runner prerequisites
|
||||
|
||||
These must hold on the runner machine (they can't be set from the workflow):
|
||||
|
||||
1. **Flutter SDK on `PATH`** in the runner's shell (the first build step prints
|
||||
`flutter --version` and fails fast if it isn't).
|
||||
2. **Visual Studio Build Tools** with **Desktop development with C++** (MSVC +
|
||||
Windows SDK) — required to compile the Windows runner and the ONNX Runtime.
|
||||
3. **The local proxy running** (default `http://127.0.0.1:7890`) so the
|
||||
`flutter_onnxruntime` build can fetch the ONNX Runtime native lib. Override
|
||||
via repo secrets `HTTP_PROXY` / `HTTPS_PROXY`, or install ONNX Runtime
|
||||
system-wide to skip the download.
|
||||
4. **`gitea.com` reachable** (for the checkout action). If it isn't, switch to
|
||||
the manual-checkout fallback shown in `ci.yml` (it clones from your own Gitea
|
||||
instance), or set `DEFAULT_ACTIONS_URL=https://gitea.com` in the runner
|
||||
config and use bare `actions/checkout@v4`.
|
||||
5. **Runner in host mode** with a sane work directory — a malformed workspace
|
||||
path (e.g. `C:\C:\...`) is an `act_runner` config problem, not a workflow one.
|
||||
|
||||
## Architecture
|
||||
|
||||
|
||||
Reference in New Issue
Block a user