fix(release): use correct VERSION.json path in codebase-release
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f57e69f690
commit
d35dca04a1
1 changed files with 20 additions and 7 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue