Skip to content

Commit c984735

Browse files
feat(release): publish glibc Linux arm64 binaries (#301)
Linux arm64 binary installs were rejected before any download. Add the bun-linux-arm64 asset to the release matrix and let bl update fetch it. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 46f702b commit c984735

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎docs/agents/publish.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ workflow 的 `channel` 输入**只决定 npm dist-tag**(如 `mcp` / `plugin` /
7272
### channel 发布
7373

7474
1. 在 GitHub 触发 Publish workflow,mode 选 `channel`,channel 填 npm dist-tag 名:
75-
- **`bailian-cli`**:npm 发到该 tag;二进制同时刷新 CDN `sync-release.json`(与 tag 名无关)。本机验证:`BAILIAN_CHANNEL=sync-release`。**先发二进制(zip+tar.gz 上齐)再发静态仓 `install.sh`**,避免新脚本去拉还不存在的 `.tar.gz`。
75+
- **`bailian-cli`**:npm 发到该 tag;二进制同时刷新 CDN `sync-release.json`(与 tag 名无关)。本机验证:`BAILIAN_CHANNEL=sync-release`。
7676
- **`knowledge-studio-cli` 和两个 dsh 插件**:随上述流程发布 npm,七包使用同一个临时 beta 版本。
7777
2. CI 自动:生成 `0.0.0-beta-<sha7>-<YYYYMMDDHHMM>`(UTC 到分钟;同 commit 同分钟重跑会覆盖同号)→ 临时 bump → 自检 →(bailian-cli)**Bun 编二进制 + GH prerelease + 覆盖 `sync-release.json`** → **npm 发到 dist-tag** → 还原 package.json
7878
3. 对应脚本:`tools/release/publish-channel.mjs`
@@ -125,7 +125,7 @@ node tools/release/publish-channel.mjs --channel test --dry-run
125125
- **认证**:npm OIDC Trusted Publishing(无 token),需要 `id-token: write` 权限;OSS 通道复用同一 OIDC token 向 FC 证明身份(见上文「OSS 通道」)
126126
- **GitHub Release**:`contents: write` + `GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}`(stable / channel 均需)
127127
- **Node 版本**:24(npm 11.5+ 才支持 OIDC token 交换)
128-
- **Bun**:`oven-sh/setup-bun`,版本钉死在 workflow 中
128+
- **Bun**:`oven-sh/setup-bun`,版本钉死在 workflow 中。目标以 `tools/release/lib/binary-build.mjs` 的 `BINARY_TARGETS` 为准,含 glibc 的 `bun-linux-arm64`(x64 runner 交叉编译)
129129
- **darwin 签名**:编完后 `binary-codesign.mjs` 对 darwin Mach-O 做 ad-hoc 重签,并按 Apple 的方式重算每一页 SHA-256(末页不补零)。对不上就中止发布。macOS runner 额外跑 `codesign --verify --strict`。Linux runner 用 `rcodesign 0.29.0 sign`;不要用 `rcodesign verify`(会拒绝 Apple 已通过的 ad-hoc 签名)。漏签时 Apple Silicon 会在启动时 SIGKILL
130130
- **Actions 版本**:checkout/setup-node/pnpm-action 均为 v6(Node 24 兼容)
131131
- **npm 配置**:七个发布包(`bailian-cli-core` / `bailian-cli-runtime` / `bailian-cli-commands` / `bailian-cli` / `knowledge-studio-cli` / `bailian-kb-dsh` / `bailian-memo-dsh`)的 Trusted Publisher 指向 `modelstudioai/cli` 的 `publish.yml`;新增发布包时同步 npm Trusted Publisher

‎packages/core/src/install/cdn.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ export function detectBinaryPlatform(): { os: string; arch: string; fileSuffix:
7474
throw new Error(`Unsupported architecture for binary updates: ${arch}`);
7575
}
7676

77-
if (os === "linux" && normalizedArch === "arm64") {
78-
throw new Error(
79-
"linux arm64 is not supported for binary updates; use: npm install -g bailian-cli",
80-
);
81-
}
8277
if (os === "windows" && normalizedArch === "arm64") {
8378
throw new Error(
8479
"windows arm64 is not supported for binary updates; use: npm install -g bailian-cli",

‎tools/release/lib/binary-archive.test.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ describe("binary archive matrix", () => {
2121
"bl-1.2.3-darwin-x64.tar.gz",
2222
"bl-1.2.3-linux-x64.zip",
2323
"bl-1.2.3-linux-x64.tar.gz",
24+
"bl-1.2.3-linux-arm64.zip",
25+
"bl-1.2.3-linux-arm64.tar.gz",
2426
"bl-1.2.3-windows-x64.zip",
2527
]);
26-
expect(BINARY_TARGETS.filter((target) => unixTarTarget(target))).toHaveLength(3);
28+
expect(BINARY_TARGETS.filter((target) => unixTarTarget(target))).toHaveLength(4);
2729
expect(binaryTarAssetName("1.2.3", { os: "linux", arch: "x64" })).toBe(
2830
"bl-1.2.3-linux-x64.tar.gz",
2931
);

‎tools/release/lib/binary-build.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const BINARY_TARGETS = [
3636
{ bunTarget: "bun-darwin-arm64", os: "darwin", arch: "arm64", exe: false },
3737
{ bunTarget: "bun-darwin-x64", os: "darwin", arch: "x64", exe: false },
3838
{ bunTarget: "bun-linux-x64", os: "linux", arch: "x64", exe: false },
39+
{ bunTarget: "bun-linux-arm64", os: "linux", arch: "arm64", exe: false },
3940
{ bunTarget: "bun-windows-x64", os: "windows", arch: "x64", exe: true },
4041
];
4142

0 commit comments

Comments
 (0)