From 4f48dcae5cbd92e4ff8679fb74d0e8de44f1f3c2 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 23 May 2026 23:17:00 -0500 Subject: [PATCH] fix(ci): version bump after release + manifest-priority version read Pre-release workflow now reads current version from manifest (not bumps before build), builds the release, then bumps for next dev cycle. version_bump.php and version_read.php check both README.md and manifest XML, using the higher version as the base. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- .mokogitea/workflows/pre-release.yml | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.mokogitea/workflows/pre-release.yml b/.mokogitea/workflows/pre-release.yml index 57d3380..0c24e75 100644 --- a/.mokogitea/workflows/pre-release.yml +++ b/.mokogitea/workflows/pre-release.yml @@ -77,24 +77,17 @@ jobs: release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;; esac - # Bump patch version - BUMP_OUTPUT=$(php ${MOKO_API}/version_bump.php --path .) - VERSION=$(echo "$BUMP_OUTPUT" | grep -oP '\d{2}\.\d{2}\.\d{2}$' || true) - [ -z "$VERSION" ] && VERSION=$(php ${MOKO_API}/version_read.php --path .) + # Read current version from manifest (priority) or README — no bump yet + VERSION=$(php ${MOKO_API}/version_read.php --path .) echo "Version: ${VERSION}" - # Update platform-specific manifest + # Ensure platform-specific manifest matches php ${MOKO_API}/version_set_platform.php --path . --version "${VERSION}" - # Commit version bump + # Git setup for later commits git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" git config --local user.name "gitea-actions[bot]" git remote set-url origin "https://jmiller:${{ secrets.GA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" - git add -A - git diff --cached --quiet || { - git commit -m "chore(version): bump to ${VERSION} [skip ci]" - git push origin HEAD 2>&1 - } # Detect element from Joomla/Dolibarr manifest PLATFORM="${{ steps.platform.outputs.platform }}" @@ -244,3 +237,22 @@ jobs: echo "Deleted: ${TAG} (id: ${RELEASE_ID})" fi done + + - name: "Post-release version bump" + run: | + MOKO_API="/tmp/moko-platform-api/cli" + VERSION="${{ steps.meta.outputs.version }}" + + # Bump patch for next dev cycle + BUMP_OUTPUT=$(php ${MOKO_API}/version_bump.php --path .) + NEXT=$(echo "$BUMP_OUTPUT" | grep -oP '\d{2}\.\d{2}\.\d{2}$' || true) + [ -z "$NEXT" ] && exit 0 + + # Update platform-specific manifest to next version + php ${MOKO_API}/version_set_platform.php --path . --version "${NEXT}" + + git add -A + git diff --cached --quiet || { + git commit -m "chore: update development channel ${VERSION} [skip ci]" + git push origin HEAD 2>&1 + } -- 2.52.0