Merge branch 'dev'
Generic: Repo Health / Site Health (push) Has been cancelled
Universal: Cascade Main → Dev / Cascade main → branches (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled

# Conflicts:
#	cli/version_bump.php
This commit is contained in:
Jonathan Miller
2026-05-26 20:39:51 -05:00
6 changed files with 35 additions and 39 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<name>moko-platform</name>
<org>MokoConsulting</org>
<description>Enterprise automation, validation, sync, and governance engine for all Moko Consulting repositories</description>
<version>09.01.00</version>
<version>09.02.05</version>
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
</identity>
<governance>
+8 -8
View File
@@ -76,14 +76,15 @@ jobs:
run: |
STABILITY="${{ inputs.stability || 'development' }}"
# Map stability to Gitea release tag
case "$STABILITY" in
development) SUFFIX="-dev"; TAG="development" ;;
alpha) SUFFIX="-alpha"; TAG="alpha" ;;
beta) SUFFIX="-beta"; TAG="beta" ;;
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
development) TAG="development" ;;
alpha) TAG="alpha" ;;
beta) TAG="beta" ;;
release-candidate) TAG="release-candidate" ;;
esac
# Read current version (bump already handled by push workflow)
# Read current version (includes suffix from manifest, e.g. 01.02.14-dev)
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null)
[ -z "$VERSION" ] && VERSION="00.00.01"
@@ -112,16 +113,15 @@ jobs:
EXT_ELEMENT=$(grep '^ext_element=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
ZIP_NAME=$(grep '^zip_name=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
[ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}${SUFFIX}.zip"
[ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}.zip"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT"
echo "ext_element=${EXT_ELEMENT}" >> "$GITHUB_OUTPUT"
echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ==="
echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION} ==="
- name: Create release
id: release
+7 -13
View File
@@ -182,14 +182,8 @@ jobs:
PHP_TAG=""
[ -n "$PHP_MINIMUM" ] && PHP_TAG="<php_minimum>${PHP_MINIMUM}</php_minimum>"
# Version suffix for non-stable
DISPLAY_VERSION="$VERSION"
case "$STABILITY" in
development) DISPLAY_VERSION="${VERSION}-dev" ;;
alpha) DISPLAY_VERSION="${VERSION}-alpha" ;;
beta) DISPLAY_VERSION="${VERSION}-beta" ;;
rc) DISPLAY_VERSION="${VERSION}-rc" ;;
esac
# VERSION already includes suffix from manifest (e.g. 01.02.14-dev)
# No separate DISPLAY_VERSION needed
MAJOR=$(echo "$VERSION" | awk -F. '{print $1}')
@@ -202,7 +196,7 @@ jobs:
*) RELEASE_TAG="v${MAJOR}" ;;
esac
PACKAGE_NAME="${EXT_ELEMENT}-${DISPLAY_VERSION}.zip"
PACKAGE_NAME="${EXT_ELEMENT}-${VERSION}.zip"
DOWNLOAD_URL="${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/download/${RELEASE_TAG}/${PACKAGE_NAME}"
INFO_URL="${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}"
@@ -211,7 +205,7 @@ jobs:
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
if [ -d "$SOURCE_DIR" ]; then
EXCLUDES=".ftpignore sftp-config* *.ppk *.pem *.key .env*"
TAR_NAME="${EXT_ELEMENT}-${DISPLAY_VERSION}.tar.gz"
TAR_NAME="${EXT_ELEMENT}-${VERSION}.tar.gz"
cd "$SOURCE_DIR"
zip -r "/tmp/${PACKAGE_NAME}" . -x $EXCLUDES
@@ -234,7 +228,7 @@ jobs:
"${API_BASE}/releases" \
-d "$(python3 -c "import json; print(json.dumps({
'tag_name': '${RELEASE_TAG}',
'name': '${RELEASE_TAG} (${DISPLAY_VERSION})',
'name': '${RELEASE_TAG} (${VERSION})',
'body': '${STABILITY} release',
'prerelease': True,
'target_commitish': 'main'
@@ -371,7 +365,7 @@ jobs:
git config --local user.name "gitea-actions[bot]"
git add updates.xml
git diff --cached --quiet || {
git commit -m "chore: update updates.xml (${STABILITY}: ${DISPLAY_VERSION}) [skip ci]" \
git commit -m "chore: update updates.xml (${STABILITY}: ${VERSION}) [skip ci]" \
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
git push
}
@@ -600,6 +594,6 @@ jobs:
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Stability | \`${STABILITY}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Version | \`${DISPLAY_VERSION}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Element | \`${EXT_ELEMENT}\` |" >> $GITHUB_STEP_SUMMARY
echo "| Download | [ZIP](${DOWNLOAD_URL}) |" >> $GITHUB_STEP_SUMMARY
+1 -1
View File
@@ -6,7 +6,7 @@ DEFGROUP: MokoStandards.Root
INGROUP: MokoStandards
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /README.md
VERSION: 09.02.04
VERSION: 09.02.05
BRIEF: Project overview and documentation
-->
+16 -14
View File
@@ -26,12 +26,14 @@ $root = realpath($path) ?: $path;
// -- 1. Read version from .mokogitea/manifest.xml (canonical) --
$mokoVersion = null;
$mokoSuffix = '';
$mokoManifest = "{$root}/.mokogitea/manifest.xml";
$mokoContent = '';
if (file_exists($mokoManifest)) {
$mokoContent = file_get_contents($mokoManifest);
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})</version>|', $mokoContent, $m)) {
if (preg_match('|<version>(\d{2}\.\d{2}\.\d{2})(?:-([a-z]+))?</version>|', $mokoContent, $m)) {
$mokoVersion = $m[1];
$mokoSuffix = isset($m[2]) ? $m[2] : '';
}
}
@@ -66,8 +68,8 @@ foreach ($manifestFiles as $xmlFile) {
$candidate = $xm[1];
if ($manifestVersion === null || version_compare($candidate, $manifestVersion, '>')) {
$manifestVersion = $candidate;
// Preserve the suffix from the manifest (e.g. -dev, -rc)
$manifestSuffix = $xm[2] ?? '';
// Preserve the suffix from the manifest (e.g. dev, rc) — strip leading dash
$manifestSuffix = ltrim($xm[2] ?? '', '-');
}
}
}
@@ -109,16 +111,15 @@ switch ($type) {
$new = sprintf('%02d.%02d.%02d', $major, $minor, $patch);
// Preserve suffix from the original version (e.g. -dev, -rc, -alpha, -beta)
// The suffix only changes when the branch changes, not on patch bumps
$suffix = $manifestSuffix ?? '';
$newWithSuffix = $new . $suffix;
// -- Determine suffix to preserve (moko manifest takes priority, then Joomla) --
$suffix = !empty($mokoSuffix) ? $mokoSuffix : (!empty($manifestSuffix) ? $manifestSuffix : '');
$newFull = $suffix !== '' ? "{$new}-{$suffix}" : $new;
// -- Update .mokogitea/manifest.xml (canonical target) --
// -- Update .mokogitea/manifest.xml (canonical — preserves suffix) --
if (file_exists($mokoManifest) && !empty($mokoContent)) {
$updated = preg_replace(
'|<version>\d{2}\.\d{2}\.\d{2}(?:-[a-z]+)?</version>|',
"<version>{$newWithSuffix}</version>",
"<version>{$newFull}</version>",
$mokoContent,
1
);
@@ -129,7 +130,7 @@ if (file_exists($mokoManifest) && !empty($mokoContent)) {
if (file_exists($readme) && !empty($readmeContent)) {
$updated = preg_replace(
'/(VERSION:\s*)\d{2}\.\d{2}\.\d{2}(?:-[a-z]+)?/m',
'${1}' . $newWithSuffix,
'${1}' . $newFull,
$readmeContent,
1
);
@@ -154,7 +155,7 @@ foreach ($xmlPatterns as $pattern) {
}
$newContent = preg_replace(
'|<version>\d{2}\.\d{2}\.\d{2}(?:-[a-z]+)?</version>|',
"<version>{$newWithSuffix}</version>",
"<version>{$newFull}</version>",
$content
);
if ($newContent !== $content) {
@@ -174,7 +175,7 @@ if (file_exists($packageJsonFile)) {
$pkgContent = file_get_contents($packageJsonFile);
$updatedPkg = preg_replace(
'/("version"\s*:\s*")\d{2}\.\d{2}\.\d{2}(?:-[a-z]+)?(")/m',
'${1}' . $newWithSuffix . '${2}',
'${1}' . $newFull . '${2}',
$pkgContent
);
if ($updatedPkg !== $pkgContent) {
@@ -189,7 +190,7 @@ if (file_exists($pyprojectFile)) {
$pyContent = file_get_contents($pyprojectFile);
$updatedPy = preg_replace(
'/^(version\s*=\s*")\d{2}\.\d{2}\.\d{2}(?:-[a-z]+)?(")/m',
'${1}' . $newWithSuffix . '${2}',
'${1}' . $newFull . '${2}',
$pyContent
);
if ($updatedPy !== $pyContent) {
@@ -198,5 +199,6 @@ if (file_exists($pyprojectFile)) {
}
}
echo "{$old}{$suffix} -> {$newWithSuffix}\n";
$oldFull = $suffix !== '' ? "{$old}-{$suffix}" : $old;
echo "{$oldFull} -> {$newFull}\n";
exit(0);
+2 -2
View File
@@ -30,7 +30,7 @@ if (file_exists($mokoManifest)) {
$xml = @simplexml_load_file($mokoManifest);
if ($xml !== false) {
$v = (string)($xml->identity->version ?? '');
if (preg_match('/^\d{2}\.\d{2}\.\d{2}$/', $v)) {
if (preg_match('/^\d{2}\.\d{2}\.\d{2}(-[a-z]+)?$/', $v)) {
$mokoVersion = $v;
}
}
@@ -119,7 +119,7 @@ if ($version === null) {
// -- Backfill: if manifest.xml exists but lacks <version>, insert it --
if (file_exists($mokoManifest)) {
$content = file_get_contents($mokoManifest);
if (!preg_match('|<version>\d{2}\.\d{2}\.\d{2}</version>|', $content)) {
if (!preg_match('|<version>\d{2}\.\d{2}\.\d{2}(-[a-z]+)?</version>|', $content)) {
if (strpos($content, '<license') !== false) {
$content = preg_replace(
'|(\s*<license)|',