mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
feat(release): add --knowledge flag and publish-knowledge.yml workflow
- packages.mjs: export KSCLI_PACKAGE and ALL_PACKAGES for knowledge-studio-cli - check.mjs: support knowledge option to build/validate kscli - validate.mjs: accept packages param, validate all packages in lockstep - pack-scan.mjs: accept packages param - publish-stable.mjs: refactor to iterate PACKAGES array; add --knowledge flag - publish-channel.mjs: refactor to iterate PACKAGES array; add --knowledge flag - New workflow publish-knowledge.yml: triggers publish with --knowledge flag The original publish.yml (without --knowledge) publishes only core + cli. The new publish-knowledge.yml publishes core + cli + knowledge-studio-cli.
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
name: Publish Knowledge
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
mode:
|
||||
description: "Publish mode"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- channel
|
||||
- stable
|
||||
channel:
|
||||
description: "dist-tag (channel mode only, e.g. mcp/plugin/advisor)"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
group: publish-knowledge-${{ inputs.mode }}-${{ inputs.channel }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
publish-stable:
|
||||
if: inputs.mode == 'stable'
|
||||
name: publish stable (with knowledge) to npm + tag
|
||||
runs-on: ubuntu-latest
|
||||
environment: production # Required Reviewers gate
|
||||
permissions:
|
||||
contents: write # push lightweight tag to origin
|
||||
id-token: write # OIDC for npm Trusted Publishing + provenance
|
||||
steps:
|
||||
- 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-stable (with knowledge)
|
||||
run: node tools/release/publish-stable.mjs --knowledge
|
||||
|
||||
publish-channel:
|
||||
if: inputs.mode == 'channel'
|
||||
name: publish beta (with knowledge) to npm
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read # no tag, no Release; just publish
|
||||
id-token: write # OIDC for npm Trusted Publishing + provenance
|
||||
steps:
|
||||
- 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-channel (with knowledge)
|
||||
run: node tools/release/publish-channel.mjs --knowledge --channel "${{ inputs.channel }}"
|
||||
Reference in New Issue
Block a user