Skip to content

Commit 780ca6a

Browse files
committed
refactor(ci): 合并知识库发布流程并支持多包发布
- 删除了单独的 publish-knowledge.yml 工作流 - 在 publish.yml 中添加 package 输入以支持多包发布 - 根据 package 选择性传递 --knowledge 标志给发布脚本 - 更新并重命名发布任务以反映 package 区别 - 修改并扩展并发组以包含 package 维度 - 注释更新,说明 knowledge-studio-cli 通过主工作流发布并共享依赖
1 parent a966b40 commit 780ca6a

3 files changed

Lines changed: 13 additions & 92 deletions

File tree

.github/workflows/publish-knowledge.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: Publish
33
on:
44
workflow_dispatch:
55
inputs:
6+
package:
7+
description: "Which package set to publish"
8+
required: true
9+
type: choice
10+
options:
11+
- bailian-cli
12+
- knowledge-studio-cli
613
mode:
714
description: "Publish mode"
815
required: true
@@ -16,13 +23,13 @@ on:
1623
type: string
1724

1825
concurrency:
19-
group: publish-${{ inputs.mode }}-${{ inputs.channel }}
26+
group: publish-${{ inputs.package }}-${{ inputs.mode }}-${{ inputs.channel }}
2027
cancel-in-progress: false
2128

2229
jobs:
2330
publish-stable:
2431
if: inputs.mode == 'stable'
25-
name: publish stable to npm + tag
32+
name: publish stable (${{ inputs.package }}) to npm + tag
2633
runs-on: ubuntu-latest
2734
environment: production # Required Reviewers gate
2835
permissions:
@@ -51,11 +58,11 @@ jobs:
5158
- run: pnpm install --frozen-lockfile
5259

5360
- name: publish-stable
54-
run: node tools/release/publish-stable.mjs
61+
run: node tools/release/publish-stable.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }}
5562

5663
publish-channel:
5764
if: inputs.mode == 'channel'
58-
name: publish beta to npm
65+
name: publish channel (${{ inputs.package }}) to npm
5966
runs-on: ubuntu-latest
6067
permissions:
6168
contents: read # no tag, no Release; just publish
@@ -83,4 +90,4 @@ jobs:
8390
- run: pnpm install --frozen-lockfile
8491

8592
- name: publish-channel
86-
run: node tools/release/publish-channel.mjs --channel "${{ inputs.channel }}"
93+
run: node tools/release/publish-channel.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }} --channel "${{ inputs.channel }}"

tools/release/lib/packages.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const PACKAGES = [
1010
];
1111

1212
// knowledge-studio-cli shares the same library deps as bailian-cli.
13-
// Published via a separate workflow (publish-knowledge.yml) with --knowledge flag.
13+
// Published via publish.yml with package=knowledge-studio-cli (passes --knowledge flag).
1414
export const KSCLI_PACKAGE = { key: "kscli", dir: "packages/kscli", name: "knowledge-studio-cli" };
1515
export const ALL_PACKAGES = [...PACKAGES, KSCLI_PACKAGE];
1616

0 commit comments

Comments
 (0)