Merge pull request #148 from yunyingk/fix/plugin-artifact-distribution
CI / validate (push) Has been cancelled
CI / validate (push) Has been cancelled
fix(packaging): 移除受跟踪 bundle,补齐插件归档分发
This commit is contained in:
11 files changed
+159
-2443
No files matched your search
@@ -32,5 +32,5 @@ jobs:
|
||||
- run: bun run build:binary
|
||||
- run: bun run scripts/verify-binary.ts dist/bin/hose-use
|
||||
- run: bun run build:plugin
|
||||
- run: git diff --exit-code -- dist/mcp/server.js
|
||||
- run: bun run scripts/verify-binary.ts dist/mcp/server.js --plugin
|
||||
- run: bun run package:plugin
|
||||
@@ -88,6 +88,10 @@ jobs:
|
||||
bun run build:plugin
|
||||
bun run scripts/verify-binary.ts dist/mcp/server.js --plugin
|
||||
|
||||
- name: Package plugin archive
|
||||
if: ${{ !inputs.mirror_only }}
|
||||
run: bun run package:plugin
|
||||
|
||||
- name: Package release archives
|
||||
if: ${{ !inputs.mirror_only }}
|
||||
run: |
|
||||
@@ -114,6 +118,7 @@ jobs:
|
||||
(cd "${stage}" && zip -q "${GITHUB_WORKSPACE}/dist/bin/hose-use-windows-x64.zip" hose-use-windows-x64.exe hose-aipro.cmd)
|
||||
rm -rf "${stage}"
|
||||
|
||||
# Includes the plugin archive alongside platform binaries and archives.
|
||||
(cd dist/bin && sha256sum hose-use-* > checksums.txt)
|
||||
|
||||
- name: Publish GitHub Release
|
||||
@@ -149,6 +154,7 @@ jobs:
|
||||
TAG_NAME="${RELEASE_TAG}"
|
||||
if [ "${MIRROR_ONLY:-false}" = "true" ]; then
|
||||
# Preserve the published bytes and checksums; never rebuild or replace GitHub assets.
|
||||
# hose-use-* also includes the plugin archive, covered by checksums.txt.
|
||||
mkdir -p dist/bin
|
||||
gh release download "$TAG_NAME" --repo "$GITHUB_REPOSITORY" --dir dist/bin --pattern 'hose-use-*' --pattern checksums.txt
|
||||
(cd dist/bin && sha256sum --strict -c checksums.txt)
|
||||
|
||||
+1
-2
@@ -3,8 +3,7 @@ node_modules
|
||||
|
||||
# output
|
||||
out
|
||||
dist/bin/
|
||||
dist/hose-use-*
|
||||
dist/
|
||||
*.tgz
|
||||
|
||||
# code coverage
|
||||
|
||||
@@ -114,26 +114,73 @@ hose-use mcp # 启动 MCP Server (默认暴露
|
||||
- **多文件 Skill 模块体系**:知识体系划分至 `references/auth.md`、`references/bill.md`、`references/workflow.md`、`references/service.md`,执行 `hose-use skill install --yes` 自动递归安装到统一的 `~/.agents/skills/hose-use`;如需安装到其他位置,必须显式使用 `--dir`;
|
||||
- **开发环境检查**:Git 工作树、分支、无引用提交、canonical Skill 与全局开发版可通过 `bun run dev:status`、`bun run dev:check` 检查;清理必须先 `bun run dev:clean --dry-run`,再追加 `--yes`;
|
||||
- **原生 IDE 插件规范支持**:内嵌 `.zcode-plugin/plugin.json` 与 `.mcp.json` 清单,支持标准 IDE 插件市场/本地插件直接载入,并在设置界面支持可视化切换 MCP 开关;
|
||||
- **MCP 单文件产物**:`bun run build:plugin` 生成 `dist/mcp/server.js`,插件使用 Bun 1.3.14+ 运行,以支持共享 CLI 的 `bun:sqlite`。独立二进制的 `hose-use mcp` 已内嵌运行时,可直接启动。
|
||||
- **MCP 单文件产物**:`bun run build:plugin` 生成 `dist/mcp/server.js`,整个 `dist/` 不纳入 Git。源码方式加载插件须先安装依赖并执行此构建;插件使用 Bun 1.3.14+ 运行,以支持共享 CLI 的 `bun:sqlite`。独立二进制的 `hose-use mcp` 已内嵌运行时,可直接启动。
|
||||
- **完整插件包**:`bun run package:plugin` 从当前源码构建并生成 `dist/bin/hose-use-plugin-v<版本>.tar.gz`,内含清单、MCP 配置、Skill 与 bundle。Release 发布此包并纳入 `checksums.txt` 和 Gitea 镜像;解包目录可作为本地插件根目录,无需源码或 `node_modules/`,仍需 Bun。打包命令需要 `tar`;详细用法见 [构建与分发说明](./src/packaging/README.packaging.md)。
|
||||
|
||||
## 仓库目录导航
|
||||
|
||||
文件树会同时显示受 Git 管理的源码、分发文件和被忽略的本地文件;后者不一定出现在新克隆或独立工作树中。
|
||||
|
||||
| 目录 | 用途与保留依据 |
|
||||
|---|---|
|
||||
| `src/` | CLI、SDK、MCP、HTTP 与基础设施源码,分层见下方架构及各层 README。 |
|
||||
| `scripts/` | 构建、安装、版本同步、开发环境检查与规范生成脚本;入口见 [package.json](./package.json) 的 `scripts`。 |
|
||||
| `skills/hose-use/` | 随产品分发的 [操作技能源码](./skills/hose-use/SKILL.md),由 `src/packaging/` 内嵌并安装到 `~/.agents/skills/hose-use`。 |
|
||||
| `.agents/` | 本仓库的开发规则与技能发现配置,见 [.agents/README.md](./.agents/README.md);与产品分发用的 `skills/` 职责不同。 |
|
||||
| `.github/` | CI 与 Release 工作流,负责校验、构建和发布。 |
|
||||
| `.zcode-plugin/` | 受版本管理的 [IDE 插件清单](./.zcode-plugin/plugin.json),声明 Skill 路径、MCP 配置与用户开关。 |
|
||||
| `specs/` | API 与工作流规范:`openapi/` 是包装层 YAML 源文件,`openapi.json` 是其打包结果,`openapi.raw.json` 是独立的下游接口规范,`workflow-schema.json` 是从 Zod 导出的工作流结构。生成入口见下文。 |
|
||||
| `dist/`(本地) | 全部是已忽略的构建输出:`mcp/server.js` 是 [.mcp.json](./.mcp.json) 引用的插件 bundle,`bin/` 保存独立二进制与发布归档。可重新构建,不随 Git 分发;删除后再次加载源码插件前须先构建。详见 [构建与分发说明](./src/packaging/README.packaging.md)。 |
|
||||
| `docs/` | 跨模块参考与审阅记录。`modules/platform.md` 及部分域 README 仍含旧多工具 MCP 描述和旧代码路径,当前架构以 [AGENTS.md](./AGENTS.md) 与实现为准;`reviews/` 保留历史审阅及验证证据。 |
|
||||
| `enterprises/` | 仅跟踪配置示例与 [目录说明](./enterprises/README.md)。实际企业配置默认放在 `~/.config/hose-use/enterprises/`,仓库内其他企业 JSON 被忽略。 |
|
||||
| `.git/` 或 `.git` 文件 | Git 元数据;独立工作树中通常是指向共享仓库的文件。 |
|
||||
| `.zcode/`(本地) | 已忽略的工具工作目录,现有主目录中保存 `plans/`;与 `.zcode-plugin/` 插件清单无关,不参与构建。 |
|
||||
| `node_modules/`(本地) | `bun install` 安装的依赖,已忽略,可按 `bun.lock` 重建。 |
|
||||
| `exports/`(本地) | 已忽略的导出结果目录;文件是否仍需保留取决于具体业务,不属于源码或构建输入。 |
|
||||
|
||||
根目录文件的职责:
|
||||
|
||||
- [AGENTS.md](./AGENTS.md) 是项目开发规则总入口;`CLAUDE.md → AGENTS.md` 是兼容软链接,共享同一份内容。
|
||||
- [package.json](./package.json)、`bun.lock` 与 [tsconfig.json](./tsconfig.json) 分别管理项目入口和命令、锁定依赖、配置 TypeScript;[.env.example](./.env.example) 是环境变量示例。
|
||||
- [.mcp.json](./.mcp.json) 声明插件 MCP 启动方式,与 `.zcode-plugin/plugin.json` 配套;[.gitignore](./.gitignore) 声明本地数据与产物的忽略边界。
|
||||
- `ARCH-REVIEW.local.md`、`ROADMAP.local.md` 等 `*.local.md` 是已忽略的本地笔记,不是构建依赖或正式文档入口;`.DS_Store` 是已忽略的 macOS Finder 元数据,可清理。
|
||||
|
||||
规范生成关系与命令:
|
||||
|
||||
- `specs/openapi/**/*.yaml` → `specs/openapi.json`:`bun run openapi:bundle`。
|
||||
- `scripts/generate-raw-openapi.ts` → `specs/openapi.raw.json`:`bun run openapi:generate-raw`;与包装层规范描述不同接口,不是备份副本。
|
||||
- `src/domains/platform/types.ts` → `specs/workflow-schema.json`:`bun run export:workflow-schema`。
|
||||
|
||||
两份 OpenAPI JSON 都由 [内嵌分发层](./src/packaging/README.packaging.md) 直接导入并随 Git 提交;修改规范应更新对应源文件并重新生成,避免只改生成结果。
|
||||
|
||||
## 架构
|
||||
|
||||
```text
|
||||
src/
|
||||
├── cli.ts # CLI 入口 (bin: hose-use, hose-aipro)
|
||||
├── aipro-cli.ts # AI PRO 专用入口
|
||||
├── cli/ # CLI 核心引擎 (runner, parser, printer, commands)
|
||||
├── core/ # 基础设施与底层 SDK
|
||||
│ ├── auth/ # 认证与换票 (RSA 账密, TokenStore, AccountStore)
|
||||
│ ├── config/ # 多账号与企业配置管理
|
||||
│ ├── cache/ # 内存与 SQLite 多级缓存
|
||||
│ ├── db/ # SQLite 连接与版本迁移
|
||||
│ ├── http/ # HTTP 客户端工厂
|
||||
│ └── errors.ts # 统一异常语义
|
||||
├── domains/ # 业务域 SDK
|
||||
│ └── platform/ # 自建应用与 EASO/Piper 工作流引擎
|
||||
├── http/ # HTTP API 与交互式文档服务
|
||||
├── packaging/ # OpenAPI / Skill 内嵌与二进制运行态支持
|
||||
├── sdk.ts # SDK 对外导出入口
|
||||
└── server.ts # 精简核心 MCP 协议适配
|
||||
```
|
||||
|
||||
详细导航:[CLI](./src/cli/README.cli.md)、[Core](./src/core/README.core.md)、[业务域](./src/domains/README.domains.md)、[HTTP](./src/http/README.http.md)、[构建与分发](./src/packaging/README.packaging.md)。
|
||||
|
||||
## 已迁移功能
|
||||
|
||||
以下为历史能力迁移清单,括号中保留旧工具标识;当前命令见上方 CLI 速查,MCP 统一通过 `hose_cli` 调用。
|
||||
|
||||
### Platform
|
||||
- [x] 自建应用列表 (`platform_list`)
|
||||
- [x] EASO 四步认证
|
||||
|
||||
Vendored
-2427
File diff suppressed because it is too large.
Load diff
@@ -30,6 +30,7 @@
|
||||
"openapi:all": "bun run scripts/generate-raw-openapi.ts && bun run scripts/bundle-openapi.ts",
|
||||
"build:binary": "node scripts/build-binary.mjs",
|
||||
"build:plugin": "node scripts/build-plugin.mjs",
|
||||
"package:plugin": "node scripts/package-plugin.mjs",
|
||||
"dev:override": "bun run scripts/dev-override.ts",
|
||||
"dev:link": "bun run scripts/dev-override.ts",
|
||||
"dev:status": "bun run scripts/dev-hygiene.ts status",
|
||||
|
||||
@@ -5,6 +5,10 @@ import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const bun = process.env.BUN_BIN || "bun";
|
||||
const args = process.argv.slice(2);
|
||||
if (args.some(arg => !arg.startsWith("--outfile="))) {
|
||||
throw new Error("Usage: build-plugin.mjs [--outfile=<path>]");
|
||||
}
|
||||
|
||||
function run(args) {
|
||||
const result = spawnSync(bun, args, {
|
||||
@@ -17,7 +21,7 @@ function run(args) {
|
||||
}
|
||||
}
|
||||
|
||||
const mcpOutput = resolve(root, "dist/mcp/server.js");
|
||||
const mcpOutput = resolve(args.find(arg => arg.startsWith("--outfile="))?.slice("--outfile=".length) || resolve(root, "dist/mcp/server.js"));
|
||||
mkdirSync(dirname(mcpOutput), { recursive: true });
|
||||
// The shared CLI uses bun:sqlite; the plugin manifest must use this runtime too.
|
||||
// Embedded CommonJS loaders must use the bundle path, not the build host's absolute checkout path.
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { tmpdir } from "node:os";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const args = process.argv.slice(2);
|
||||
if (args.some(arg => !arg.startsWith("--out-dir="))) {
|
||||
throw new Error("Usage: package-plugin.mjs [--out-dir=<path>]");
|
||||
}
|
||||
const outputDir = resolve(args.find(arg => arg.startsWith("--out-dir="))?.slice("--out-dir=".length) || resolve(root, "dist/bin"));
|
||||
const { version } = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
||||
const archive = join(outputDir, `hose-use-plugin-v${version}.tar.gz`);
|
||||
const stage = mkdtempSync(join(tmpdir(), "hose-plugin-package-"));
|
||||
|
||||
function run(command, commandArgs) {
|
||||
const result = spawnSync(command, commandArgs, { cwd: root, stdio: "inherit" });
|
||||
if (result.error) throw result.error;
|
||||
if (result.status !== 0) throw new Error(`${command} failed with status ${result.status}`);
|
||||
}
|
||||
|
||||
try {
|
||||
// Explicit package inputs keep credentials, local notes and dependencies out of the archive.
|
||||
for (const path of [".zcode-plugin/plugin.json", ".mcp.json", "skills"]) {
|
||||
cpSync(join(root, path), join(stage, path), { recursive: true });
|
||||
}
|
||||
// Always build from current source; never package a stale local dist/ bundle.
|
||||
run(process.execPath, [join(root, "scripts/build-plugin.mjs"), `--outfile=${join(stage, "dist/mcp/server.js")}`]);
|
||||
mkdirSync(outputDir, { recursive: true });
|
||||
run("tar", ["-czf", archive, "-C", stage, ".zcode-plugin", ".mcp.json", "skills", "dist"]);
|
||||
console.log(`✓ Packaged plugin: ${archive}`);
|
||||
} finally {
|
||||
rmSync(stage, { recursive: true, force: true });
|
||||
}
|
||||
@@ -1,12 +1,37 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { existsSync, mkdtempSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
|
||||
test("source and committed plugin preserve offline review execution contracts", () => {
|
||||
test("source and freshly packaged plugin preserve offline review and MCP contracts without a prebuilt dist", () => {
|
||||
const root = resolve(import.meta.dir, "..");
|
||||
const temp = mkdtempSync(join(tmpdir(), "hose-review-plugin-"));
|
||||
const temp = mkdtempSync(join(tmpdir(), "hose review plugin "));
|
||||
try {
|
||||
const packaged = Bun.spawnSync([
|
||||
process.execPath, join(root, "scripts/package-plugin.mjs"), `--out-dir=${join(temp, "artifacts")}`,
|
||||
], { cwd: temp, env: { ...process.env, BUN_BIN: process.execPath }, timeout: 30_000 });
|
||||
expect(packaged.exitCode, packaged.stderr.toString()).toBe(0);
|
||||
const version = JSON.parse(readFileSync(join(root, "package.json"), "utf8")).version;
|
||||
const archive = join(temp, "artifacts", `hose-use-plugin-v${version}.tar.gz`);
|
||||
const pluginRoot = join(temp, "unpacked");
|
||||
mkdirSync(pluginRoot);
|
||||
const extracted = Bun.spawnSync(["tar", "-xzf", archive, "-C", pluginRoot]);
|
||||
expect(extracted.exitCode, extracted.stderr.toString()).toBe(0);
|
||||
expect(readdirSync(pluginRoot).sort()).toEqual([".mcp.json", ".zcode-plugin", "dist", "skills"]);
|
||||
const manifest = JSON.parse(readFileSync(join(pluginRoot, ".zcode-plugin/plugin.json"), "utf8"));
|
||||
expect(manifest.version).toBe(version);
|
||||
expect(manifest.skills).toBe("skills");
|
||||
const mcp = JSON.parse(readFileSync(join(pluginRoot, manifest.mcpServers), "utf8")).mcpServers["hose-use"];
|
||||
expect(mcp.command).toBe("bun");
|
||||
const bundle = mcp.args[0].replace("${CLAUDE_PLUGIN_ROOT}", pluginRoot);
|
||||
expect(existsSync(bundle)).toBe(true);
|
||||
for (const file of readdirSync(join(root, "skills"), { recursive: true })) {
|
||||
expect(existsSync(join(pluginRoot, "skills", file))).toBe(true);
|
||||
}
|
||||
const protocol = Bun.spawnSync([
|
||||
process.execPath, join(root, "scripts/verify-binary.ts"), bundle, "--plugin",
|
||||
], { cwd: temp, timeout: 30_000 });
|
||||
expect(protocol.exitCode, protocol.stderr.toString()).toBe(0);
|
||||
const enterprises = join(temp, "enterprises");
|
||||
mkdirSync(enterprises);
|
||||
writeFileSync(join(enterprises, "smoke.json"), JSON.stringify({
|
||||
@@ -29,11 +54,11 @@ test("source and committed plugin preserve offline review execution contracts",
|
||||
for (const fixture of fixtures) {
|
||||
const file = join(temp, `${fixture.name}.script`);
|
||||
writeFileSync(file, fixture.code);
|
||||
for (const entry of [["src/cli.ts"], ["dist/mcp/server.js", "--hose-use-cli"]]) {
|
||||
for (const entry of [[join(root, "src/cli.ts")], [bundle, "--hose-use-cli"]]) {
|
||||
const result = Bun.spawnSync([
|
||||
process.execPath, ...entry, "workflow", "eval-script", "--file", file,
|
||||
"--type", fixture.type, "--corp", "smoke", "--stateless", "--json",
|
||||
], { cwd: root, env, timeout: 10000 });
|
||||
], { cwd: pluginRoot, env, timeout: 10000 });
|
||||
expect(result.exitCode).toBe(fixture.error ? 1 : 0);
|
||||
const report = JSON.parse(result.stdout.toString());
|
||||
expect(report.success).toBe(!fixture.error);
|
||||
@@ -44,4 +69,4 @@ test("source and committed plugin preserve offline review execution contracts",
|
||||
} finally {
|
||||
rmSync(temp, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
}, 60_000);
|
||||
@@ -38,7 +38,7 @@ function mirrorFixture(mode: "retry" | "skip" | "concurrency", mirrorOnly = fals
|
||||
const f = repository();
|
||||
const tools = join(f.root, "tools"), published = join(f.root, "published");
|
||||
mkdirSync(tools); mkdirSync(published); mkdirSync(join(f.root, "dist/bin"), { recursive: true });
|
||||
const names = mode === "concurrency" ? Array.from({ length: 5 }, (_, i) => `hose-use-fixture-${i}`) : ["hose-use-linux-x64"];
|
||||
const names = mode === "concurrency" ? Array.from({ length: 5 }, (_, i) => `hose-use-fixture-${i}`) : ["hose-use-linux-x64", "hose-use-plugin-v1.0.0.tar.gz"];
|
||||
const manifest = names.map(name => {
|
||||
const data = `published bytes for ${name}`;
|
||||
writeFileSync(join(published, name), data);
|
||||
@@ -138,9 +138,11 @@ describe("release preparation and publication guards", () => {
|
||||
for (const step of [...ci.jobs.validate.steps, ...steps]) if (step.uses) expect(step.uses).toMatch(/@[a-f0-9]{40}$/);
|
||||
expect(JSON.parse(readFileSync(join(root, ".mcp.json"), "utf8")).mcpServers["hose-use"].command).toBe("bun");
|
||||
expect(release.on.workflow_dispatch.inputs.mirror_only.type).toBe("boolean");
|
||||
for (const name of ["Compile multi-target binaries", "Package release archives", "Publish GitHub Release"]) {
|
||||
for (const name of ["Compile multi-target binaries", "Package plugin archive", "Package release archives", "Publish GitHub Release"]) {
|
||||
expect(steps.find((s: { name?: string }) => s.name === name).if).toBe("${{ !inputs.mirror_only }}");
|
||||
}
|
||||
expect(runs.findIndex((s: string) => s.includes("package:plugin"))).toBeLessThan(runs.findIndex((s: string) => s.includes("sha256sum hose-use-*")));
|
||||
expect(steps.find((s: { name?: string }) => s.name === "Package plugin archive").run).toBe("bun run package:plugin");
|
||||
}, 60_000);
|
||||
|
||||
test("a failed background Gitea upload makes the Release step fail", () => {
|
||||
|
||||
@@ -12,10 +12,34 @@
|
||||
|
||||
- 仅可被入口层与 `cli/` 导入;不得反向依赖 `domains/`。
|
||||
- 内嵌产物必须随 git 提交(`specs/*.json`),保证编译二进制无需构建步骤即可携带完整规范。
|
||||
- `dist/` 全部为本地构建产物,不纳入 Git;插件通过构建和 Release 归档分发。
|
||||
|
||||
## 插件构建与安装
|
||||
|
||||
源码目录作为本地插件加载前,先运行:
|
||||
|
||||
```bash
|
||||
bun install --frozen-lockfile
|
||||
bun run build:plugin
|
||||
```
|
||||
|
||||
`.mcp.json` 保持使用 `${CLAUDE_PLUGIN_ROOT}/dist/mcp/server.js`,由 Bun 1.3.14+ 启动。清理 `dist/` 后需要重新构建;普通 `bun test` 会在临时目录自行构建测试插件,不依赖预先存在的 bundle。
|
||||
|
||||
完整插件包通过以下命令生成(需要系统 `tar`):
|
||||
|
||||
```bash
|
||||
bun run package:plugin
|
||||
```
|
||||
|
||||
输出为 `dist/bin/hose-use-plugin-v<版本>.tar.gz`,只包含 `.zcode-plugin/plugin.json`、`.mcp.json`、`skills/` 和新构建的 `dist/mcp/server.js`,不会复用仓库本地的旧 bundle。归档根目录即插件根目录,不包含企业凭据、本地笔记、源码或 `node_modules/`。解压后的插件仍需 Bun 1.3.14+,无需再次安装项目依赖。
|
||||
|
||||
从 Release 下载插件包和同版本的 `checksums.txt`,核对对应资产的 SHA-256 后解压到独立目录,将该目录作为本地插件根目录加载。MCP 默认关闭,按插件配置启用后连接。
|
||||
|
||||
隔离构建可使用 `bun run build:plugin --outfile=/path/to/server.js`;隔离打包可使用 `bun run package:plugin --out-dir=/path/to/artifacts`。打包会清理临时构建目录,保留目标归档。
|
||||
|
||||
## 安装与自更新完整性
|
||||
|
||||
Release 同时发布平台二进制、归档和 `checksums.txt`。安装脚本与 `hose-use update` 固定一次解析得到的 tag,核对所选资产的 SHA-256,再进行解包或替换;校验条目缺失、重复或不匹配时失败。下载代理和 Gitea 不接收 GitHub 认证头。
|
||||
Release 同时发布平台二进制、平台归档、插件归档和 `checksums.txt`,插件包与平台资产使用同一份校验清单。安装脚本与 `hose-use update` 固定一次解析得到的 tag,核对所选平台资产的 SHA-256,再进行解包或替换;校验条目缺失、重复或不匹配时失败。下载代理和 Gitea 不接收 GitHub 认证头。
|
||||
|
||||
安装脚本支持 `HOSE_USE_VERSION=0.8.14` 固定版本,`HOSE_USE_MIRROR=auto|github|gitea` 选择镜像策略,`HOSE_USE_INSTALL_DIR=/path/to/bin` 指定安装目录。这些变量只作用于脚本;CLI 自更新继续使用其已有的源选择参数。默认仍优先选择可写的常见 bin 目录。
|
||||
|
||||
@@ -25,12 +49,12 @@ Skill 初始化明确执行 `skill install --yes`;失败会报告二进制已
|
||||
|
||||
## 构建与发布验证
|
||||
|
||||
- PR/main CI:冻结依赖安装、版本一致性、类型检查、全套测试、独立二进制和插件 bundle 的构建及 MCP 协议验证。
|
||||
- PR/main CI:冻结依赖安装、版本一致性、类型检查、全套测试、独立二进制和插件 bundle 的构建及 MCP 协议验证,以及完整插件包构建。测试会解包临时插件,核对包内清单和 Skill,并在独立目录验证离线脚本与 MCP 协议。
|
||||
- 独立二进制:`bun run build:binary`;`bun run scripts/verify-binary.ts dist/bin/hose-use` 在空工作目录和没有 Bun 的 PATH 下验证版本、单工具发现、真实调用与错误返回。
|
||||
- 插件 bundle:`bun run build:plugin`;`.mcp.json` 指定 Bun 1.3.14+,与共享 CLI 的 `bun:sqlite` 依赖一致;`bun run scripts/verify-binary.ts dist/mcp/server.js --plugin` 验证实际产物。
|
||||
- Release:构建前检查 tag 版本、实际 HEAD 和 main 祖先关系;手动触发也必须输入 tag。正式构建显式使用 `--release`,两个发布源都上传校验清单,后台镜像上传失败会使任务失败。
|
||||
|
||||
Gitea 同时最多传输两个资产,每个资产最多尝试三次;已有文件经 SHA-256 验证一致时直接保留。镜像传输中断后,可在 main 上手动运行 Release workflow,传入原 tag 并启用 `mirror_only`:该模式下载并核对 GitHub 已发布资产,只修复 Gitea,不重建或替换 GitHub 产物,也不移动 tag。
|
||||
Gitea 同时最多传输两个资产,每个资产最多尝试三次;已有文件经 SHA-256 验证一致时直接保留。镜像传输中断后,可在 main 上手动运行 Release workflow,传入原 tag 并启用 `mirror_only`:该模式下载并核对 GitHub 已发布资产(含插件包),只修复 Gitea,不重建或替换 GitHub 产物,也不移动 tag。
|
||||
|
||||
版本准备使用 `codex/release-vX.Y.Z` 或 `release/vX.Y.Z` 分支及干净工作区。`bun run bump <版本|patch|minor|major>` 在写入前校验分支、递增版本和重复 tag,再同步仓库版本及生成物;全局开发版同步通过单独的 `bun run dev:override` 执行。预检失败不写版本文件;后续生成步骤若失败,会保留可复查的仓库修改以便修复。
|
||||
|
||||
|
||||
Reference in new issue
Block a user