build: multi channel install test

This commit is contained in:
rendianmeng
2026-07-23 18:18:46 +08:00
parent 9fbd2e4ec6
commit 168e2b5ccb
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -62,8 +62,10 @@ vp check
| 矩阵变更未通知脚本方 | 装错 arch / 永久失败 |
| webhook 配错当发版失败 | 不应;webhook 失败只 warn |
| 用 `Bun.build({ compile })` 代替 CLI | Bun ≤1.2.19 可能 exit 0 但不写 outfile → `sha256` ENOENT |
| 编译后未 `chmod` windows `.exe` | Bun 1.2.19 在 Unix 上写出 mode `000` → `sha256` / upload `EACCES` |
## 编译实现注意
- `binary-compile.mjs` 必须走 **`bun build --compile --outfile …`**,不要用 `Bun.build({ compile })`(CI 钉 `1.2.19` 时 API 会假成功)。
- 编译后校验 outfile 存在再算 SHA256。
- 每个产物在哈希前 `chmod 0755`(规避 Bun 1.2.19 windows cross-compile 无权限,见 oven-sh/bun#21308)。
+4 -1
View File
@@ -10,7 +10,7 @@
* --mode channel → writes <channel>.json only (does not touch latest.json)
*/
import { createHash } from "node:crypto";
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { spawnSync } from "node:child_process";
@@ -154,6 +154,9 @@ function compileOne({ bunTarget, os, arch, exe }, version, outdir, entry) {
}
if (result.stdout) process.stdout.write(result.stdout);
if (result.stderr) process.stderr.write(result.stderr);
// Bun 1.2.19 writes windows-x64 .exe with mode 000 on Unix hosts (oven-sh/bun#21308).
// chmod so sha256 / gh upload can open the file; harmless for other targets.
chmodSync(outfile, 0o755);
return { fileName, outfile, os, arch, sha256: sha256File(outfile) };
}