Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ Notable changes to `@wirecat/tg-cli`. One section per version, newest first; ver
- **The MCP server loads only when MCP is served** (cli-core 0.300.0), so other commands start with about a tenth
fewer files to load.

### Fixed

- **`bin/release` restarts itself once when the release brings a newer `bin/release`**: folding the changelog and
raising the version both fast-forward `main`, and the shell went on reading the old script from the byte it had
reached, so the rest of the run was a mix of old and new text. It now starts the new script over with the same
arguments; a second change during that run stops it with `run it again`. The restart also works when
`bin/release` was started from another folder by a relative path. Only the repository's own release is affected;
the published package does not change.

## 0.63.0 — 16.10.2026

### What's new
Expand Down
14 changes: 13 additions & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
set -eu

cd "$(dirname "$0")/.."
self=$(git hash-object bin/release)
# The fold and land() fast-forward main, and sh reads this file as it goes: a newer bin/release would run half old,
# half new. Run the new one from the start instead: the second run finds the fold and the raise already on main.
rerun_if_changed() {
[ "$(git hash-object bin/release)" != "$self" ] || return 0
[ -z "${WIRECAT_RELEASE_RERUN:-}" ] || { echo "bin/release changed again while releasing — run it again" >&2; exit 1; }
echo "bin/release changed on main — running the new one"
export WIRECAT_RELEASE_RERUN=1
exec ./bin/release "$@"
}
package=@wirecat/tg-cli

mode=ci
Expand All @@ -26,7 +36,7 @@ git fetch -q origin
before=$(git rev-parse HEAD)
git merge -q --ff-only origin/main
# The shell keeps running the file it read before the merge; max-cli published with a stale copy.
[ "$(git rev-parse HEAD)" = "$before" ] || exec "$0" "$@"
[ "$(git rev-parse HEAD)" = "$before" ] || exec ./bin/release "$@"
# The workflow publishes origin/main, so a local commit not pushed yet would silently not ship.
[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)" ] || { echo "main is ahead of origin/main — push first" >&2; exit 1; }
# One release at a time on this machine, across every package: two sessions published at once on 2026-10-08.
Expand Down Expand Up @@ -73,6 +83,7 @@ land() {
folded=""
published || folded=$(npx -y -p @wirecat/cli-base@0.36.0 cli-dev changelog fold --land --version "$version")
[ -z "$folded" ] || echo "$folded"
rerun_if_changed "$@"

# Two sessions preparing the same number is normal; the second takes the next free one (2026-09-29).
latest=$(npm view "$package" version --prefer-online 2>/dev/null || true)
Expand All @@ -92,6 +103,7 @@ if [ "$next" != "$version" ]; then
else swap("CHANGELOG.md", `\n## ${o} — `, `\n## ${n} — `)' "$version" "$next" "$taken"
body="bin/release: $why. Only the number changes: package.json, src/version.ts, the CHANGELOG heading."
land "release/$next" "chore(release): $next" "$body"
rerun_if_changed "$@"
version=$next
fi
if published; then
Expand Down
Loading