From d35dca04a1ecb56cf2ab36c884211c1ddbfc90d4 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Sun, 28 Dec 2025 03:53:12 -0800 Subject: [PATCH] fix(release): use correct VERSION.json path in codebase-release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .husky/post-push | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.husky/post-push b/.husky/post-push index a227c7cfd..730fb1b85 100755 --- a/.husky/post-push +++ b/.husky/post-push @@ -108,20 +108,33 @@ log_success "Synced with codebase" # ============================================================================= log_step "Incrementing version..." -# Source version library -source "$LIB_DIR/version-bump.sh" +# VERSION.json is in codebase-release (we're already cd'd there) +VERSION_FILE="$RELEASES_ROOT/VERSION.json" + +if [[ ! -f "$VERSION_FILE" ]]; then + log_warn "VERSION.json not found, creating..." + echo '{"major": 0, "merges": 0, "builds": 0, "version": "0.0.0"}' > "$VERSION_FILE" +fi # Calculate next version -CURRENT_VERSION=$(get_last_version) -NEXT_BUILD=$(($(jq -r '.builds' VERSION.json) + 1)) -NEW_VERSION="$(jq -r '.major' VERSION.json).$(jq -r '.merges' VERSION.json).$NEXT_BUILD" +CURRENT_VERSION=$(jq -r '.version' "$VERSION_FILE") +MAJOR=$(jq -r '.major' "$VERSION_FILE") +MERGES=$(jq -r '.merges' "$VERSION_FILE") +BUILDS=$(jq -r '.builds' "$VERSION_FILE") +NEXT_BUILD=$((BUILDS + 1)) +NEW_VERSION="$MAJOR.$MERGES.$NEXT_BUILD" log_info "Current: $CURRENT_VERSION" log_info "Next: $NEW_VERSION" if [[ "$DRY_RUN" != "true" ]]; then - # Actually increment - NEW_VERSION=$(increment_builds) + # Update VERSION.json + jq --arg v "$NEW_VERSION" \ + --argjson builds "$NEXT_BUILD" \ + --arg lastBuild "$(date -Iseconds)" \ + '.builds = $builds | .version = $v | .lastBuild = $lastBuild' \ + "$VERSION_FILE" > "$VERSION_FILE.tmp" && mv "$VERSION_FILE.tmp" "$VERSION_FILE" + git add VERSION.json git commit -m "build: v$NEW_VERSION