Files
Calcium-Ion 0c1be7b1a9 refactor(plugins): 把插件 API v1 拆成独立模块 pluginkit (#8475)
插件 API v1 的元数据校验、utils、moejs 执行层和任务钩子的结果解析搬到
嵌套模块 github.com/QuantumNous/new-api/pluginkit,按 pluginkit/vX.Y.Z
打标签发布,其他宿主可以直接引用同一份实现。

- pkg/jsplugin 只留注册表、路由和 CLI,现有导出名通过别名保留,行为不变
- 文档 v1.md、v1.d.ts、v1.schema.json 移到 pluginkit/,schema 和类型由模块内嵌
- 请求处理钩子新增宿主专有的 ctx.client、ctx.session,new-api 不提供
- 导出 MaxPluginKeyLength、NewAPIReservedKeys 和 CallPathJSONInto
- CI、Makefile、Dockerfile 和 AGENTS.md 按 relaykit 的方式加上 pluginkit
2026-11-27 19:12:59 +08:00

109 lines
2.8 KiB
YAML

name: CI
on:
pull_request:
types: [opened, synchronize, closed]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Checkout the event commit in both jobs. A PR merge ref can disappear while
# queued runs start, and a base branch can advance after the merge event.
jobs:
backend:
name: Backend vet, build, and test
if: github.event.action != 'closed' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
timeout-minutes: 15
env:
GOWORK: 'off'
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ github.event.pull_request.base.repo.full_name }}
ref: ${{ github.sha }}
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: go.mod
cache-dependency-path: |
go.sum
relaykit/go.sum
tokenkit/go.sum
pluginkit/go.sum
- name: Create frontend embed placeholder
run: |
mkdir -p web/dist
touch web/dist/index.html
- name: Vet root module
run: go vet ./...
- name: Vet relaykit independently
working-directory: relaykit
run: go vet ./...
- name: Vet tokenkit independently
working-directory: tokenkit
run: go vet ./...
- name: Vet pluginkit independently
working-directory: pluginkit
run: go vet ./...
- name: Build root module
run: go build ./...
- name: Build relaykit independently
working-directory: relaykit
run: go build ./...
- name: Build tokenkit independently
working-directory: tokenkit
run: go build ./...
- name: Build pluginkit independently
working-directory: pluginkit
run: go build ./...
- name: Test root, relaykit, tokenkit, and pluginkit modules
run: make test
frontend:
name: Frontend typecheck and test
if: github.event.action != 'closed' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: web
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ github.event.pull_request.base.repo.full_name }}
ref: ${{ github.sha }}
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: '1.4.4'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck
run: bun check -b
- name: Test
run: bun run test