Add bun run bump automated version synchronization script and update guidelines
Binaries / Build & Release Binaries (push) Has been cancelled

This commit is contained in:
gitea committed 2026-08-25 16:06:09 +08:00
1 parent 539941bba5
commit 92189cc05e
5 files changed
+80 -5

No files matched your search

+3 -2
View File
@@ -17,6 +17,7 @@ Tests are colocated as `*.test.ts` files in `src/`. OpenAPI source YAML lives in
- `bun run probe -- <corpId>`: run the local connectivity/config probe.
- `bun run check`: type-check with `tsc --noEmit`.
- `bun test`: run all colocated Bun tests.
- `bun run bump <version | patch | minor>`: bump version across all manifest/skill/openapi files and bundle.
- `bun run openapi:bundle`: rebuild `dist/openapi.json`.
- `bun run build:binary`: compile the standalone `seal-home` binary to `dist/bin/seal-home` (gitignored).
- `bun run build:plugin`: bundle the MCP server to `dist/mcp/server.js` (tracked, used by `.mcp.json`).
@@ -38,9 +39,9 @@ Recent commits use concise imperative subjects, often `Add ...` or `Refine ...`,
## Release & Publishing Guidelines
1. **Version Bump Checklist**:
- Update version string in `package.json`, `.zcode-plugin/plugin.json`, `skills/seal-home/SKILL.md`, and `openapi/openapi.yaml`.
- Run `bun run bump <new-version | patch | minor>` (automatically updates `package.json`, `.zcode-plugin/plugin.json`, `skills/seal-home/SKILL.md`, `openapi/openapi.yaml`, and bundles `dist/`).
- Update `CHANGELOG.md` with new features and fixes.
- Run `bun run openapi:bundle && bun run build:plugin && bun test && bun run check`.
- Run `bun test && bun run check`.
2. **Tag & Release**:
- Create an annotated Git tag with a descriptive release summary:
```bash
+3 -3
View File
@@ -294,11 +294,11 @@ When `_langfuseTraceId` exists, downstream tools should fetch the trace directly
To release a new version of `seal-home`:
1. **Version Bump Checklist**:
- Bump version across `package.json`, `.zcode-plugin/plugin.json`, `skills/seal-home/SKILL.md`, and `openapi/openapi.yaml`.
- Run `bun run bump <new-version | patch | minor>` (automatically updates `package.json`, `.zcode-plugin/plugin.json`, `skills/seal-home/SKILL.md`, `openapi/openapi.yaml`, and bundles `dist/`).
- Update `CHANGELOG.md` with release notes and highlights.
- Run verification and bundles:
- Run verification tests:
```bash
bun run openapi:bundle && bun run build:plugin && bun test && bun run check
bun test && bun run check
```
2. **Tag & Publish**:
- Commit changes and create an annotated Git tag with release notes:
+1
View File
@@ -24957,6 +24957,7 @@ var package_default = {
check: "tsc --noEmit",
"build:binary": "node scripts/build-binary.mjs",
"build:plugin": "node scripts/build-plugin.mjs",
bump: "bun run scripts/bump-version.ts",
"openapi:bundle": "bun run scripts/bundle-openapi.ts",
test: "bun test"
},
+1
View File
@@ -14,6 +14,7 @@
"check": "tsc --noEmit",
"build:binary": "node scripts/build-binary.mjs",
"build:plugin": "node scripts/build-plugin.mjs",
"bump": "bun run scripts/bump-version.ts",
"openapi:bundle": "bun run scripts/bundle-openapi.ts",
"test": "bun test"
},
+72
View File
@@ -0,0 +1,72 @@
#!/usr/bin/env bun
import { readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { execSync } from "node:child_process";
const ROOT = join(import.meta.dirname, "..");
const pkgPath = join(ROOT, "package.json");
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
const currentVersion: string = pkg.version;
const input = process.argv[2]?.trim();
if (!input) {
console.error("Usage: bun run bump <version | patch | minor | major>");
console.error(`Current version: ${currentVersion}`);
process.exit(1);
}
let nextVersion = input.replace(/^v/, "");
if (input === "patch" || input === "minor" || input === "major") {
const [major, minor, patch] = currentVersion.split(".").map(Number);
if (input === "patch") nextVersion = `${major}.${minor}.${patch + 1}`;
if (input === "minor") nextVersion = `${major}.${minor + 1}.0`;
if (input === "major") nextVersion = `${major + 1}.0.0`;
}
if (!/^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/.test(nextVersion)) {
console.error(`Invalid SemVer format: '${nextVersion}'`);
process.exit(1);
}
console.log(`==> Bumping version: ${currentVersion} -> ${nextVersion}`);
// 1. package.json
pkg.version = nextVersion;
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
console.log("✓ Updated package.json");
// 2. .zcode-plugin/plugin.json
const pluginPath = join(ROOT, ".zcode-plugin", "plugin.json");
const plugin = JSON.parse(readFileSync(pluginPath, "utf-8"));
plugin.version = nextVersion;
writeFileSync(pluginPath, JSON.stringify(plugin, null, 2) + "\n");
console.log("✓ Updated .zcode-plugin/plugin.json");
// 3. skills/seal-home/SKILL.md
const skillPath = join(ROOT, "skills", "seal-home", "SKILL.md");
let skillContent = readFileSync(skillPath, "utf-8");
skillContent = skillContent.replace(/description: "v[\d.]+: /g, `description: "v${nextVersion}: `);
skillContent = skillContent.replace(/version: [\d.]+/g, `version: ${nextVersion}`);
skillContent = skillContent.replace(/# Seal Home \(v[\d.]+\)/g, `# Seal Home (v${nextVersion})`);
skillContent = skillContent.replace(/\(v[\d.]+\)/g, `(v${nextVersion})`);
writeFileSync(skillPath, skillContent);
console.log("✓ Updated skills/seal-home/SKILL.md");
// 4. openapi/openapi.yaml
const openapiPath = join(ROOT, "openapi", "openapi.yaml");
let openapiContent = readFileSync(openapiPath, "utf-8");
openapiContent = openapiContent.replace(/version: [\d.]+/g, `version: ${nextVersion}`);
writeFileSync(openapiPath, openapiContent);
console.log("✓ Updated openapi/openapi.yaml");
// 5. Rebuild bundles
console.log("==> Rebuilding OpenAPI and plugin bundles...");
execSync("bun run openapi:bundle", { cwd: ROOT, stdio: "inherit" });
execSync("bun run build:plugin", { cwd: ROOT, stdio: "inherit" });
console.log("\n🎉 Successfully bumped version to " + nextVersion + "!");
console.log("\nNext steps to publish:");
console.log(` 1. Update CHANGELOG.md`);
console.log(` 2. git commit -am "Release v${nextVersion}: <Summary>"`);
console.log(` 3. git tag -a v${nextVersion} -m "🚀 <Release notes>"`);
console.log(` 4. git push origin master --tags && git push home master --tags\n`);