mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
feat(release): 给 publish.yml 加 bailian-kb-dsh 通道
复用同一个 Publish workflow 入口(package 下拉多一项 bailian-kb-dsh),路由到 独立的 publish-kb-dsh.mjs 处理: - 版本读自身 package.json(不广播全套 bl 版本) - stable 打 bailian-kb-dsh-v<version> tag(与 bl 的 v<version> 错开命名空间) - channel 临时 bump 到 0.0.0-beta-<sha>-<stamp>(形态与 bl channel 一致), finally 还原 package.json - 走自身的 tsc + tsdown build,无 binary,无 OSS CDN - 复用 lib/git.mjs / lib/npm.mjs / lib/proc.mjs 三个薄工具 - 复用 workflow 入口 UI 与 setup 步骤(checkout / pnpm / node 24 / gitleaks / install),stable 走 environment: production Required Reviewers gate 不复用 publish-stable.mjs / publish-channel.mjs:它们的 loadAndValidatePackages 会广播 core 版本给全套锁步包并强校验一致性,把 kb-dsh 塞进去第一步就 throw。 故意分开是为了保住这个隔离。 本地 --dry-run 端到端跑通:build → 幂等性查重 → pack + publint + gitleaks → pnpm publish --tag latest|<channel> --provenance --dry-run;channel 模式的 finally 还原后 git diff 干净。 文档:dsh-plugin.md 补发布小节 + 已知待办(publint 那条 web bundle CJS/ESM warning);publish.md 加 bailian-kb-dsh 定位;packages.mjs 与 AGENTS.md 的 注释同步指向新的 job 与 script 名。
This commit is contained in:
@@ -10,6 +10,7 @@ on:
|
||||
options:
|
||||
- bailian-cli
|
||||
- knowledge-studio-cli
|
||||
- bailian-kb-dsh
|
||||
mode:
|
||||
description: "Publish mode"
|
||||
required: true
|
||||
@@ -18,7 +19,7 @@ on:
|
||||
- channel
|
||||
- stable
|
||||
channel:
|
||||
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."
|
||||
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 and bailian-kb-dsh are npm-only."
|
||||
required: false
|
||||
type: string
|
||||
|
||||
@@ -28,7 +29,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
publish-stable:
|
||||
if: inputs.mode == 'stable'
|
||||
if: inputs.mode == 'stable' && inputs.package != 'bailian-kb-dsh'
|
||||
name: publish stable (${{ inputs.package }}) to npm + binary + tag
|
||||
runs-on: ubuntu-latest
|
||||
environment: production # Required Reviewers gate
|
||||
@@ -83,7 +84,7 @@ jobs:
|
||||
run: node tools/release/publish-stable.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }}
|
||||
|
||||
publish-channel:
|
||||
if: inputs.mode == 'channel'
|
||||
if: inputs.mode == 'channel' && inputs.package != 'bailian-kb-dsh'
|
||||
name: publish channel (${{ inputs.package }}) to npm + binary
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -138,3 +139,49 @@ jobs:
|
||||
BAILIAN_RELEASE_PREFIX: ${{ secrets.BAILIAN_RELEASE_PREFIX }}
|
||||
BAILIAN_STATIC_PREFIX: ${{ secrets.BAILIAN_STATIC_PREFIX }}
|
||||
run: node tools/release/publish-channel.mjs ${{ inputs.package == 'knowledge-studio-cli' && '--knowledge' || '' }} --channel "${{ inputs.channel }}"
|
||||
|
||||
# bailian-kb-dsh is the dsh plugin (downstream host adapter): independent version,
|
||||
# tsc + tsdown build, npm-only. It shares this workflow's entry UI and setup steps
|
||||
# but NOT publish-stable.mjs / publish-channel.mjs — those broadcast one version
|
||||
# across the locked bl package set and produce binary artifacts, neither of which
|
||||
# applies here. See docs/agents/dsh-plugin.md.
|
||||
publish-kb-dsh:
|
||||
if: inputs.package == 'bailian-kb-dsh'
|
||||
name: publish ${{ inputs.mode }} (bailian-kb-dsh) to npm
|
||||
runs-on: ubuntu-latest
|
||||
# stable goes through the Required Reviewers gate, same as the bl stable job;
|
||||
# channel stays ungated so dist-tag drops need no approval.
|
||||
environment: ${{ inputs.mode == 'stable' && 'production' || '' }}
|
||||
permissions:
|
||||
contents: write # push the bailian-kb-dsh-v<version> tag (stable only)
|
||||
id-token: write # OIDC for npm Trusted Publishing + provenance
|
||||
steps:
|
||||
- name: Require channel input
|
||||
if: ${{ inputs.mode == 'channel' && inputs.channel == '' }}
|
||||
run: |
|
||||
echo "::error::mode=channel requires the workflow input \"channel\" (npm dist-tag, e.g. mcp / plugin). Leave mode=stable if you do not need a dist-tag."
|
||||
exit 1
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: pnpm
|
||||
registry-url: "https://registry.npmjs.org/"
|
||||
|
||||
- name: Install gitleaks
|
||||
run: |
|
||||
set -euo pipefail
|
||||
GITLEAKS_VERSION=8.21.2
|
||||
curl -sSfL \
|
||||
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
|
||||
| sudo tar -xz -C /usr/local/bin gitleaks
|
||||
gitleaks version
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: publish-kb-dsh
|
||||
run: node tools/release/publish-kb-dsh.mjs ${{ inputs.mode == 'channel' && format('--channel "{0}"', inputs.channel) || '' }}
|
||||
|
||||
Reference in New Issue
Block a user