fix(ci): a bundling concern had leaked into every compile

CI caught two things the previous commits broke, and the first is pointed: I declared the CLI
sidecar in `tauri.conf.json`, and **`tauri-build` validates `externalBin` at build-script
time** — so plain `cargo clippy` and `cargo test` on `pipdock-app` began failing in a fresh
clone with *"resource path `binaries\pipdock-x86_64-pc-windows-msvc.exe` doesn't exist"*.

It passed locally only because I had already staged the file. That is exactly the "works on
my machine" failure the commit that introduced it claimed to be preventing.

`externalBin` moves to `src-tauri/tauri.bundle.conf.json`, merged with `--config` only when
bundling. Compiling the app does not need the sidecar; bundling it does, and the config now
says so. Verified the way it should have been the first time: **`src-tauri/binaries/` deleted**,
then `cargo clippy -p pipdock-app --all-targets` and `cargo test --workspace` both clean —
and `npm run bundle` from that same state stages the sidecar and produces two installers, the
NSIS payload still carrying `pipdock-app.exe` and `pipdock.exe`.

The whole recipe now lives in one `npm run bundle` script the workflow calls, so nobody has
to remember that `--locked` goes after `--` or that the overlay exists. RELEASE-CI §3.1
records both traps rather than just the command.

Second breakage: `ci-integration.yml` hardcoded `%LOCALAPPDATA%\PipDock\tools` in three
places — it quarantines `ruff.exe` there to prove `PD-HLT-001` — and the data root had moved
under `data\`. A test that reaches into a path by hand is a test that has to be told when the
path moves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5 committed 2026-08-13 20:59:43 +07:00
1 parent 62308add6a
commit 9fee1cd077
6 files changed
+26 -15

No files matched your search

+3 -3
View File
@@ -157,7 +157,7 @@ jobs:
# A re-sync must repair the state PD-HLT-001 tells the user to re-sync out of. This
# shipped broken: `pip install -r` over satisfied pins is a no-op, so the sync installed
# nothing and then failed its own verification.
Remove-Item "$env:LOCALAPPDATA\PipDock\tools\.venv\Scripts\ruff.exe"
Remove-Item "$env:LOCALAPPDATA\PipDock\data\tools\.venv\Scripts\ruff.exe"
$need = (.\target\debug\pipdock.exe tools status --json | ConvertFrom-Json).need
if ($need.state -ne 'toolMissing' -or $need.tool -ne 'ruff') {
throw "a quarantined ruff.exe reported '$($need.state)', not toolMissing"
@@ -166,7 +166,7 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "a re-sync could not repair a missing tool" }
# Offline: PD-NET-011, exit 6, and no manifest left claiming the venv is good.
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\PipDock\tools"
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\PipDock\data\tools"
$env:PIP_NO_INDEX = '1'
$out = .\target\debug\pipdock.exe tools sync 2>&1 | Out-String
$code = $LASTEXITCODE
@@ -174,7 +174,7 @@ jobs:
Write-Host $out
if ($code -ne 6) { throw "an unreachable index exited $code, not 6" }
if ($out -notmatch 'PD-NET-011') { throw "an unreachable index did not report PD-NET-011" }
if (Test-Path "$env:LOCALAPPDATA\PipDock\tools\manifest.json") {
if (Test-Path "$env:LOCALAPPDATA\PipDock\data\tools\manifest.json") {
throw "a failed bootstrap left a manifest behind; the next run would think it was fresh"
}
+9 -9
View File
@@ -59,16 +59,16 @@ jobs:
- name: Install frontend dependencies
run: npm ci
# No separate frontend or CLI step: `tauri build` runs `beforeBuildCommand`, which is
# `npm run build && npm run bundle:cli`. Keeping them there rather than here is what makes a
# locally built installer identical to a released one — a bundle that differs by who built
# it is how "works on my machine" reaches a release.
# One script owns the recipe (`package.json` → `bundle`), so the workflow cannot drift
# from what a developer runs locally. It stages the CLI sidecar, then bundles with the
# overlay config that declares it.
#
# **The overlay exists because `tauri-build` validates `externalBin` at build-script time.**
# Declaring the sidecar in `tauri.conf.json` made plain `cargo clippy` and `cargo test` fail
# in a fresh clone with "resource path ... doesn't exist" — a bundling concern leaking into
# every compile. `--config` merges it in only when bundling.
- name: Build and bundle
# `--locked` is **cargo's** flag, not `tauri build`'s: everything after `--` is passed
# to the runner. Written the other way round it fails with "unexpected argument
# '--locked' found" before a single crate is compiled — and since no `v*` tag has ever
# been pushed, this workflow had never run to find out.
run: npx tauri build --bundles nsis,msi -- --locked
run: npm run bundle
- name: Collect artifacts
shell: pwsh
+6 -1
View File
@@ -42,7 +42,12 @@ Dependency updates use **Dependabot** (`.github/dependabot.yml`) — the portfol
## 3. Release pipeline (tag `v*`)
1. Windows runner: `npm ci` → `npx tauri build --bundles nsis,msi -- --locked` producing NSIS `.exe` + `.msi`. **The `--` matters**: `--locked` is cargo's flag and `tauri build` rejects it as its own. The frontend is built by tauri's `beforeBuildCommand`, so the workflow does not run `vite build` itself.
1. Windows runner: `npm ci` → **`npm run bundle`**, producing NSIS `.exe` + `.msi`. That one script owns the whole recipe so the workflow cannot drift from what a developer runs locally, and it encodes two things that are easy to get wrong:
- **`--locked` goes after `--`.** It is cargo's flag; `tauri build` rejects it as its own with *"unexpected argument"* before a single crate compiles.
- **The CLI sidecar is declared in an overlay** (`src-tauri/tauri.bundle.conf.json`, merged with `--config`), not in `tauri.conf.json`. `tauri-build` validates `externalBin` at build-script time, so declaring it in the base config makes plain `cargo clippy` and `cargo test` fail in a fresh clone with *"resource path … doesn't exist"* — a bundling concern leaking into every compile.
The frontend is built by tauri's `beforeBuildCommand`, so the workflow does not run `vite build` itself.
2. Compute and publish `SHA256SUMS.txt`.
3. Draft GitHub Release with generated changelog; manual publish (owner review) → `announce-release.yml` fires the Discord announcement.
4. Post-release checklist issue auto-opened: verify SmartScreen behavior, spot-check EN/VI in the shipped build.
+1
View File
@@ -17,6 +17,7 @@
"dev": "vite",
"build": "vite build",
"bundle:cli": "node scripts/bundle-cli.mjs",
"bundle": "npm run bundle:cli && tauri build --bundles nsis,msi --config src-tauri/tauri.bundle.conf.json -- --locked",
"preview": "vite preview",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"bundle": {
"externalBin": ["binaries/pipdock"]
}
}
+1 -2
View File
@@ -5,7 +5,7 @@
"identifier": "com.skullmute.pipdock",
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build && npm run bundle:cli",
"beforeBuildCommand": "npm run build",
"devUrl": "http://localhost:1420",
"frontendDist": "../dist"
},
@@ -28,7 +28,6 @@
"bundle": {
"active": true,
"targets": ["nsis", "msi"],
"externalBin": ["binaries/pipdock"],
"icon": ["icons/icon.ico"],
"copyright": "Copyright (C) 2026 Kokone (poli0981). Licensed under GPL-3.0-only.",
"category": "DeveloperTool",