Skip to content

Commit eaf0bcc

Browse files
committed
fix: complete localpibox package restore + stable release tooling
- Dockerfile: COPY dest back to /opt/pi-support/localpibox/ (import name) - support scripts: path probes check for localpibox/ dir (5 files) - localpibox/__init__.py: restore docstring (mangled by org sed) - CI: bump preserves major.minor, pushes to pushed branch (not dev) - CI: pipeline-aware image tags (:dev-* vs :main-* + :latest-* on main) - CI: tag-repos uses stable branches on main pipeline - lpb-config: new 'release status' + 'release promote' (dry-run, rebase first-release mode, local-ahead/dirty/conflict guards) - lpb-config: main-pipeline pin sync reads devstack origin/main VERSION - remove dead code: support/version.sh, .github/scripts/commit-msg-auto-version - skill: rewrite to current model (author identity, hooks no-op model, CI triggers, release procedure, org migration notes)
1 parent 107ef3e commit eaf0bcc

11 files changed

Lines changed: 571 additions & 450 deletions

File tree

.github/scripts/commit-msg-auto-version

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/build-and-publish.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# Version model (Option C):
1414
# - Single source: devstack/VERSION
1515
# - CI bumps version after tests pass, sets bumped value as CI output
16-
# - All 6 repos tagged together on each CI run (not pushed as a commit)
17-
# - Docker images tagged: :{version}-cli, :{version}-web
18-
# - Dev branch images: :dev-cli, :dev-web (always latest)
16+
# - The 5 stack repos (all except devstack) tagged on each CI run
17+
# - Dev pipeline (push to dev): 0.0.x-lpb-dev, images :dev-*, :{v}-*, :{sha}-*
18+
# - Main pipeline (push to main): 0.0.x-lpb, images :main-*, :latest-*, :{v}-*, :{sha}-*
1919
#
2020
# Actions: all latest major versions (Node.js 24 native)
2121
# actions/checkout@v6 · docker/build-push-action@v7
@@ -99,17 +99,19 @@ jobs:
9999
run: |
100100
set -e
101101
VERSION=$(cat VERSION 2>/dev/null || echo "0.0.0-lpb")
102+
MAJOR=$(echo "$VERSION" | sed 's/^\([0-9]*\)\..*/\1/')
103+
MINOR=$(echo "$VERSION" | sed 's/^[0-9]*\.\([0-9]*\)\..*/\1/')
102104
PATCH=$(echo "$VERSION" | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/')
103105
NEW_PATCH=$((PATCH + 1))
104-
106+
105107
# Add -dev suffix for dev branch, no suffix for main
106108
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
107109
SUFFIX=""
108110
else
109111
SUFFIX="-dev"
110112
fi
111-
NEW_VERSION="0.0.${NEW_PATCH}-lpb${SUFFIX}"
112-
113+
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}-lpb${SUFFIX}"
114+
113115
echo "Bumping $VERSION → $NEW_VERSION"
114116
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
115117
@@ -119,8 +121,7 @@ jobs:
119121
git config user.email "ci@lpb-stack.dev"
120122
git add VERSION
121123
git commit -m "chore: bump VERSION $NEW_VERSION" || echo "Nothing to commit"
122-
git commit -m "chore: bump VERSION $NEW_VERSION" || echo "Nothing to commit"
123-
git push origin dev --force-with-lease || echo "Push failed (already up-to-date)"
124+
git push origin "${GITHUB_REF_NAME}" --force-with-lease || echo "Push failed (already up-to-date)"
124125
125126
# ──────────────────────────────────────────────────────
126127
# Phase 3: Build & publish images
@@ -196,10 +197,11 @@ jobs:
196197
no-cache: ${{ github.event.inputs.no_cache == 'true' }}
197198
tags: |
198199
${{ env.IMAGE_NAME }}:${{ needs.bump-version.outputs.version }}-cli
199-
${{ env.IMAGE_NAME }}:dev-cli
200-
${{ env.IMAGE_NAME }}:main-cli
200+
${{ github.ref_name == 'main' && format('{0}:main-cli', env.IMAGE_NAME) || format('{0}:dev-cli', env.IMAGE_NAME) }}
201+
${{ github.ref_name == 'main' && format('{0}:latest-cli', env.IMAGE_NAME) || '' }}
201202
${{ env.IMAGE_NAME }}:${{ github.sha }}-cli
202203
${{ github.event_name == 'schedule' && format('{0}:weekly-cli', env.IMAGE_NAME) || '' }}
204+
${{ github.event_name == 'workflow_dispatch' && inputs.publish_latest == 'true' && format('{0}:latest-cli', env.IMAGE_NAME) || '' }}
203205
provenance: false
204206
platforms: linux/amd64
205207

@@ -271,10 +273,11 @@ jobs:
271273
no-cache: ${{ github.event.inputs.no_cache == 'true' }}
272274
tags: |
273275
${{ env.IMAGE_NAME }}:${{ needs.bump-version.outputs.version }}-web
274-
${{ env.IMAGE_NAME }}:dev-web
275-
${{ env.IMAGE_NAME }}:main-web
276+
${{ github.ref_name == 'main' && format('{0}:main-web', env.IMAGE_NAME) || format('{0}:dev-web', env.IMAGE_NAME) }}
277+
${{ github.ref_name == 'main' && format('{0}:latest-web', env.IMAGE_NAME) || '' }}
276278
${{ env.IMAGE_NAME }}:${{ github.sha }}-web
277279
${{ github.event_name == 'schedule' && format('{0}:weekly-web', env.IMAGE_NAME) || '' }}
280+
${{ github.event_name == 'workflow_dispatch' && inputs.publish_latest == 'true' && format('{0}:latest-web', env.IMAGE_NAME) || '' }}
278281
provenance: false
279282
platforms: linux/amd64
280283

@@ -294,14 +297,25 @@ jobs:
294297
GH_TOKEN: ${{ secrets.LPB_STACK_PAT }}
295298
run: |
296299
set -e
297-
# repo -> default branch mapping
298-
declare -A REPO_BRANCHS=(
299-
["lpb-stack/pi"]="lpb-dev"
300-
["lpb-stack/pi-subagents"]="lpb-dev"
301-
["lpb-stack/lemonade-pi-plugin"]="lpb-dev"
302-
["lpb-stack/config"]="dev"
303-
["lpb-stack/lpb-memory"]="dev"
304-
)
300+
# repo -> branch mapping per pipeline
301+
# dev pipeline: dev branches; main pipeline: stable branches
302+
if [ "${GITHUB_REF_NAME}" = "main" ]; then
303+
declare -A REPO_BRANCHS=(
304+
["lpb-stack/pi"]="lpb"
305+
["lpb-stack/pi-subagents"]="lpb"
306+
["lpb-stack/lemonade-pi-plugin"]="lpb"
307+
["lpb-stack/config"]="main"
308+
["lpb-stack/lpb-memory"]="main"
309+
)
310+
else
311+
declare -A REPO_BRANCHS=(
312+
["lpb-stack/pi"]="lpb-dev"
313+
["lpb-stack/pi-subagents"]="lpb-dev"
314+
["lpb-stack/lemonade-pi-plugin"]="lpb-dev"
315+
["lpb-stack/config"]="dev"
316+
["lpb-stack/lpb-memory"]="dev"
317+
)
318+
fi
305319
for repo in "${!REPO_BRANCHS[@]}"; do
306320
branch="${REPO_BRANCHS[$repo]}"
307321
echo "Tagging $repo@$VERSION (from $branch)"

0 commit comments

Comments
 (0)