Skip to content

Commit 564e21d

Browse files
Merge pull request #130 from modelstudioai/feat/multi-channel-install
Feat/multi channel install
2 parents cf2592c + 081d098 commit 564e21d

49 files changed

Lines changed: 3084 additions & 215 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
- channel
1919
- stable
2020
channel:
21-
description: "dist-tag (channel mode only, e.g. mcp/plugin/advisor)"
21+
description: "Required when mode=channel. npm dist-tag only (lowercase, digits, dashes), e.g. mcp / plugin / sync-release. bailian-cli binary CDN always overwrites sync-release.json; knowledge-studio-cli is npm-only."
2222
required: false
2323
type: string
2424

@@ -29,11 +29,11 @@ concurrency:
2929
jobs:
3030
publish-stable:
3131
if: inputs.mode == 'stable'
32-
name: publish stable (${{ inputs.package }}) to npm + tag
32+
name: publish stable (${{ inputs.package }}) to npm + binary + tag
3333
runs-on: ubuntu-latest
3434
environment: production # Required Reviewers gate
3535
permissions:
36-
contents: write # push lightweight tag to origin
36+
contents: write # push tag + create GitHub Release with binary assets
3737
id-token: write # OIDC for npm Trusted Publishing + provenance
3838
steps:
3939
- uses: actions/checkout@v6
@@ -55,19 +55,47 @@ jobs:
5555
| sudo tar -xz -C /usr/local/bin gitleaks
5656
gitleaks version
5757
58+
- name: Ensure zip (per-platform binary archives)
59+
run: sudo apt-get update && sudo apt-get install -y zip
60+
5861
- run: pnpm install --frozen-lockfile
5962

63+
# Binary compile uses `bun build --compile` CLI (not Bun.build API).
64+
# Keep this pin in sync with any local smoke tests of binary-compile.mjs.
65+
- uses: oven-sh/setup-bun@v2
66+
with:
67+
bun-version: "1.2.19"
68+
6069
- name: publish-stable
70+
env:
71+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
# OSS release channel runs fully in CI: upload + reconcile + manifest.json.
73+
# All values come from repo Settings → Secrets — no OSS defaults live in
74+
# code. Leave AK/SK unset to skip the OSS channel; once enabled,
75+
# bucket/region/prefix are required.
76+
BAILIAN_OSS_AK: ${{ secrets.BAILIAN_OSS_AK }}
77+
BAILIAN_OSS_SK: ${{ secrets.BAILIAN_OSS_SK }}
78+
BAILIAN_OSS_BUCKET: ${{ secrets.BAILIAN_OSS_BUCKET }}
79+
BAILIAN_OSS_REGION: ${{ secrets.BAILIAN_OSS_REGION }}
80+
BAILIAN_OSS_ENDPOINT: ${{ secrets.BAILIAN_OSS_ENDPOINT }}
81+
BAILIAN_RELEASE_PREFIX: ${{ secrets.BAILIAN_RELEASE_PREFIX }}
82+
BAILIAN_STATIC_PREFIX: ${{ secrets.BAILIAN_STATIC_PREFIX }}
6183
run: node tools/release/publish-stable.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }}
6284

6385
publish-channel:
6486
if: inputs.mode == 'channel'
65-
name: publish channel (${{ inputs.package }}) to npm
87+
name: publish channel (${{ inputs.package }}) to npm + binary
6688
runs-on: ubuntu-latest
6789
permissions:
68-
contents: read # no tag, no Release; just publish
90+
contents: write # create prerelease GitHub Release with binary assets
6991
id-token: write # OIDC for npm Trusted Publishing + provenance
7092
steps:
93+
- name: Require channel input
94+
if: ${{ inputs.channel == '' }}
95+
run: |
96+
echo "::error::mode=channel requires the workflow input \"channel\" (npm dist-tag, e.g. mcp / plugin / sync-release). Leave mode=stable if you do not need a dist-tag."
97+
exit 1
98+
7199
- uses: actions/checkout@v6
72100

73101
- uses: pnpm/action-setup@v6
@@ -87,7 +115,26 @@ jobs:
87115
| sudo tar -xz -C /usr/local/bin gitleaks
88116
gitleaks version
89117
118+
- name: Ensure zip (per-platform binary archives)
119+
run: sudo apt-get update && sudo apt-get install -y zip
120+
90121
- run: pnpm install --frozen-lockfile
91122

123+
# Binary compile uses `bun build --compile` CLI (not Bun.build API).
124+
# Keep this pin in sync with any local smoke tests of binary-compile.mjs.
125+
- uses: oven-sh/setup-bun@v2
126+
with:
127+
bun-version: "1.2.19"
128+
92129
- name: publish-channel
130+
env:
131+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132+
# OSS release channel — same Settings-injected values as stable.
133+
BAILIAN_OSS_AK: ${{ secrets.BAILIAN_OSS_AK }}
134+
BAILIAN_OSS_SK: ${{ secrets.BAILIAN_OSS_SK }}
135+
BAILIAN_OSS_BUCKET: ${{ secrets.BAILIAN_OSS_BUCKET }}
136+
BAILIAN_OSS_REGION: ${{ secrets.BAILIAN_OSS_REGION }}
137+
BAILIAN_OSS_ENDPOINT: ${{ secrets.BAILIAN_OSS_ENDPOINT }}
138+
BAILIAN_RELEASE_PREFIX: ${{ secrets.BAILIAN_RELEASE_PREFIX }}
139+
BAILIAN_STATIC_PREFIX: ${{ secrets.BAILIAN_STATIC_PREFIX }}
93140
run: node tools/release/publish-channel.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }} --channel "${{ inputs.channel }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ lerna-debug.log*
1010
# Dependencies & build output
1111
node_modules
1212
dist
13+
dist-bin
1314
dist-ssr
1415
tools/generated
1516
.node-version

AGENTS.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ Skill / 命令手册随 `skills/bailian-cli/` 经 `npx skills add modelstudioai/
5656

5757
按当前任务从下表挑一条进入对应文档:
5858

59-
| 场景 | 何时进入 | 详见 |
60-
| -------------- | -------------------------------------------- | ---------------------------------------------------------------------------- |
61-
| 命令增删改 | 增加 / 删除 / 重命名 `bl xxx` 或入口命令路径 | [docs/agents/command-add-remove.md](docs/agents/command-add-remove.md) |
62-
| E2E 测试维护 | 新增/改命令或 e2e 用例、补 help/缺参/dry-run | [docs/agents/cli-e2e-tests.md](docs/agents/cli-e2e-tests.md) |
63-
| 批量压测 | 改/跑多能力并发压测、`test:stress`、fixtures | [docs/agents/stress-batch-tests.md](docs/agents/stress-batch-tests.md) |
64-
| 选项变更 | 给已有命令加 `--flag` 或改默认值 | [docs/agents/command-flag-change.md](docs/agents/command-flag-change.md) |
65-
| 模型上下架 | 增加新模型 / 改默认模型 / 废弃旧模型 | [docs/agents/model-add-remove.md](docs/agents/model-add-remove.md) |
66-
| 错误文案变更 |`BailianError` 的 message 或 hint | [docs/agents/error-hint-change.md](docs/agents/error-hint-change.md) |
67-
| URL / 渠道变更 | 控制台域名 / 文档站 / 追踪参数 | [docs/agents/url-change.md](docs/agents/url-change.md) |
68-
| 鉴权扩展 | 加 OAuth / SSO / 换 token 来源 | [docs/agents/auth-change.md](docs/agents/auth-change.md) |
69-
| 配置项扩展 | 新 env var 或 `~/.bailian/config.json` 字段 | [docs/agents/config-add.md](docs/agents/config-add.md) |
70-
| Profile / 激活 | 改命名 Profile、预设或 `active_config` | [docs/agents/config-profile-change.md](docs/agents/config-profile-change.md) |
71-
| 安装文档 | 改安装、鉴权、验证流程或线上 install 页面 | [docs/agents/install-doc-change.md](docs/agents/install-doc-change.md) |
72-
| 发布 | channel / stable 发布到 npm(CI 驱动) | [docs/agents/publish.md](docs/agents/publish.md) |
73-
| Change Log | 发版说明 / 历史版本说明 | [docs/agents/changelog-write.md](docs/agents/changelog-write.md) |
74-
| 工具链调整 | lint 规则 / 构建配置 / 依赖升级 | [docs/agents/lint-toolchain.md](docs/agents/lint-toolchain.md) |
75-
| Command Pack | 扩展包 / 白名单 / plugin 管理命令 | [docs/agents/command-pack.md](docs/agents/command-pack.md) |
59+
| 场景 | 何时进入 | 详见 |
60+
| -------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
61+
| 命令增删改 | 增加 / 删除 / 重命名 `bl xxx` 或入口命令路径 | [docs/agents/command-add-remove.md](docs/agents/command-add-remove.md) |
62+
| E2E 测试维护 | 新增/改命令或 e2e 用例、补 help/缺参/dry-run | [docs/agents/cli-e2e-tests.md](docs/agents/cli-e2e-tests.md) |
63+
| 批量压测 | 改/跑多能力并发压测、`test:stress`、fixtures | [docs/agents/stress-batch-tests.md](docs/agents/stress-batch-tests.md) |
64+
| 选项变更 | 给已有命令加 `--flag` 或改默认值 | [docs/agents/command-flag-change.md](docs/agents/command-flag-change.md) |
65+
| 模型上下架 | 增加新模型 / 改默认模型 / 废弃旧模型 | [docs/agents/model-add-remove.md](docs/agents/model-add-remove.md) |
66+
| 错误文案变更 |`BailianError` 的 message 或 hint | [docs/agents/error-hint-change.md](docs/agents/error-hint-change.md) |
67+
| URL / 渠道变更 | 控制台域名 / 文档站 / 追踪参数 | [docs/agents/url-change.md](docs/agents/url-change.md) |
68+
| 鉴权扩展 | 加 OAuth / SSO / 换 token 来源 | [docs/agents/auth-change.md](docs/agents/auth-change.md) |
69+
| 配置项扩展 | 新 env var 或 `~/.bailian/config.json` 字段 | [docs/agents/config-add.md](docs/agents/config-add.md) |
70+
| Profile / 激活 | 改命名 Profile、预设或 `active_config` | [docs/agents/config-profile-change.md](docs/agents/config-profile-change.md) |
71+
| 安装文档 | 改安装、鉴权、验证流程或线上 install 页面 | [docs/agents/install-doc-change.md](docs/agents/install-doc-change.md) |
72+
| 发布 | channel / stable npm + 二进制(Bun / GitHub Release / OSS);安装脚本仓外维护 | [docs/agents/publish.md](docs/agents/publish.md) |
73+
| Change Log | 发版说明 / 历史版本说明 | [docs/agents/changelog-write.md](docs/agents/changelog-write.md) |
74+
| 工具链调整 | lint 规则 / 构建配置 / 依赖升级 | [docs/agents/lint-toolchain.md](docs/agents/lint-toolchain.md) |
75+
| Command Pack | 扩展包 / 白名单 / plugin 管理命令 | [docs/agents/command-pack.md](docs/agents/command-pack.md) |
7676

7777
如果当前任务无法对应任何场景,先按经验完成,然后**回来评估这是不是一类新场景** —— 是就新增 `docs/agents/<scenario>.md`,把清单沉淀下来。
7878

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
66

77
[中文版](CHANGELOG.zh.md) · [README](README.md) · [Contributing](CONTRIBUTING.md)
88

9+
## [1.14.0] - 2026-08-04
10+
11+
### Added
12+
13+
- **Standalone installation without Node.js** — binary packages are available for macOS on Apple Silicon and Intel, Linux x64, and Windows x64; npm installation remains supported.
14+
- **Exact-version updates** — binary and npm installations can use `bl update --to <version>` to update or switch to a specified version.
15+
16+
### Changed
17+
18+
- **Binary self-updates** — binary installations now check and download updates through a dedicated release channel. `bl update` no longer replaces the running executable, and the next invocation automatically uses the new version.
19+
920
## [1.13.1] - 2026-08-03
1021

1122
### Changed

CHANGELOG.zh.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66

77
[English](CHANGELOG.md) · [README](README.zh.md) · [参与贡献](CONTRIBUTING.zh.md)
88

9+
## [1.14.0] - 2026-08-04
10+
11+
### 新增
12+
13+
- **免 Node.js 的二进制安装** — 支持 macOS Apple Silicon / Intel、Linux x64 和 Windows x64;npm 安装方式继续保留。
14+
- **指定版本更新** — 二进制和 npm 安装均可通过 `bl update --to <version>` 更新或切换到指定版本。
15+
16+
### 变更
17+
18+
- **二进制自更新** — 二进制安装现在通过独立的发布通道检查和下载更新;执行 `bl update` 时不会覆盖正在运行的程序,下次运行自动使用新版本。
19+
920
## [1.13.1] - 2026-08-03
1021

1122
### 变更

0 commit comments

Comments
 (0)