From a59dc504c56e3adc4ab67044458631f6108fb768 Mon Sep 17 00:00:00 2001 From: Yaowei Zheng Date: Thu, 6 Aug 2026 20:08:04 +0800 Subject: [PATCH] release: align the repo version with the shipped 0.2.1 and guard future tags (#219) Co-authored-by: Claude Fable 5 --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 6 ++++++ package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/core/src/index.ts | 2 +- packages/desktop/package.json | 2 +- packages/docs/package.json | 2 +- packages/landing/package.json | 2 +- packages/server/package.json | 2 +- packages/skills/package.json | 2 +- packages/web/package.json | 2 +- 12 files changed, 55 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab505fc..1652993 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,10 +116,31 @@ jobs: # message) and both standalone installers. The stamped installers then select the same immutable OSS/GitHub # release when run directly. BUILD_DATE is stamped alongside core with this run's UTC date. - name: Stamp release version + env: + # Referenced as a plain shell variable so the run block stays free of GitHub + # expressions: scripts/test-installer.sh replays this block verbatim as sh. + EVENT_NAME: ${{ github.event_name }} run: | TAG="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}" V="${TAG#v}" printf '%s\n' "$TAG" | grep -Eq '^v[0-9A-Za-z][0-9A-Za-z._-]*$' + # Guard: release prep must bump the repo to the tag's version (root + packages/*/package.json + # and core's VERSION constant move together in the release: X.Y.Z PR). v0.2.1 was tagged with + # a 0.2.0 repo, so every dev/source build nagged about updates until the repo caught up — + # fail the tag push instead. Manual dispatch (EVENT_NAME unset in replays) only warns, + # keeping legacy tags rebuildable; installer-test fixtures have no package.json, so the + # check self-skips there. + if [ -f package.json ]; then + PKG_V="$(node -p 'require("./package.json").version')" + if [ "$PKG_V" != "$V" ]; then + MSG="tag $TAG does not match the repo version $PKG_V; bump root + packages/*/package.json and core VERSION during release prep, then re-tag (see CONTRIBUTING.md)." + if [ "${EVENT_NAME:-}" = "push" ]; then + echo "error: $MSG" >&2 + exit 1 + fi + echo "warning: $MSG (continuing: manual dispatch)" >&2 + fi + fi grep -q 'export const VERSION = "' packages/core/src/index.ts sed -i "s/export const VERSION = \"[^\"]*\"/export const VERSION = \"$V\"/" packages/core/src/index.ts SH_MARKER='EMBEDDED_RELEASE_VERSION="__PENGUIN_RELEASE_VERSION__"' @@ -506,9 +527,27 @@ jobs: # workspace:* dep to the dependency's current version, so the versions must match. # BUILD_DATE is stamped alongside VERSION with this run's UTC date (the repo keeps null for dev builds). - name: Stamp release version + env: + # Same shell-variable indirection as the release job's stamp step (no GitHub + # expressions in the body; see scripts/test-installer.sh). + EVENT_NAME: ${{ github.event_name }} run: | TAG="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}" V="${TAG#v}" + # Same repo-version guard as the release job: both jobs start from a tag push in + # parallel, so the check must fail here too or npm would publish from a tag whose + # repo version was never bumped. Manual dispatch only warns (legacy-tag retries). + if [ -f package.json ]; then + PKG_V="$(node -p 'require("./package.json").version')" + if [ "$PKG_V" != "$V" ]; then + MSG="tag $TAG does not match the repo version $PKG_V; bump root + packages/*/package.json and core VERSION during release prep, then re-tag (see CONTRIBUTING.md)." + if [ "${EVENT_NAME:-}" = "push" ]; then + echo "error: $MSG" >&2 + exit 1 + fi + echo "warning: $MSG (continuing: manual dispatch)" >&2 + fi + fi grep -q 'export const VERSION = "' packages/core/src/index.ts sed -i "s/export const VERSION = \"[^\"]*\"/export const VERSION = \"$V\"/" packages/core/src/index.ts D="$(date -u +%Y-%m-%d)" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdcb19f..0dc861a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,6 +109,12 @@ pnpm test:e2e # core live-model e2e, need before creating the tag** — the release workflow reads it from the tag's checkout, so a file added later never reaches the Release page. Without it the workflow falls back to GitHub's auto-generated notes. +- **Release prep bumps the repo version**: the same `release: X.Y.Z` PR that renames + `changelog/unreleased/` also bumps the root and every `packages/*/package.json` + `version`, plus core's `VERSION` constant (`packages/core/src/index.ts`), to the release + version. The release workflow refuses a tag push whose version does not match the + repo's, so a forgotten bump fails before anything is published (v0.2.1 was tagged with a + 0.2.0 repo, and every dev build nagged about an update until the repo caught up). - README assets under `assets/readme/` are generated — the benchmark charts from the landing benchmark data, and the demo screenshots via `node packages/landing/scripts/capture-readme-demo.mjs` (build first; needs Playwright diff --git a/package.json b/package.json index 1ce60cc..fc7bbec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "penguin-harness", - "version": "0.2.0", + "version": "0.2.1", "private": true, "type": "module", "description": "PenguinHarness \u2014 TypeScript AI Agent (SDK + CLI).", diff --git a/packages/cli/package.json b/packages/cli/package.json index 61d3d62..cdc3a39 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-cli", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "description": "PenguinHarness CLI: interactive REPL and single-task runner over @prismshadow/penguin-core.", "license": "Apache-2.0", diff --git a/packages/core/package.json b/packages/core/package.json index 8f9be44..5366719 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-core", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "description": "PenguinHarness core SDK: context_engine, OmniMessage protocol, LLM/Environment interfaces.", "license": "Apache-2.0", diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 4eaad15..31aa59d 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -59,7 +59,7 @@ export { Agent, createAgent } from "./agent.js"; export type { CreateAgentOptions, CreateSessionOptions, ResumeSessionOptions } from "./agent.js"; /** SDK version number. */ -export const VERSION = "0.2.0"; +export const VERSION = "0.2.1"; /** Release build date (UTC yyyy-mm-dd), stamped by the release workflow next to VERSION; null in a dev/source build. */ export const BUILD_DATE: string | null = null; // Version-string helpers (shared by the CLI's `penguin update` and the server's update check). diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 11d62a7..b953737 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-desktop", - "version": "0.2.0", + "version": "0.2.1", "private": true, "type": "module", "description": "PenguinHarness desktop app: Electron shell running @prismshadow/penguin-server as a utilityProcess, window on http://localhost (same-origin HTTP/SSE, no private IPC).", diff --git a/packages/docs/package.json b/packages/docs/package.json index 89e8435..a72bb85 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-docs", - "version": "0.2.0", + "version": "0.2.1", "private": true, "type": "module", "description": "PenguinHarness documentation site (React + Vite + Tailwind CSS): bilingual zh/en Markdown pages with light/dark themes and per-page Copy Markdown, deployed to GitHub Pages under /docs/ next to the landing page.", diff --git a/packages/landing/package.json b/packages/landing/package.json index 2499375..e243005 100644 --- a/packages/landing/package.json +++ b/packages/landing/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-landing", - "version": "0.2.0", + "version": "0.2.1", "private": true, "type": "module", "description": "PenguinHarness landing page (React + Vite + Tailwind CSS): multilingual, light/dark themes, benchmark showcase, and a local Markdown blog, deployed to GitHub Pages via GitHub Actions.", diff --git a/packages/server/package.json b/packages/server/package.json index 3658511..3caf1d3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-server", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "description": "PenguinHarness web server: multi-user authentication and authorization, Session execution with SSE streaming, and usage accounting, built on @prismshadow/penguin-core.", "license": "Apache-2.0", diff --git a/packages/skills/package.json b/packages/skills/package.json index 00a0702..c2515f6 100644 --- a/packages/skills/package.json +++ b/packages/skills/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-skills", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "description": "PenguinHarness skill library: built-in SKILL.md documents and skill groups, decoupled from core.", "license": "Apache-2.0", diff --git a/packages/web/package.json b/packages/web/package.json index b42fd45..71a2e14 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@prismshadow/penguin-web", - "version": "0.2.0", + "version": "0.2.1", "private": true, "type": "module", "description": "PenguinHarness web frontend SPA: React + Vite + Tailwind CSS, rendering conversations streamed over the OmniMessage protocol, plus Agent configuration, model configuration, usage stats, and Traces.",