Skip to content

Commit ec90d8c

Browse files
committed
chore: bump VERSION 0.0.6-lpb [skip-version]
1 parent 7ec71eb commit ec90d8c

4 files changed

Lines changed: 62 additions & 21 deletions

File tree

.githooks/commit-msg

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/bin/bash
22
# Auto-increment patch version on every commit (unless [skip-version])
3-
# Only updates VERSION files + lpb.stack.env LPB_PI_REF
3+
# Increments VERSION across all stack repos and auto-commits with [skip-version]
44
# Does NOT touch package.json versions (kept at original fork versions)
55

66
COMMIT_MSG_FILE="$1"
77
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
8-
if echo "$COMMIT_MSG" | grep -q '\[skip-version\]'; then exit 0; fi
8+
9+
# [skip-version] → no bump, just pass through
10+
if echo "$COMMIT_MSG" | grep -q '\[skip-version\]'; then
11+
exit 0
12+
fi
913

1014
# Find devstack dir by searching upward from the git working tree
1115
DEVSTACK_DIR="$(git rev-parse --show-toplevel 2>/dev/null)"
@@ -19,21 +23,51 @@ PATCH=$(echo "$VERSION" | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/')
1923
NEW_PATCH=$((PATCH + 1))
2024
NEW_VERSION="0.0.${NEW_PATCH}${BASE}"
2125

22-
echo "$NEW_VERSION" > "$DEVSTACK_DIR/VERSION"
23-
2426
# Update VERSION in all stack repos
25-
declare -a REPOS=(
27+
REPOS=(
2628
"$DEVSTACK_DIR/workspace/pi"
2729
"/home/lpb/.pi/agent/git/github.com/localpibox/lemonade-pi-plugin"
2830
"/home/lpb/workspace/localpibox/config"
2931
"/home/lpb/workspace/localpibox/lpb-memory"
3032
"/home/lpb/.pi/agent/git/github.com/localpibox/pi-subagents"
3133
)
34+
35+
echo ""
36+
echo "=== Auto-bump VERSION ==="
37+
echo " $VERSION$NEW_VERSION"
38+
39+
echo "$NEW_VERSION" > "$DEVSTACK_DIR/VERSION"
40+
3241
for repo in "${REPOS[@]}"; do
3342
[ -f "$repo/VERSION" ] && echo "$NEW_VERSION" > "$repo/VERSION"
3443
done
3544

3645
# Update lpb.stack.env
37-
[ -f "$DEVSTACK_DIR/lpb.stack.env" ] && sed -i "s/^LPB_PI_REF=.*/LPB_PI_REF=$NEW_VERSION/" "$DEVSTACK_DIR/lpb.stack.env"
46+
if [ -f "$DEVSTACK_DIR/lpb.stack.env" ]; then
47+
sed -i "s/^LPB_PI_REF=.*/LPB_PI_REF=$NEW_VERSION/" "$DEVSTACK_DIR/lpb.stack.env"
48+
fi
49+
50+
# Auto-commit VERSION in each repo (with [skip-version] to avoid infinite loop)
51+
for repo in "${REPOS[@]}"; do
52+
repo_name=$(basename "$repo")
53+
[ -d "$repo" ] || continue
54+
[ -f "$repo/VERSION" ] || continue
55+
# Stage and commit if VERSION is the only staged change
56+
(cd "$repo" && git add VERSION 2>/dev/null)
57+
staged=$(cd "$repo" && git diff --cached --name-only 2>/dev/null)
58+
if [ "$staged" = "VERSION" ]; then
59+
(cd "$repo" && git commit -m "chore: bump VERSION $NEW_VERSION [skip-version]" --no-verify 2>/dev/null) && \
60+
echo "$repo_name: $NEW_VERSION" || \
61+
echo " ⚠️ $repo_name: version updated on disk, not committed"
62+
fi
63+
done
64+
65+
# Auto-commit VERSION in devstack
66+
(cd "$DEVSTACK_DIR" && git add VERSION lpb.stack.env 2>/dev/null)
67+
staged=$(cd "$DEVSTACK_DIR" && git diff --cached --name-only 2>/dev/null)
68+
if echo "$staged" | grep -q "VERSION"; then
69+
(cd "$DEVSTACK_DIR" && git commit -m "chore: bump VERSION $NEW_VERSION [skip-version]" --no-verify 2>/dev/null) && \
70+
echo " ✅ devstack: $NEW_VERSION"
71+
fi
3872

3973
exit 0

.githooks/pre-commit

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 2. lpb.stack.env LPB_PI_REF matches VERSION
77
# 3. settings.json pins match VERSION
88
# 4. All repos clean (except VERSION/env)
9-
# 5. Auto-add VERSION + env changes to staging
9+
# 5. Auto-stage + auto-commit VERSION across all repos
1010
#
1111
# Exit non-zero to abort commit.
1212

@@ -31,6 +31,20 @@ declare -a REPOS=(
3131
"/home/lpb/.pi/agent/git/github.com/localpibox/pi-subagents"
3232
)
3333

34+
check_repo_version() {
35+
local repo_path="$1"
36+
local repo_name="$2"
37+
[ -d "$repo_path" ] || return 0
38+
[ -f "$repo_path/VERSION" ] || return 0
39+
local repo_version
40+
repo_version=$(cat "$repo_path/VERSION")
41+
if [ "$repo_version" != "$CURRENT_VERSION" ]; then
42+
error "$repo_name: VERSION=$repo_version (expected $CURRENT_VERSION)"
43+
else
44+
info "$repo_name: $repo_version"
45+
fi
46+
}
47+
3448
SETTINGS_JSON="/home/lpb/.pi/agent/settings.json"
3549

3650
info() { echo "$*"; }
@@ -41,16 +55,7 @@ error() { echo " ❌ $*"; ERRORS=$((ERRORS + 1)); }
4155
echo "=== Stack Version Sync ==="
4256
for repo in "${REPOS[@]}"; do
4357
repo_name=$(basename "$repo")
44-
if [ ! -f "$repo/VERSION" ]; then
45-
error "$repo_name: missing VERSION file"
46-
continue
47-
fi
48-
repo_version=$(cat "$repo/VERSION")
49-
if [ "$repo_version" != "$CURRENT_VERSION" ]; then
50-
error "$repo_name: VERSION=$repo_version (expected $CURRENT_VERSION)"
51-
else
52-
info "$repo_name: $repo_version"
53-
fi
58+
check_repo_version "$repo" "$repo_name"
5459
done
5560

5661
# 2. Validate lpb.stack.env
@@ -115,15 +120,17 @@ done
115120

116121
check_unstaged "$DEVSTACK_DIR" "devstack"
117122

118-
# 5. Auto-add VERSION + env changes
123+
# 5. Auto-stage VERSION + env changes (commit-msg auto-commits after)
119124
if [ $ERRORS -eq 0 ] && [ "$CURRENT_VERSION" != "NOT FOUND" ]; then
120125
echo ""
121126
echo "=== Auto-stage VERSION ==="
122127
cd "$DEVSTACK_DIR" && git add VERSION lpb.stack.env 2>/dev/null
123128
for repo in "${REPOS[@]}"; do
129+
repo_name=$(basename "$repo")
130+
[ -d "$repo" ] || continue
124131
[ -f "$repo/VERSION" ] && (cd "$repo" && git add VERSION 2>/dev/null)
125132
done
126-
info "VERSION files + lpb.stack.env staged"
133+
info "VERSION files staged (auto-commit by commit-msg hook)"
127134
fi
128135

129136
# Result

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.5-lpb
1+
0.0.6-lpb

lpb.stack.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Fork URL — cumulative patches on top of earendil-works/pi
1515
LPB_PI_FORK=https://github.com/localpibox/pi.git
1616
# Branch — which branch to build from (the lpb branch is the stable base)
17-
LPB_PI_REF=0.0.5-lpb
17+
LPB_PI_REF=0.0.6-lpb
1818
# Upstream — original repo (for reference / rebasing)
1919
LPB_PI_UPSTREAM=https://github.com/earendil-works/pi.git
2020

0 commit comments

Comments
 (0)