Compare commits
160 Commits
version/02
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| c1e668e644 | |||
| 9a7d5b8359 | |||
| 9c9a1a7b52 | |||
| 21de2fa115 | |||
| 9f1848d218 | |||
| ecb456d91e | |||
| d9ce74cf38 | |||
| 91e9465233 | |||
| 3bbaee7c86 | |||
| d494e7366e | |||
| 05c3f5fd1f | |||
| c91b44ad34 | |||
| e86cc2b48b | |||
| c28c2de936 | |||
| 1a81267d38 | |||
| 343ef64ea2 | |||
| f47a4d3c77 | |||
| cfb05c5964 | |||
| ebbd1058f3 | |||
| 9e356fa4b5 | |||
| e030d85886 | |||
| ea9ac21d1a | |||
| e256acbcbb | |||
| b4d11df2a2 | |||
| 2c0ed08368 | |||
| 12fe6c196d | |||
| 0415972c7d | |||
| 6c7bb35ac3 | |||
| 834b1325b5 | |||
| 4a1b2ea143 | |||
| a748ee863c | |||
| 0546e1eaae | |||
| 4595db209e | |||
| 3f3ff49573 | |||
| 14318c90c2 | |||
| 3d79fe9aeb | |||
| d2e24741af | |||
| cb6582ef16 | |||
| d0c3a563d1 | |||
| 70b5c8de08 | |||
| a2eaf549af | |||
| c97c29f9ed | |||
| ea48f61f8c | |||
| d92df704c4 | |||
| ad4c658b3d | |||
| 0788e8e2ab | |||
| a68e90df9d | |||
| bacc0eba19 | |||
| c8f4e38f6b | |||
| 0dcb8a4a1d | |||
| fa31455619 | |||
| bf4dfac2a0 | |||
| d3ceea0e80 | |||
| 49a7418830 | |||
| 1b9fc4e0f8 | |||
| 426853aef7 | |||
| 3f20ad985c | |||
| ffa50f6460 | |||
| 08e2f171eb | |||
| 9d49968272 | |||
| be98c55e46 | |||
| c6c9b217a1 | |||
| 657928a01a | |||
| 91ad0353a6 | |||
| 431c907391 | |||
| 38d5a8eb90 | |||
| 19ab206f56 | |||
| 642aca10fe | |||
| a5b6d7a42a | |||
| 9003570c5a | |||
| c241463bb1 | |||
| 317c4e900a | |||
| e948074c6a | |||
| 848f07429c | |||
| 203327f5ed | |||
| 92261be464 | |||
| 28e61b8f8a | |||
| 188db2d4b8 | |||
| 1f0b4596ff | |||
| 1ed11dca03 | |||
| ecc5d624d5 | |||
| dac39212d7 | |||
| 43abc6514e | |||
| 8d42ef40c5 | |||
| 0546dde89f | |||
| 598ec0712c | |||
| 6f9df77f79 | |||
| 89aaef14e7 | |||
| f72cafe4d7 | |||
| a965bcf0ef | |||
| bd6eec88af | |||
| ce7e36f779 | |||
| 46b1469121 | |||
| 1e936a67c4 | |||
| 0903a4b335 | |||
| a7823c6440 | |||
| ed720b2ea9 | |||
| 263ac78515 | |||
| b9f83c43bc | |||
| f4609088e3 | |||
| d9326ea34b | |||
| 6589adcf75 | |||
| 2e2c1b82b3 | |||
| 0451fa2138 | |||
| 66b90754f8 | |||
| e66b7e9a79 | |||
| 4f056763e9 | |||
| de70224728 | |||
| 6f69af666f | |||
| 1f7278022c | |||
| b5e8d3dfe2 | |||
| 3edec0687c | |||
| a503e12ef9 | |||
| ea60ac60ba | |||
| 825820f7b9 | |||
| ba4a806cd7 | |||
| effd1fd588 | |||
| bf2b01df2d | |||
| 4581088a0a | |||
| 863dbb02f4 | |||
| 8fd8015b19 | |||
| 83ddbf0d73 | |||
| fad0170cef | |||
| a734d381ac | |||
| 0b8f492613 | |||
| 11c3488438 | |||
| cc709a0231 | |||
| 0a0d998208 | |||
| 03839601bb | |||
| 3e28dd4fae | |||
| 2674111e0b | |||
| 7488225aa6 | |||
| c1a9816c57 | |||
| 2d1932719a | |||
| 315be81e20 | |||
| 65d9aa3e9f | |||
| 8243e8c49d | |||
| c9d31b3ba4 | |||
| 29cfee7154 | |||
| bbae842fdb | |||
| 85e966a3f4 | |||
| 3d8bfb6112 | |||
| 7822064045 | |||
| 906861638f | |||
| 78dd453a9b | |||
| 204520d9c9 | |||
| 72b967c0ab | |||
| 781266885f | |||
| a869619fcd | |||
| 625965e129 | |||
| 91504c663b | |||
| 6cd690b737 | |||
| 3b2fe37ce1 | |||
| 8fea27e8b6 | |||
| cbea5752d1 | |||
| 34e789298b | |||
| 62c49eab5a | |||
| 2f8c81792d | |||
| 9a356cdd04 | |||
| 69ff510bac |
@@ -8,6 +8,7 @@
|
|||||||
<name>MokoWaaS</name>
|
<name>MokoWaaS</name>
|
||||||
<org>MokoConsulting</org>
|
<org>MokoConsulting</org>
|
||||||
<description>White-label identity, security hardening, and tenant restriction layer for WaaS-managed Joomla environments</description>
|
<description>White-label identity, security hardening, and tenant restriction layer for WaaS-managed Joomla environments</description>
|
||||||
|
<version>02.11.01</version>
|
||||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
||||||
</identity>
|
</identity>
|
||||||
<governance>
|
<governance>
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: moko-platform.Release
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
|
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||||
|
# VERSION: 09.02.00
|
||||||
|
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||||
|
|
||||||
|
name: "Universal: Auto Version Bump"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump:
|
||||||
|
name: Version Bump
|
||||||
|
runs-on: release
|
||||||
|
if: >-
|
||||||
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
|
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||||
|
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GA_TOKEN }}
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Setup moko-platform tools
|
||||||
|
run: |
|
||||||
|
if ! command -v composer &> /dev/null; then
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
if [ -d "/opt/moko-platform/cli" ]; then
|
||||||
|
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
||||||
|
else
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${{ secrets.GA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \
|
||||||
|
/tmp/moko-platform-api
|
||||||
|
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||||
|
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Bump version
|
||||||
|
run: |
|
||||||
|
BUMP=$(php ${MOKO_CLI}/version_bump.php --path . 2>&1) || true
|
||||||
|
echo "$BUMP"
|
||||||
|
|
||||||
|
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null) || true
|
||||||
|
[ -z "$VERSION" ] && { echo "No version found — skipping"; exit 0; }
|
||||||
|
|
||||||
|
# Propagate to platform manifests
|
||||||
|
php ${MOKO_CLI}/version_set_platform.php \
|
||||||
|
--path . --version "$VERSION" --branch dev 2>/dev/null || true
|
||||||
|
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
|
# Commit if anything changed
|
||||||
|
if git diff --quiet && git diff --cached --quiet; then
|
||||||
|
echo "No version changes to commit"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
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 commit -m "chore(version): patch bump to ${VERSION} [skip ci]" \
|
||||||
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
|
git push origin dev
|
||||||
|
echo "Bumped to ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -27,13 +27,19 @@ name: "Universal: Build & Release"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [closed]
|
types: [opened, closed]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- 'htdocs/**'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
action:
|
||||||
|
description: 'Action to perform'
|
||||||
|
required: false
|
||||||
|
type: choice
|
||||||
|
default: release
|
||||||
|
options:
|
||||||
|
- release
|
||||||
|
- promote-rc
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
@@ -45,11 +51,66 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# ── Draft PR → Promote highest pre-release to RC ─────────────────────────────
|
||||||
|
promote-rc:
|
||||||
|
name: Promote Pre-Release to RC
|
||||||
|
runs-on: release
|
||||||
|
if: >-
|
||||||
|
(github.event.action == 'opened' && github.event.pull_request.draft == true) ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GA_TOKEN }}
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Setup moko-platform tools
|
||||||
|
env:
|
||||||
|
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
|
run: |
|
||||||
|
if ! command -v composer &> /dev/null; then
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
|
/tmp/moko-platform-api
|
||||||
|
cd /tmp/moko-platform-api
|
||||||
|
composer install --no-dev --no-interaction --quiet
|
||||||
|
|
||||||
|
- name: Promote to release-candidate
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_promote.php \
|
||||||
|
--from auto --to release-candidate \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}" \
|
||||||
|
--branch "${{ github.event.pull_request.head.ref || 'dev' }}"
|
||||||
|
|
||||||
|
- name: Cascade lesser channels
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_cascade.php \
|
||||||
|
--stability release-candidate \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}"
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Draft PR opened — promoted highest pre-release to RC" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||||
release:
|
release:
|
||||||
name: Build & Release Pipeline
|
name: Build & Release Pipeline
|
||||||
runs-on: release
|
runs-on: release
|
||||||
if: >-
|
if: >-
|
||||||
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
|
github.event.pull_request.merged == true ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -96,18 +157,38 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
echo "release_tag=v${MAJOR}" >> "$GITHUB_OUTPUT"
|
echo "release_tag=stable" >> "$GITHUB_OUTPUT"
|
||||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "branch=version/${MAJOR}" >> "$GITHUB_OUTPUT"
|
echo "branch=main" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: "Step 1b: Bump version"
|
# -- CHECK FOR RC PROMOTION ------------------------------------------------
|
||||||
id: bump
|
- name: "Check for RC release"
|
||||||
|
id: rc
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
RC_JSON=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
||||||
|
"${API_BASE}/releases/tags/release-candidate" 2>/dev/null || echo "{}")
|
||||||
|
RC_ID=$(echo "$RC_JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('id',''))" 2>/dev/null || true)
|
||||||
|
|
||||||
|
if [ -n "$RC_ID" ] && [ "$RC_ID" != "None" ] && [ "$RC_ID" != "" ]; then
|
||||||
|
echo "promote=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "release_id=${RC_ID}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::notice::RC release found (id: ${RC_ID}) — will promote to stable"
|
||||||
|
else
|
||||||
|
echo "promote=false" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::notice::No RC release — full build pipeline"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: "Step 1b: Minor bump version"
|
||||||
|
id: bump
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
run: |
|
run: |
|
||||||
MOKO_API="/tmp/moko-platform-api/cli"
|
MOKO_API="/tmp/moko-platform-api/cli"
|
||||||
BUMP=$(php ${MOKO_API}/version_bump.php --path . --minor)
|
php ${MOKO_API}/version_bump.php --path . --minor 2>&1 || true
|
||||||
VERSION=$(echo "$BUMP" | grep -oP '\d{2}\.\d{2}\.\d{2}$' || true)
|
VERSION=$(php ${MOKO_API}/version_read.php --path .)
|
||||||
[ -z "$VERSION" ] && VERSION=$(php ${MOKO_API}/version_read.php --path .)
|
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
echo "Bumped to: ${VERSION}"
|
echo "Bumped to: ${VERSION}"
|
||||||
|
|
||||||
@@ -137,95 +218,8 @@ jobs:
|
|||||||
steps.check.outputs.already_released != 'true'
|
steps.check.outputs.already_released != 'true'
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
ERRORS=0
|
php /tmp/moko-platform-api/cli/release_validate.php \
|
||||||
|
--path . --version "$VERSION" --output-summary --github-output || true
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
MANIFEST="${{ steps.platform.outputs.manifest }}"
|
|
||||||
MOD_FILE="${{ steps.platform.outputs.mod_file }}"
|
|
||||||
echo "## Pre-Release Sanity Checks (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# -- Version drift check (must pass before release) --------
|
|
||||||
README_VER=$(sed -n 's/.*VERSION:[[:space:]]*\([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\).*/\1/p' README.md 2>/dev/null | head -1)
|
|
||||||
if [ "$README_VER" != "$VERSION" ]; then
|
|
||||||
echo "- Version drift: README says \`${README_VER}\` but releasing \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
else
|
|
||||||
echo "- Version consistent: \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check CHANGELOG version matches
|
|
||||||
CL_VER=$(sed -n 's/.*VERSION:[[:space:]]*\([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]\).*/\1/p' CHANGELOG.md 2>/dev/null | head -1)
|
|
||||||
if [ -n "$CL_VER" ] && [ "$CL_VER" != "$VERSION" ]; then
|
|
||||||
echo "- CHANGELOG drift: \`${CL_VER}\` != \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check composer.json version if present
|
|
||||||
if [ -f "composer.json" ]; then
|
|
||||||
COMP_VER=$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' composer.json 2>/dev/null | head -1)
|
|
||||||
if [ -n "$COMP_VER" ] && [ "$COMP_VER" != "$VERSION" ]; then
|
|
||||||
echo "- composer.json drift: \`${COMP_VER}\` != \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Common checks
|
|
||||||
if [ ! -f "LICENSE" ]; then
|
|
||||||
echo "- Missing LICENSE file" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
else
|
|
||||||
echo "- LICENSE present" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "src" ] && [ ! -d "htdocs" ]; then
|
|
||||||
echo "- Warning: No src/ or htdocs/ directory" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "- Source directory present" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- Platform-specific checks --------
|
|
||||||
case "$PLATFORM" in
|
|
||||||
joomla)
|
|
||||||
if [ -n "$MANIFEST" ]; then
|
|
||||||
XML_VER=$(sed -n 's/.*<version>\([^<]*\)<\/version>.*/\1/p' "$MANIFEST" 2>/dev/null | head -1)
|
|
||||||
if [ -n "$XML_VER" ] && [ "$XML_VER" != "$VERSION" ]; then
|
|
||||||
echo "- Manifest drift: \`${XML_VER}\` != \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
else
|
|
||||||
echo "- Manifest version: \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
TYPE=$(sed -n 's/.*<extension[^>]*type="\([^"]*\)".*/\1/p' "$MANIFEST" 2>/dev/null)
|
|
||||||
echo "- Extension type: ${TYPE:-unknown}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "- No Joomla XML manifest (WaaS site)" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi ;;
|
|
||||||
dolibarr)
|
|
||||||
if [ -n "$MOD_FILE" ]; then
|
|
||||||
MOD_VER=$(sed -n "s/.*\\\$this->version = '\([^']*\)'.*/\1/p" "$MOD_FILE" 2>/dev/null | head -1)
|
|
||||||
if [ -n "$MOD_VER" ] && [ "$MOD_VER" != "$VERSION" ]; then
|
|
||||||
echo "- Module drift: \`${MOD_VER}\` != \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
else
|
|
||||||
echo "- Module version: \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "- No mod*.class.php found" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
fi
|
|
||||||
if [ ! -f "update.txt" ]; then
|
|
||||||
echo "- Missing update.txt" >> $GITHUB_STEP_SUMMARY
|
|
||||||
ERRORS=$((ERRORS+1))
|
|
||||||
fi ;;
|
|
||||||
*) echo "- Generic platform � no manifest checks" >> $GITHUB_STEP_SUMMARY ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
if [ "$ERRORS" -gt 0 ]; then
|
|
||||||
echo "**${ERRORS} error(s) — release may be incomplete**" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "**All sanity checks passed**" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- STEP 2: Create or update version/XX.YY archive branch ---------------
|
# -- STEP 2: Create or update version/XX.YY archive branch ---------------
|
||||||
# Always runs — every version change on main archives to version/XX.YY
|
# Always runs — every version change on main archives to version/XX.YY
|
||||||
@@ -263,17 +257,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
php /tmp/moko-platform-api/cli/badge_update.php --path . --version "${VERSION}" 2>/dev/null || true
|
php /tmp/moko-platform-api/cli/badge_update.php --path . --version "${VERSION}" 2>/dev/null || true
|
||||||
|
php /tmp/moko-platform-api/cli/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
- name: "Step 5: Write update stream"
|
# Step 5 (updates.xml) moved after Step 8 to include SHA-256 checksum
|
||||||
if: >-
|
|
||||||
steps.version.outputs.skip != 'true' &&
|
|
||||||
steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
|
||||||
php /tmp/moko-platform-api/cli/updates_xml_build.php \
|
|
||||||
--path . --version "${VERSION}" --stability stable \
|
|
||||||
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
|
||||||
--github-output
|
|
||||||
|
|
||||||
- name: Commit release changes
|
- name: Commit release changes
|
||||||
if: >-
|
if: >-
|
||||||
@@ -297,9 +283,7 @@ jobs:
|
|||||||
# -- STEP 6: Create tag ---------------------------------------------------
|
# -- STEP 6: Create tag ---------------------------------------------------
|
||||||
- name: "Step 6: Create git tag"
|
- name: "Step 6: Create git tag"
|
||||||
if: >-
|
if: >-
|
||||||
steps.version.outputs.skip != 'true' &&
|
steps.version.outputs.skip != 'true'
|
||||||
steps.check.outputs.tag_exists != 'true' &&
|
|
||||||
steps.version.outputs.is_minor == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
# Only create the major release tag if it doesn't exist yet
|
# Only create the major release tag if it doesn't exist yet
|
||||||
@@ -312,371 +296,116 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "Tag: ${TAG}" >> $GITHUB_STEP_SUMMARY
|
echo "Tag: ${TAG}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# -- STEP 7: Create or update Gitea Release --------------------------------
|
# -- STEP 7a: Promote RC to stable (skip build) ----------------------------
|
||||||
- name: "Step 7: Gitea Release"
|
- name: "Step 7a: Promote RC to stable"
|
||||||
if: >-
|
if: >-
|
||||||
steps.version.outputs.skip != 'true'
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote == 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_promote.php \
|
||||||
|
--from release-candidate --to stable \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}" \
|
||||||
|
--path . --branch main
|
||||||
|
echo "Promoted RC → stable (${VERSION})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# -- STEP 7b: Create or update Gitea Release (full build path) -------------
|
||||||
|
- name: "Step 7b: Gitea Release"
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
BRANCH="${{ steps.version.outputs.branch }}"
|
|
||||||
MAJOR="${{ steps.version.outputs.major }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_create.php \
|
||||||
|
--path . --version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --branch main
|
||||||
|
echo "Release created: ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# Reuse metadata from Step 5 (single source of truth)
|
# -- STEP 8: Build packages and upload to release ----------------------------
|
||||||
EXT_ELEMENT="${{ steps.updates.outputs.ext_element }}"
|
- name: "Step 8: Build package and upload"
|
||||||
EXT_NAME="${{ steps.updates.outputs.ext_name }}"
|
id: package
|
||||||
EXT_TYPE="${{ steps.updates.outputs.ext_type }}"
|
|
||||||
EXT_FOLDER="${{ steps.updates.outputs.ext_folder }}"
|
|
||||||
|
|
||||||
# Fallbacks if Step 5 was skipped
|
|
||||||
if [ -z "$EXT_ELEMENT" ]; then
|
|
||||||
EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
|
|
||||||
fi
|
|
||||||
[ -z "$EXT_NAME" ] && EXT_NAME="${GITEA_REPO}"
|
|
||||||
|
|
||||||
NOTES=$(php /tmp/moko-platform-api/cli/release_notes.php --path . --version "$VERSION" 2>/dev/null)
|
|
||||||
[ -z "$NOTES" ] && NOTES="Release ${VERSION}"
|
|
||||||
|
|
||||||
# Build release name: "Pretty Name VERSION (type_element-VERSION)"
|
|
||||||
# Strip existing type prefix to prevent duplication
|
|
||||||
EXT_ELEMENT=$(echo "$EXT_ELEMENT" | sed -E 's/^(pkg_|com_|mod_|plg_[a-z]+_|tpl_|lib_)//')
|
|
||||||
TYPE_PREFIX=""
|
|
||||||
case "${EXT_TYPE}" in
|
|
||||||
plugin) TYPE_PREFIX="plg_${EXT_FOLDER}_" ;;
|
|
||||||
module) TYPE_PREFIX="mod_" ;;
|
|
||||||
component) TYPE_PREFIX="com_" ;;
|
|
||||||
template) TYPE_PREFIX="tpl_" ;;
|
|
||||||
library) TYPE_PREFIX="lib_" ;;
|
|
||||||
package) TYPE_PREFIX="pkg_" ;;
|
|
||||||
esac
|
|
||||||
RELEASE_NAME="${EXT_NAME} ${VERSION} (${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION})"
|
|
||||||
|
|
||||||
# Delete existing release if present (overwrite, not append)
|
|
||||||
EXISTING=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/tags/${RELEASE_TAG}" 2>/dev/null || true)
|
|
||||||
EXISTING_ID=$(echo "$EXISTING" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('id',''))" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/${EXISTING_ID}" 2>/dev/null || true
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/tags/${RELEASE_TAG}" 2>/dev/null || true
|
|
||||||
echo "Deleted previous stable release (id: ${EXISTING_ID})"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create fresh release
|
|
||||||
curl -sf -X POST -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/releases" \
|
|
||||||
-d "$(python3 -c "import json; print(json.dumps({
|
|
||||||
'tag_name': '${RELEASE_TAG}',
|
|
||||||
'name': '${RELEASE_NAME}',
|
|
||||||
'body': '''## ${VERSION} ($(date +%Y-%m-%d))\n${NOTES}''',
|
|
||||||
'target_commitish': '${BRANCH}'
|
|
||||||
}))")"
|
|
||||||
echo "Release created: ${RELEASE_NAME}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# -- STEP 8: Build Joomla install ZIP + SHA-256 checksum ------------------
|
|
||||||
- name: "Step 8: Build package and update checksum"
|
|
||||||
if: >-
|
if: >-
|
||||||
steps.version.outputs.skip != 'true'
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
REPO="${{ github.repository }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_package.php \
|
||||||
|
--path . --version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --output /tmp || true
|
||||||
|
|
||||||
# All ZIPs upload to the major release tag (vXX)
|
# -- STEP 5: Write update stream (after build so SHA-256 is available) -----
|
||||||
RELEASE_JSON=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
- name: "Step 5: Write update stream"
|
||||||
"${API_BASE}/releases/tags/${RELEASE_TAG}" 2>/dev/null || true)
|
|
||||||
RELEASE_ID=$(echo "$RELEASE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
|
||||||
if [ -z "$RELEASE_ID" ]; then
|
|
||||||
echo "No release ${RELEASE_TAG} found — skipping ZIP upload"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find extension element name from manifest
|
|
||||||
MANIFEST=$(find . -maxdepth 2 -name "*.xml" -exec grep -l '<extension' {} \; 2>/dev/null | head -1 || true)
|
|
||||||
[ -z "$MANIFEST" ] && exit 0
|
|
||||||
|
|
||||||
# Reuse element from Step 5, with same fallback chain
|
|
||||||
EXT_ELEMENT="${{ steps.updates.outputs.ext_element }}"
|
|
||||||
if [ -z "$EXT_ELEMENT" ]; then
|
|
||||||
EXT_ELEMENT=$(sed -n 's/.*<element>\([^<]*\)<\/element>.*/\1/p' "$MANIFEST" 2>/dev/null | head -1)
|
|
||||||
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(sed -n 's/.*plugin="\([^"]*\)".*/\1/p' "$MANIFEST" 2>/dev/null | head -1)
|
|
||||||
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(basename "$MANIFEST" .xml | tr '[:upper:]' '[:lower:]')
|
|
||||||
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
|
|
||||||
fi
|
|
||||||
# ZIP name: type_folder_element-VERSION (e.g. plg_system_mokojgdpc-01.01.00.zip)
|
|
||||||
EXT_TYPE=$(sed -n 's/.*<extension[^>]*type="\([^"]*\)".*/\1/p' "$MANIFEST" | head -1)
|
|
||||||
EXT_FOLDER=$(sed -n 's/.*<extension[^>]*group="\([^"]*\)".*/\1/p' "$MANIFEST" | head -1)
|
|
||||||
# For packages, prefer <packagename> over filename-derived element
|
|
||||||
if [ "$EXT_TYPE" = "package" ]; then
|
|
||||||
PKG_NAME=$(sed -n 's/.*<packagename>\([^<]*\)<\/packagename>.*/\1/p' "$MANIFEST" 2>/dev/null | head -1)
|
|
||||||
[ -n "$PKG_NAME" ] && EXT_ELEMENT="$PKG_NAME"
|
|
||||||
fi
|
|
||||||
# Strip existing type prefix to prevent duplication (e.g. pkg_mokowaas → mokowaas)
|
|
||||||
EXT_ELEMENT=$(echo "$EXT_ELEMENT" | sed -E 's/^(pkg_|com_|mod_|plg_[a-z]+_|tpl_|lib_)//')
|
|
||||||
TYPE_PREFIX=""
|
|
||||||
case "${EXT_TYPE}" in
|
|
||||||
plugin) TYPE_PREFIX="plg_${EXT_FOLDER}_" ;;
|
|
||||||
module) TYPE_PREFIX="mod_" ;;
|
|
||||||
component) TYPE_PREFIX="com_" ;;
|
|
||||||
template) TYPE_PREFIX="tpl_" ;;
|
|
||||||
library) TYPE_PREFIX="lib_" ;;
|
|
||||||
package) TYPE_PREFIX="pkg_" ;;
|
|
||||||
esac
|
|
||||||
ZIP_NAME="${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION}.zip"
|
|
||||||
TAR_NAME="${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION}.tar.gz"
|
|
||||||
|
|
||||||
# -- Build install packages from src/ ----------------------------
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && { echo "No src/ or htdocs/"; exit 0; }
|
|
||||||
|
|
||||||
# ZIP package (type-aware via moko-platform PHP API)
|
|
||||||
php /tmp/moko-platform-api/cli/joomla_build.php --path . --version "${VERSION}" --output /tmp
|
|
||||||
# Match the expected ZIP_NAME for upload
|
|
||||||
BUILT_ZIP=$(ls /tmp/${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION}.zip 2>/dev/null | head -1 || true)
|
|
||||||
if [ -n "$BUILT_ZIP" ] && [ "$BUILT_ZIP" != "/tmp/${ZIP_NAME}" ]; then
|
|
||||||
mv "$BUILT_ZIP" "/tmp/${ZIP_NAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# tar.gz package (flat source archive)
|
|
||||||
tar -czf "/tmp/${TAR_NAME}" -C "$SOURCE_DIR" --exclude='.ftpignore' --exclude='sftp-config*' --exclude='*.ppk' --exclude='*.pem' --exclude='*.key' --exclude='.env*' .
|
|
||||||
|
|
||||||
ZIP_SIZE=$(stat -c%s "/tmp/${ZIP_NAME}" 2>/dev/null || stat -f%z "/tmp/${ZIP_NAME}" 2>/dev/null || echo "unknown")
|
|
||||||
TAR_SIZE=$(stat -c%s "/tmp/${TAR_NAME}" 2>/dev/null || stat -f%z "/tmp/${TAR_NAME}" 2>/dev/null || echo "unknown")
|
|
||||||
|
|
||||||
# -- Calculate SHA-256 for both ----------------------------------
|
|
||||||
SHA256_ZIP=$(sha256sum "/tmp/${ZIP_NAME}" | cut -d' ' -f1)
|
|
||||||
SHA256_TAR=$(sha256sum "/tmp/${TAR_NAME}" | cut -d' ' -f1)
|
|
||||||
|
|
||||||
# -- Delete existing assets with same name before uploading ------
|
|
||||||
ASSETS=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/${RELEASE_ID}/assets" 2>/dev/null || echo "[]")
|
|
||||||
for ASSET_NAME in "$ZIP_NAME" "$TAR_NAME"; do
|
|
||||||
ASSET_ID=$(echo "$ASSETS" | python3 -c "
|
|
||||||
import sys,json
|
|
||||||
assets = json.load(sys.stdin)
|
|
||||||
for a in assets:
|
|
||||||
if a['name'] == '${ASSET_NAME}':
|
|
||||||
print(a['id']); break
|
|
||||||
" 2>/dev/null || true)
|
|
||||||
if [ -n "$ASSET_ID" ]; then
|
|
||||||
curl -sf -X DELETE -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/${RELEASE_ID}/assets/${ASSET_ID}" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# -- Upload both to release tag ----------------------------------
|
|
||||||
curl -sf -X POST -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/octet-stream" \
|
|
||||||
--data-binary @"/tmp/${ZIP_NAME}" \
|
|
||||||
"${API_BASE}/releases/${RELEASE_ID}/assets?name=${ZIP_NAME}" > /dev/null 2>&1 || true
|
|
||||||
|
|
||||||
curl -sf -X POST -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/octet-stream" \
|
|
||||||
--data-binary @"/tmp/${TAR_NAME}" \
|
|
||||||
"${API_BASE}/releases/${RELEASE_ID}/assets?name=${TAR_NAME}" > /dev/null 2>&1 || true
|
|
||||||
|
|
||||||
# -- Update updates.xml with both download formats ---------------
|
|
||||||
if [ -f "updates.xml" ]; then
|
|
||||||
ZIP_URL="${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/download/${RELEASE_TAG}/${ZIP_NAME}"
|
|
||||||
TAR_URL="${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/download/${RELEASE_TAG}/${TAR_NAME}"
|
|
||||||
|
|
||||||
# Use Python to update only the stable entry's downloads + sha256
|
|
||||||
export PY_ZIP_URL="$ZIP_URL" PY_TAR_URL="$TAR_URL" PY_SHA="$SHA256_ZIP"
|
|
||||||
python3 << 'PYEOF'
|
|
||||||
import re, os
|
|
||||||
|
|
||||||
with open("updates.xml") as f:
|
|
||||||
content = f.read()
|
|
||||||
|
|
||||||
zip_url = os.environ["PY_ZIP_URL"]
|
|
||||||
tar_url = os.environ["PY_TAR_URL"]
|
|
||||||
sha = os.environ["PY_SHA"]
|
|
||||||
|
|
||||||
# Find the stable update block and replace its downloads + sha256
|
|
||||||
def replace_stable(m):
|
|
||||||
block = m.group(0)
|
|
||||||
# Replace downloads block
|
|
||||||
new_downloads = (
|
|
||||||
" <downloads>\n"
|
|
||||||
f" <downloadurl type=\"full\" format=\"zip\">{zip_url}</downloadurl>\n"
|
|
||||||
" </downloads>"
|
|
||||||
)
|
|
||||||
block = re.sub(r' <downloads>.*?</downloads>', new_downloads, block, flags=re.DOTALL)
|
|
||||||
# Add or replace sha256
|
|
||||||
if '<sha256>' in block:
|
|
||||||
block = re.sub(r' <sha256>.*?</sha256>', f' <sha256>{sha}</sha256>', block)
|
|
||||||
else:
|
|
||||||
block = block.replace('</downloads>', f'</downloads>\n <sha256>{sha}</sha256>')
|
|
||||||
return block
|
|
||||||
|
|
||||||
content = re.sub(
|
|
||||||
r' <update>.*?<tag>stable</tag>.*?</update>',
|
|
||||||
replace_stable,
|
|
||||||
content,
|
|
||||||
flags=re.DOTALL
|
|
||||||
)
|
|
||||||
|
|
||||||
with open("updates.xml", "w") as f:
|
|
||||||
f.write(content)
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
CURRENT_BRANCH="${{ github.ref_name }}"
|
|
||||||
git add updates.xml
|
|
||||||
git commit -m "chore(release): ZIP + tar.gz for ${VERSION} [skip ci]" \
|
|
||||||
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>" || true
|
|
||||||
git push || true
|
|
||||||
|
|
||||||
# Sync updates.xml to main via direct API (always runs — may be on version/XX branch)
|
|
||||||
GA_TOKEN="${{ secrets.GA_TOKEN }}"
|
|
||||||
API="${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}"
|
|
||||||
|
|
||||||
FILE_SHA=$(curl -sf -H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
"${API}/contents/updates.xml?ref=main" | jq -r '.sha // empty')
|
|
||||||
|
|
||||||
if [ -n "$FILE_SHA" ]; then
|
|
||||||
CONTENT=$(base64 -w0 updates.xml)
|
|
||||||
curl -sf -X PUT -H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/contents/updates.xml" \
|
|
||||||
-d "$(jq -n \
|
|
||||||
--arg content "$CONTENT" \
|
|
||||||
--arg sha "$FILE_SHA" \
|
|
||||||
--arg msg "chore: sync updates.xml ${VERSION} [skip ci]" \
|
|
||||||
--arg branch "main" \
|
|
||||||
'{content: $content, sha: $sha, message: $msg, branch: $branch}'
|
|
||||||
)" > /dev/null 2>&1 \
|
|
||||||
&& echo "updates.xml synced to main via API" \
|
|
||||||
|| echo "WARNING: failed to sync updates.xml to main"
|
|
||||||
else
|
|
||||||
echo "WARNING: could not get updates.xml SHA from main"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "### Packages" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Package | Size | SHA-256 |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "|---------|------|---------|" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| \`${ZIP_NAME}\` | ${ZIP_SIZE} | \`${SHA256_ZIP}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| \`${TAR_NAME}\` | ${TAR_SIZE} | \`${SHA256_TAR}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Release | \`${RELEASE_TAG}\` | |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Download | [${ZIP_NAME}](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/download/${RELEASE_TAG}/${ZIP_NAME}) |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# -- STEP 8b: Update release description with changelog + SHA ----------------
|
|
||||||
- name: "Step 8b: Update release body with changelog and SHA"
|
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
|
|
||||||
|
# Fetch latest updates.xml from main so preserve logic has all channels
|
||||||
|
GA_TOKEN="${{ secrets.GA_TOKEN }}"
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
|
curl -sf -H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
"${API}/contents/updates.xml?ref=main" 2>/dev/null | \
|
||||||
|
python3 -c "import sys,json,base64; print(base64.b64decode(json.load(sys.stdin)['content']).decode())" \
|
||||||
|
> updates.xml 2>/dev/null || true
|
||||||
|
|
||||||
|
SHA_FLAG=""
|
||||||
|
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
||||||
|
|
||||||
|
php /tmp/moko-platform-api/cli/updates_xml_build.php \
|
||||||
|
--path . --version "${VERSION}" --stability stable \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
${SHA_FLAG} --github-output
|
||||||
|
|
||||||
|
# Commit updates.xml if changed
|
||||||
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
|
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 updates.xml
|
||||||
|
git commit -m "chore: update stable channel ${VERSION} [skip ci]" \
|
||||||
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
|
git push origin HEAD 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -- STEP 8b: Update release description with changelog ----------------------
|
||||||
|
- name: "Step 8b: Update release body"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
php /tmp/moko-platform-api/cli/release_body_update.php \
|
||||||
EXT_ELEMENT="${{ steps.updates.outputs.ext_element }}"
|
--path . --version "${VERSION}" --tag "${RELEASE_TAG}" \
|
||||||
EXT_TYPE="${{ steps.updates.outputs.ext_type }}"
|
--token "${{ secrets.GA_TOKEN }}" \
|
||||||
EXT_FOLDER="${{ steps.updates.outputs.ext_folder }}"
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
2>&1 || true
|
||||||
# Build TYPE_PREFIX to match Step 8's ZIP naming
|
echo "Release body updated" >> $GITHUB_STEP_SUMMARY
|
||||||
EXT_ELEMENT=$(echo "$EXT_ELEMENT" | sed -E 's/^(pkg_|com_|mod_|plg_[a-z]+_|tpl_|lib_)//')
|
|
||||||
TYPE_PREFIX=""
|
|
||||||
case "${EXT_TYPE}" in
|
|
||||||
plugin) TYPE_PREFIX="plg_${EXT_FOLDER}_" ;;
|
|
||||||
module) TYPE_PREFIX="mod_" ;;
|
|
||||||
component) TYPE_PREFIX="com_" ;;
|
|
||||||
template) TYPE_PREFIX="tpl_" ;;
|
|
||||||
library) TYPE_PREFIX="lib_" ;;
|
|
||||||
package) TYPE_PREFIX="pkg_" ;;
|
|
||||||
esac
|
|
||||||
ZIP_NAME="${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION}.zip"
|
|
||||||
TAR_NAME="${TYPE_PREFIX}${EXT_ELEMENT}-${VERSION}.tar.gz"
|
|
||||||
|
|
||||||
# Get SHA from the built files
|
|
||||||
SHA256_ZIP=""
|
|
||||||
[ -f "/tmp/${ZIP_NAME}" ] && SHA256_ZIP=$(sha256sum "/tmp/${ZIP_NAME}" | cut -d' ' -f1)
|
|
||||||
SHA256_TAR=""
|
|
||||||
[ -f "/tmp/${TAR_NAME}" ] && SHA256_TAR=$(sha256sum "/tmp/${TAR_NAME}" | cut -d' ' -f1)
|
|
||||||
|
|
||||||
# Extract latest changelog entry (strip the ## header to avoid duplicate)
|
|
||||||
CHANGELOG=""
|
|
||||||
if [ -f "CHANGELOG.md" ]; then
|
|
||||||
CHANGELOG=$(sed -n "/^## \[*${VERSION}/,/^## \[*[0-9]/p" CHANGELOG.md | sed '$d' | sed '1d')
|
|
||||||
[ -z "$CHANGELOG" ] && CHANGELOG=$(sed -n '/^## /,/^## /p' CHANGELOG.md | sed '$d' | sed '1d' | head -30)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build release body (single header, no duplicate from changelog)
|
|
||||||
BODY="## ${VERSION} ($(date +%Y-%m-%d))\n\n"
|
|
||||||
if [ -n "$CHANGELOG" ]; then
|
|
||||||
BODY="${BODY}${CHANGELOG}\n\n"
|
|
||||||
fi
|
|
||||||
BODY="${BODY}---\n\n### Checksums\n\n"
|
|
||||||
BODY="${BODY}| File | SHA-256 |\n|------|--------|\n"
|
|
||||||
[ -n "$SHA256_ZIP" ] && BODY="${BODY}| \`${ZIP_NAME}\` | \`${SHA256_ZIP}\` |\n"
|
|
||||||
[ -n "$SHA256_TAR" ] && BODY="${BODY}| \`${TAR_NAME}\` | \`${SHA256_TAR}\` |\n"
|
|
||||||
|
|
||||||
# Get release ID and update body
|
|
||||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/tags/${RELEASE_TAG}" 2>/dev/null | \
|
|
||||||
python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ] && [ "$RELEASE_ID" != "None" ]; then
|
|
||||||
python3 -c "
|
|
||||||
import json, urllib.request
|
|
||||||
body = '''$(printf '%b' "$BODY")'''
|
|
||||||
data = json.dumps({'body': body}).encode()
|
|
||||||
req = urllib.request.Request(
|
|
||||||
'${API_BASE}/releases/${RELEASE_ID}',
|
|
||||||
data=data,
|
|
||||||
headers={'Authorization': 'token ${{ secrets.GA_TOKEN }}', 'Content-Type': 'application/json'},
|
|
||||||
method='PATCH'
|
|
||||||
)
|
|
||||||
urllib.request.urlopen(req)
|
|
||||||
" 2>/dev/null && echo "Release body updated with changelog + SHA" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
||||||
- name: "Step 9: Mirror release to GitHub"
|
- name: "Step 9: Mirror release to GitHub"
|
||||||
if: >-
|
if: >-
|
||||||
steps.version.outputs.skip != 'true' &&
|
steps.version.outputs.skip != 'true' &&
|
||||||
steps.version.outputs.stability == 'stable' &&
|
|
||||||
secrets.GH_TOKEN != ''
|
secrets.GH_TOKEN != ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
MAJOR="${{ steps.version.outputs.major }}"
|
|
||||||
BRANCH="${{ steps.version.outputs.branch }}"
|
|
||||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
NOTES=$(php /tmp/moko-platform-api/cli/release_notes.php --path . --version "$VERSION" 2>/dev/null || true)
|
php /tmp/moko-platform-api/cli/release_mirror.php \
|
||||||
[ -z "$NOTES" ] && NOTES="Release ${VERSION}"
|
--version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
echo "$NOTES" > /tmp/release_notes.md
|
--token "${{ secrets.GA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--gh-token "${{ secrets.GH_TOKEN }}" --gh-repo "$GH_REPO" \
|
||||||
EXISTING=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}/releases/tags/$RELEASE_TAG" 2>/dev/null | jq -r ".tag_name // empty" || true)
|
--branch main 2>&1 || true
|
||||||
|
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
||||||
if [ -z "$EXISTING" ]; then
|
|
||||||
gh release create "$RELEASE_TAG" \
|
|
||||||
--repo "$GH_REPO" \
|
|
||||||
--title "v${MAJOR} (latest: ${VERSION})" \
|
|
||||||
--notes-file /tmp/release_notes.md \
|
|
||||||
--target "$BRANCH" || true
|
|
||||||
else
|
|
||||||
gh release edit "$RELEASE_TAG" \
|
|
||||||
--repo "$GH_REPO" \
|
|
||||||
--title "v${MAJOR} (latest: ${VERSION})" || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Upload assets to GitHub mirror
|
|
||||||
for PKG in /tmp/${EXT_ELEMENT:-pkg}-${VERSION}.*; do
|
|
||||||
if [ -f "$PKG" ]; then
|
|
||||||
_RELID=$(curl -sf -H "Authorization: token ${{ secrets.GA_TOKEN }}" "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}/releases/tags/$RELEASE_TAG" 2>/dev/null | jq -r ".id // empty")
|
|
||||||
[ -n "$_RELID" ] && curl -sf -X POST -H "Authorization: token ${{ secrets.GA_TOKEN }}" -H "Content-Type: application/octet-stream" "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${{ github.repository }}/releases/${_RELID}/assets?name=$(basename $PKG)" --data-binary "@$PKG" > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo "GitHub mirror updated: ${GH_REPO} ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
||||||
- name: "Step 10: Push main to GitHub mirror"
|
- name: "Step 10: Push main to GitHub mirror"
|
||||||
@@ -700,11 +429,13 @@ jobs:
|
|||||||
- name: "Delete lesser pre-release channels"
|
- name: "Delete lesser pre-release channels"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
php /tmp/moko-platform-api/cli/release_cascade.php \
|
php /tmp/moko-platform-api/cli/release_cascade.php \
|
||||||
--stability stable \
|
--stability stable \
|
||||||
|
--version "${VERSION}" \
|
||||||
--token "${{ secrets.GA_TOKEN }}" \
|
--token "${{ secrets.GA_TOKEN }}" \
|
||||||
--org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
--api-base "${API_BASE}" 2>/dev/null || true
|
||||||
--gitea-url "${GITEA_URL}" 2>/dev/null || true
|
|
||||||
|
|
||||||
- name: "Step 11: Delete and recreate dev branch from main"
|
- name: "Step 11: Delete and recreate dev branch from main"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
@@ -727,26 +458,14 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# -- Dolibarr post-release: Reset dev version -----------------------------
|
# -- Dolibarr post-release: Reset dev version -----------------------------
|
||||||
- name: "Dolibarr: Reset dev version"
|
- name: "Post-release: Reset dev version"
|
||||||
if: >-
|
if: steps.version.outputs.skip != 'true'
|
||||||
steps.version.outputs.skip != 'true' &&
|
|
||||||
steps.platform.outputs.platform == 'dolibarr' &&
|
|
||||||
steps.platform.outputs.mod_file != ''
|
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.GA_TOKEN }}"
|
php /tmp/moko-platform-api/cli/version_reset_dev.php \
|
||||||
MOD_FILE="${{ steps.platform.outputs.mod_file }}"
|
--token "${{ secrets.GA_TOKEN }}" --api-base "${API_BASE}" \
|
||||||
ENCODED_PATH=$(echo "$MOD_FILE" | sed 's|^\./||' | python3 -c "import sys,urllib.parse; print(urllib.parse.quote(sys.stdin.read().strip()))")
|
--branch dev --path . 2>&1 || true
|
||||||
FILE_RESP=$(curl -sf -H "Authorization: token ${TOKEN}" "${API_BASE}/contents/${ENCODED_PATH}?ref=dev" 2>/dev/null || true)
|
|
||||||
FILE_SHA=$(echo "$FILE_RESP" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
|
||||||
FILE_CONTENT=$(echo "$FILE_RESP" | python3 -c "import sys,json,base64; print(base64.b64decode(json.load(sys.stdin).get('content','')).decode())" 2>/dev/null || true)
|
|
||||||
if [ -n "$FILE_SHA" ] && [ -n "$FILE_CONTENT" ]; then
|
|
||||||
UPDATED=$(echo "$FILE_CONTENT" | sed "s/\$this->version = '[^']*'/\$this->version = 'development'/")
|
|
||||||
ENCODED=$(echo "$UPDATED" | base64 -w0)
|
|
||||||
curl -sf -X PUT -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/contents/${ENCODED_PATH}" \
|
|
||||||
-d "$(jq -n --arg content \"$ENCODED\" --arg sha \"$FILE_SHA\" --arg msg \"chore(version): reset dev version [skip ci]\" --arg branch \"dev\" '{content:$content,sha:$sha,message:$msg,branch:$branch}')" > /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- Summary --------------------------------------------------------------
|
# -- Summary --------------------------------------------------------------
|
||||||
- name: Pipeline Summary
|
- name: Pipeline Summary
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: moko-platform.Automation
|
||||||
|
# VERSION: 01.00.00
|
||||||
|
# BRIEF: Auto-create feature branch when an issue is opened
|
||||||
|
|
||||||
|
name: "Universal: Issue Branch"
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-branch:
|
||||||
|
name: Create feature branch
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create branch and comment
|
||||||
|
run: |
|
||||||
|
TOKEN="${{ secrets.GA_TOKEN }}"
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
|
ISSUE_NUM="${{ github.event.issue.number }}"
|
||||||
|
ISSUE_TITLE="${{ github.event.issue.title }}"
|
||||||
|
|
||||||
|
# Build slug from title: lowercase, replace non-alnum with dash, trim
|
||||||
|
SLUG=$(echo "${ISSUE_TITLE}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | cut -c1-40)
|
||||||
|
BRANCH="feature/${ISSUE_NUM}-${SLUG}"
|
||||||
|
|
||||||
|
# Check dev branch exists
|
||||||
|
DEV_EXISTS=$(curl -sf -o /dev/null -w '%{http_code}' \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API}/branches/dev" 2>/dev/null || echo "000")
|
||||||
|
|
||||||
|
if [ "${DEV_EXISTS}" != "200" ]; then
|
||||||
|
echo "No dev branch -- skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create branch from dev
|
||||||
|
HTTP=$(curl -sf -o /dev/null -w '%{http_code}' -X POST \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/branches" \
|
||||||
|
-d "{\"new_branch_name\":\"${BRANCH}\",\"old_branch_name\":\"dev\"}" 2>/dev/null || echo "000")
|
||||||
|
|
||||||
|
if [ "${HTTP}" = "201" ]; then
|
||||||
|
echo "Created branch: ${BRANCH}"
|
||||||
|
|
||||||
|
# Comment on issue with branch link
|
||||||
|
REPO_URL="${GITEA_URL}/${{ github.repository }}"
|
||||||
|
BODY="Branch created: [\`${BRANCH}\`](${REPO_URL}/src/branch/${BRANCH})\n\n\`\`\`bash\ngit fetch origin\ngit checkout ${BRANCH}\n\`\`\`"
|
||||||
|
|
||||||
|
curl -sf -X POST \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/issues/${ISSUE_NUM}/comments" \
|
||||||
|
-d "{\"body\":\"${BODY}\"}" > /dev/null 2>&1
|
||||||
|
|
||||||
|
echo "Commented on issue #${ISSUE_NUM}"
|
||||||
|
else
|
||||||
|
echo "Failed to create branch (HTTP ${HTTP}) -- may already exist"
|
||||||
|
fi
|
||||||
@@ -7,12 +7,16 @@
|
|||||||
# INGROUP: moko-platform.Release
|
# INGROUP: moko-platform.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
# PATH: /templates/workflows/universal/pre-release.yml.template
|
||||||
# VERSION: 05.00.00
|
# VERSION: 05.01.00
|
||||||
# BRIEF: Manual pre-release — builds dev/alpha/beta/rc packages from any branch
|
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
|
||||||
|
|
||||||
name: "Universal: Pre-Release"
|
name: "Universal: Pre-Release"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
stability:
|
stability:
|
||||||
@@ -35,8 +39,11 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: "Build Pre-Release (${{ inputs.stability }})"
|
name: "Build Pre-Release (${{ inputs.stability || 'development' }})"
|
||||||
runs-on: release
|
runs-on: release
|
||||||
|
if: >-
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -45,30 +52,29 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GA_TOKEN }}
|
token: ${{ secrets.GA_TOKEN }}
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
run: |
|
|
||||||
if ! command -v php &> /dev/null; then
|
|
||||||
sudo apt-get update -qq
|
|
||||||
sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
- name: Setup moko-platform tools
|
||||||
env:
|
env:
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }}
|
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 --branch main --quiet "https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" /tmp/moko-platform-api
|
if ! command -v composer &> /dev/null; then
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
|
/tmp/moko-platform-api
|
||||||
|
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||||
|
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Detect platform
|
- name: Detect platform
|
||||||
id: platform
|
id: platform
|
||||||
run: |
|
run: |
|
||||||
php /tmp/moko-platform-api/cli/manifest_read.php --path . --github-output
|
php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
||||||
|
|
||||||
- name: Resolve metadata
|
- name: Resolve metadata and bump version
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
STABILITY="${{ inputs.stability }}"
|
STABILITY="${{ inputs.stability || 'development' }}"
|
||||||
MOKO_API="/tmp/moko-platform-api/cli"
|
|
||||||
|
|
||||||
case "$STABILITY" in
|
case "$STABILITY" in
|
||||||
development) SUFFIX="-dev"; TAG="development" ;;
|
development) SUFFIX="-dev"; TAG="development" ;;
|
||||||
@@ -77,34 +83,36 @@ jobs:
|
|||||||
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
|
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Read current version from manifest (priority) or README — no bump yet
|
# Read current version (bump already handled by push workflow)
|
||||||
VERSION=$(php ${MOKO_API}/version_read.php --path .)
|
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null)
|
||||||
echo "Version: ${VERSION}"
|
[ -z "$VERSION" ] && VERSION="00.00.01"
|
||||||
|
|
||||||
# Ensure platform-specific manifest matches
|
php ${MOKO_CLI}/version_set_platform.php \
|
||||||
php ${MOKO_API}/version_set_platform.php --path . --version "${VERSION}"
|
--path . --version "$VERSION" --branch "${{ github.ref_name }}" 2>/dev/null || true
|
||||||
|
|
||||||
# Git setup for later commits
|
# Verify version consistency across all files
|
||||||
|
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
|
# Commit version bump
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
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 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): pre-release bump to ${VERSION} [skip ci]"
|
||||||
|
git push origin HEAD 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
# Detect element from Joomla/Dolibarr manifest
|
# Auto-detect element via manifest_element.php
|
||||||
set +o pipefail
|
php ${MOKO_CLI}/manifest_element.php \
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
--path . --version "$VERSION" --stability "$STABILITY" \
|
||||||
EXT_ELEMENT=$(php ${MOKO_API}/manifest_read.php --path . --field name 2>/dev/null | tr -d ' ' | tr '[:upper:]' '[:lower:]' || true)
|
--repo "${GITEA_REPO}" --github-output
|
||||||
# For Joomla, prefer <element> tag
|
|
||||||
if [ "$PLATFORM" = "joomla" ]; then
|
# Read back element outputs
|
||||||
MANIFEST=$(find . -maxdepth 4 -name "*.xml" ! -path "./.git/*" -print0 2>/dev/null | xargs -0 grep -l '<extension' 2>/dev/null | head -1 || true)
|
EXT_ELEMENT=$(grep '^ext_element=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
|
||||||
if [ -n "$MANIFEST" ]; then
|
ZIP_NAME=$(grep '^zip_name=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2)
|
||||||
ELEM=$(grep -oP "<element>\K[^<]+" "$MANIFEST" 2>/dev/null | head -1 || true)
|
|
||||||
[ -n "$ELEM" ] && EXT_ELEMENT="$ELEM"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
|
[ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -')
|
||||||
set -o pipefail
|
[ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}${SUFFIX}.zip"
|
||||||
|
|
||||||
ZIP_NAME="${EXT_ELEMENT}-${VERSION}${SUFFIX}.zip"
|
|
||||||
|
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
||||||
@@ -115,146 +123,101 @@ jobs:
|
|||||||
|
|
||||||
echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ==="
|
echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ==="
|
||||||
|
|
||||||
- name: Build package
|
- name: Create release
|
||||||
id: zip
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
SUFFIX="${{ steps.meta.outputs.suffix }}"
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
|
|
||||||
if [ "$PLATFORM" = "joomla" ]; then
|
|
||||||
php /tmp/moko-platform-api/cli/joomla_build.php --path . --version "${VERSION}" --suffix "${SUFFIX}" --output build --github-output
|
|
||||||
else
|
|
||||||
# Generic build: zip src/ directory
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && { echo "::error::No src/ or htdocs/"; exit 1; }
|
|
||||||
EXT_ELEMENT="${{ steps.meta.outputs.ext_element }}"
|
|
||||||
ZIP_NAME="${EXT_ELEMENT}-${VERSION}${SUFFIX}.zip"
|
|
||||||
mkdir -p build
|
|
||||||
cd "$SOURCE_DIR" && zip -r "../build/${ZIP_NAME}" . && cd ..
|
|
||||||
SHA256=$(sha256sum "build/${ZIP_NAME}" | cut -d' ' -f1)
|
|
||||||
echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "zip_path=build/${ZIP_NAME}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "sha256=${SHA256}" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create or replace Gitea release
|
|
||||||
id: release
|
id: release
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ steps.meta.outputs.tag }}"
|
TAG="${{ steps.meta.outputs.tag }}"
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
SHA256="${{ steps.zip.outputs.sha256 }}"
|
php ${MOKO_CLI}/release_create.php \
|
||||||
ZIP_NAME="${{ steps.zip.outputs.zip_name }}"
|
--path . --version "$VERSION" --tag "$TAG" \
|
||||||
EXT_ELEMENT="${{ steps.meta.outputs.ext_element }}"
|
--token "${{ secrets.GA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
TOKEN="${{ secrets.GA_TOKEN }}"
|
--repo "${GITEA_REPO}" --branch dev --prerelease
|
||||||
API="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
BRANCH=$(git branch --show-current)
|
|
||||||
|
|
||||||
BODY="## ${VERSION} ($(date +%Y-%m-%d))
|
- name: Build package and upload
|
||||||
**Channel:** ${STABILITY}
|
id: package
|
||||||
**SHA-256:** \`${SHA256}\`"
|
run: |
|
||||||
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
TAG="${{ steps.meta.outputs.tag }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php ${MOKO_CLI}/release_package.php \
|
||||||
|
--path . --version "$VERSION" --tag "$TAG" \
|
||||||
|
--token "${{ secrets.GA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --output /tmp || true
|
||||||
|
|
||||||
# Delete existing release
|
- name: Update updates.xml
|
||||||
EXISTING_ID=$(curl -sS -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API}/releases/tags/${TAG}" | jq -r '.id // empty' 2>/dev/null)
|
|
||||||
if [ -n "$EXISTING_ID" ]; then
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API}/releases/${EXISTING_ID}" 2>/dev/null || true
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API}/tags/${TAG}" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create release
|
|
||||||
RELEASE_ID=$(curl -sS -X POST -H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/releases" \
|
|
||||||
-d "$(jq -n \
|
|
||||||
--arg tag "$TAG" \
|
|
||||||
--arg target "$BRANCH" \
|
|
||||||
--arg name "${EXT_ELEMENT} ${VERSION} (${STABILITY})" \
|
|
||||||
--arg body "$BODY" \
|
|
||||||
'{tag_name: $tag, target_commitish: $target, name: $name, body: $body, prerelease: true}'
|
|
||||||
)" | jq -r '.id')
|
|
||||||
|
|
||||||
echo "release_id=${RELEASE_ID}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
# Upload ZIP
|
|
||||||
curl -sS -X POST -H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/octet-stream" \
|
|
||||||
"${API}/releases/${RELEASE_ID}/assets?name=${ZIP_NAME}" \
|
|
||||||
--data-binary "@${{ steps.zip.outputs.zip_path }}"
|
|
||||||
|
|
||||||
echo "Released: ${EXT_ELEMENT} ${VERSION} (${STABILITY})"
|
|
||||||
|
|
||||||
- name: "Update updates.xml"
|
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
if: steps.platform.outputs.platform == 'joomla'
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||||
SHA256="${{ steps.zip.outputs.sha256 }}"
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
php /tmp/moko-platform-api/cli/updates_xml_build.php --path . --version "$VERSION" --stability "$STABILITY" --sha "$SHA256" --gitea-url "$GITEA_URL" --org "$GITEA_ORG" --repo "$GITEA_REPO"
|
|
||||||
|
if [ ! -f "updates.xml" ]; then
|
||||||
|
echo "No updates.xml -- skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
SHA_FLAG=""
|
||||||
|
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
||||||
|
|
||||||
|
php ${MOKO_CLI}/updates_xml_build.php \
|
||||||
|
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
${SHA_FLAG}
|
||||||
|
|
||||||
|
# Commit and push
|
||||||
if ! git diff --quiet updates.xml 2>/dev/null; then
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
git config --local user.name "gitea-actions[bot]"
|
||||||
git add updates.xml
|
git add updates.xml
|
||||||
git commit -m "chore: update $STABILITY channel $VERSION [skip ci]"
|
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
||||||
git push origin HEAD 2>&1 || echo "WARNING: push failed"
|
git push origin HEAD 2>&1 || echo "WARNING: push failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: "Sync updates.xml to all branches"
|
- name: "Sync updates.xml to all branches"
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
if: steps.platform.outputs.platform == 'joomla'
|
||||||
run: |
|
run: |
|
||||||
php /tmp/moko-platform-api/cli/updates_xml_sync.php --path . --current "${{ github.ref_name }}" --branches main,dev --version "${{ steps.meta.outputs.version }}" --token "${{ secrets.GA_TOKEN }}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" --gitea-url "${GITEA_URL}"
|
CURRENT_BRANCH="${{ github.ref_name }}"
|
||||||
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
|
||||||
|
for BRANCH in main dev; do
|
||||||
|
[ "$BRANCH" = "$CURRENT_BRANCH" ] && continue
|
||||||
|
echo "Syncing updates.xml -> ${BRANCH}"
|
||||||
|
git fetch origin "${BRANCH}" 2>/dev/null || continue
|
||||||
|
git checkout "origin/${BRANCH}" -- updates.xml 2>/dev/null || continue
|
||||||
|
git checkout "${CURRENT_BRANCH}" -- updates.xml
|
||||||
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
|
git add updates.xml
|
||||||
|
git commit -m "chore: sync updates.xml from ${CURRENT_BRANCH} [skip ci]"
|
||||||
|
git push origin HEAD:refs/heads/${BRANCH} 2>&1 || echo "WARNING: push to ${BRANCH} failed"
|
||||||
|
fi
|
||||||
|
git checkout "${CURRENT_BRANCH}" 2>/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
- name: "Delete lesser pre-release channels (cascade)"
|
- name: "Delete lesser pre-release channels (cascade)"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.GA_TOKEN }}"
|
TOKEN="${{ secrets.GA_TOKEN }}"
|
||||||
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
||||||
|
|
||||||
# Cascade: rc → beta,alpha,dev | beta → alpha,dev | alpha → dev | dev → nothing
|
php ${MOKO_CLI}/release_cascade.php \
|
||||||
case "$STABILITY" in
|
--stability "${{ steps.meta.outputs.stability }}" \
|
||||||
release-candidate) TAGS_TO_DELETE="beta alpha development" ;;
|
--token "${TOKEN}" \
|
||||||
beta) TAGS_TO_DELETE="alpha development" ;;
|
--api-base "${API_BASE}"
|
||||||
alpha) TAGS_TO_DELETE="development" ;;
|
|
||||||
*) TAGS_TO_DELETE="" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -z "$TAGS_TO_DELETE" ] && exit 0
|
- name: Summary
|
||||||
|
if: always()
|
||||||
for TAG in $TAGS_TO_DELETE; do
|
|
||||||
RELEASE_ID=$(curl -sS -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/releases/tags/${TAG}" 2>/dev/null | \
|
|
||||||
python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ] && [ "$RELEASE_ID" != "None" ]; then
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/releases/${RELEASE_ID}" 2>/dev/null || true
|
|
||||||
curl -sS -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/tags/${TAG}" 2>/dev/null || true
|
|
||||||
echo "Deleted: ${TAG} (id: ${RELEASE_ID})"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: "Post-release version bump"
|
|
||||||
run: |
|
run: |
|
||||||
MOKO_API="/tmp/moko-platform-api/cli"
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||||
# Bump patch for next dev cycle
|
ZIP_NAME="${{ steps.meta.outputs.zip_name }}"
|
||||||
BUMP_OUTPUT=$(php ${MOKO_API}/version_bump.php --path .)
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
NEXT=$(echo "$BUMP_OUTPUT" | grep -oP '\d{2}\.\d{2}\.\d{2}$' || true)
|
echo "## Pre-Release Complete" >> $GITHUB_STEP_SUMMARY
|
||||||
[ -z "$NEXT" ] && exit 0
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
||||||
# Update platform-specific manifest to next version
|
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
||||||
php ${MOKO_API}/version_set_platform.php --path . --version "${NEXT}"
|
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Channel | ${STABILITY} |" >> $GITHUB_STEP_SUMMARY
|
||||||
git add -A
|
echo "| Package | \`${ZIP_NAME}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
git diff --cached --quiet || {
|
echo "| SHA-256 | \`${SHA256:-n/a}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
git commit -m "chore: update development channel ${VERSION} [skip ci]"
|
|
||||||
git push origin HEAD 2>&1
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: MokoStandards.Joomla
|
# INGROUP: MokoStandards.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards-API
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
# PATH: /templates/workflows/joomla/update-server.yml.template
|
# PATH: /templates/workflows/update-server.yml
|
||||||
# VERSION: 04.06.00
|
# VERSION: 04.07.00
|
||||||
# BRIEF: Update Joomla update server XML feed with stable/rc/dev entries
|
# BRIEF: Update server XML feed with stable/rc/beta/alpha/dev entries (universal)
|
||||||
#
|
#
|
||||||
# Writes updates.xml with multiple <update> entries:
|
# Writes updates.xml with multiple <update> entries:
|
||||||
# - <tag>stable</tag> on push to main (from auto-release)
|
# - <tag>stable</tag> on push to main (from auto-release)
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
# Joomla filters by user's "Minimum Stability" setting.
|
# Joomla filters by user's "Minimum Stability" setting.
|
||||||
|
|
||||||
name: "Joomla: Update Server"
|
name: "Update Server"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -73,12 +73,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GA_TOKEN }}
|
token: ${{ secrets.GA_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup MokoStandards tools
|
- name: Setup moko-platform tools
|
||||||
env:
|
env:
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }}
|
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
@@ -87,11 +87,15 @@ jobs:
|
|||||||
if ! command -v composer &> /dev/null; then
|
if ! command -v composer &> /dev/null; then
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
if [ -d "/tmp/moko-platform" ]; then
|
||||||
|
echo "moko-platform already available — skipping clone"
|
||||||
|
else
|
||||||
git clone --depth 1 --branch main --quiet \
|
git clone --depth 1 --branch main --quiet \
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
/tmp/mokostandards-api 2>/dev/null || true
|
/tmp/moko-platform 2>/dev/null || true
|
||||||
if [ -d "/tmp/mokostandards-api" ] && [ -f "/tmp/mokostandards-api/composer.json" ]; then
|
fi
|
||||||
cd /tmp/mokostandards-api && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
if [ -d "/tmp/moko-platform" ] && [ -f "/tmp/moko-platform/composer.json" ]; then
|
||||||
|
cd /tmp/moko-platform && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Generate updates.xml entry
|
- name: Generate updates.xml entry
|
||||||
@@ -100,14 +104,14 @@ jobs:
|
|||||||
BRANCH="${{ github.ref_name }}"
|
BRANCH="${{ github.ref_name }}"
|
||||||
REPO="${{ github.repository }}"
|
REPO="${{ github.repository }}"
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
VERSION=$(php /tmp/mokostandards-api/cli/version_read.php --path . 2>/dev/null || echo "0.0.0")
|
VERSION=$(php /tmp/moko-platform/cli/version_read.php --path . 2>/dev/null || echo "0.0.0")
|
||||||
|
|
||||||
# Auto-bump patch on all branches (dev, alpha, beta, rc)
|
# Auto-bump patch on all branches (dev, alpha, beta, rc)
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
git config --local user.name "gitea-actions[bot]"
|
||||||
BUMPED=$(php /tmp/mokostandards-api/cli/version_bump.php --path . 2>/dev/null || true)
|
BUMPED=$(php /tmp/moko-platform/cli/version_bump.php --path . 2>/dev/null || true)
|
||||||
if [ -n "$BUMPED" ]; then
|
if [ -n "$BUMPED" ]; then
|
||||||
VERSION=$(php /tmp/mokostandards-api/cli/version_read.php --path . 2>/dev/null || echo "$VERSION")
|
VERSION=$(php /tmp/moko-platform/cli/version_read.php --path . 2>/dev/null || echo "$VERSION")
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "chore(version): auto-bump patch ${VERSION} [skip ci]" \
|
git commit -m "chore(version): auto-bump patch ${VERSION} [skip ci]" \
|
||||||
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>" 2>/dev/null || true
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>" 2>/dev/null || true
|
||||||
@@ -165,9 +169,12 @@ jobs:
|
|||||||
|
|
||||||
[ -z "$TARGET_PLATFORM" ] && TARGET_PLATFORM=$(printf '<targetplatform name="joomla" version="((5.[0-9])|(6.[0-9]))" %s>' "/")
|
[ -z "$TARGET_PLATFORM" ] && TARGET_PLATFORM=$(printf '<targetplatform name="joomla" version="((5.[0-9])|(6.[0-9]))" %s>' "/")
|
||||||
|
|
||||||
CLIENT_TAG=""
|
# Joomla requires <client> on ALL extension types for update matching
|
||||||
[ -n "$EXT_CLIENT" ] && CLIENT_TAG="<client>${EXT_CLIENT}</client>"
|
if [ -n "$EXT_CLIENT" ]; then
|
||||||
[ -z "$CLIENT_TAG" ] && ([ "$EXT_TYPE" = "module" ] || [ "$EXT_TYPE" = "plugin" ]) && CLIENT_TAG="<client>site</client>"
|
CLIENT_TAG="<client>${EXT_CLIENT}</client>"
|
||||||
|
else
|
||||||
|
CLIENT_TAG="<client>site</client>"
|
||||||
|
fi
|
||||||
|
|
||||||
FOLDER_TAG=""
|
FOLDER_TAG=""
|
||||||
[ -n "$EXT_FOLDER" ] && [ "$EXT_TYPE" = "plugin" ] && FOLDER_TAG="<folder>${EXT_FOLDER}</folder>"
|
[ -n "$EXT_FOLDER" ] && [ "$EXT_TYPE" = "plugin" ] && FOLDER_TAG="<folder>${EXT_FOLDER}</folder>"
|
||||||
@@ -380,20 +387,34 @@ jobs:
|
|||||||
"${API_BASE}/contents/updates.xml?ref=main" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
"${API_BASE}/contents/updates.xml?ref=main" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ -n "$FILE_SHA" ] && [ -f "updates.xml" ]; then
|
if [ -n "$FILE_SHA" ] && [ -f "updates.xml" ]; then
|
||||||
CONTENT=$(base64 -w0 updates.xml)
|
python3 -c "
|
||||||
curl -sf -X PUT -H "Authorization: token ${GA_TOKEN}" \
|
import base64, json, urllib.request, sys
|
||||||
-H "Content-Type: application/json" \
|
with open('updates.xml', 'rb') as f:
|
||||||
"${API_BASE}/contents/updates.xml" \
|
content = base64.b64encode(f.read()).decode()
|
||||||
-d "$(python3 -c "import json; print(json.dumps({
|
payload = json.dumps({
|
||||||
'content': '${CONTENT}',
|
'content': content,
|
||||||
'sha': '${FILE_SHA}',
|
'sha': '${FILE_SHA}',
|
||||||
'message': 'chore: sync updates.xml from ${STABILITY} [skip ci]',
|
'message': 'chore: sync updates.xml from ${STABILITY} [skip ci]',
|
||||||
'branch': 'main'
|
'branch': 'main'
|
||||||
}))")" > /dev/null 2>&1 \
|
}).encode()
|
||||||
|
req = urllib.request.Request(
|
||||||
|
'${API_BASE}/contents/updates.xml',
|
||||||
|
data=payload, method='PUT',
|
||||||
|
headers={
|
||||||
|
'Authorization': 'token ${GA_TOKEN}',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
})
|
||||||
|
try:
|
||||||
|
urllib.request.urlopen(req)
|
||||||
|
print('updates.xml synced to main')
|
||||||
|
except Exception as e:
|
||||||
|
print(f'ERROR: failed to sync updates.xml to main: {e}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
" \
|
||||||
&& echo "updates.xml synced to main (${STABILITY})" >> $GITHUB_STEP_SUMMARY \
|
&& echo "updates.xml synced to main (${STABILITY})" >> $GITHUB_STEP_SUMMARY \
|
||||||
|| echo "WARNING: failed to sync updates.xml to main" >> $GITHUB_STEP_SUMMARY
|
|| echo "::error::failed to sync updates.xml to main" >> $GITHUB_STEP_SUMMARY
|
||||||
else
|
else
|
||||||
echo "WARNING: could not get updates.xml SHA from main" >> $GITHUB_STEP_SUMMARY
|
echo "::error::could not get updates.xml SHA from main — file may not exist on main yet" >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: SFTP deploy to dev server
|
- name: SFTP deploy to dev server
|
||||||
@@ -442,15 +463,190 @@ jobs:
|
|||||||
printf ',"password":"%s"}' "$DEV_PASS" >> /tmp/sftp-config.json
|
printf ',"password":"%s"}' "$DEV_PASS" >> /tmp/sftp-config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PLATFORM=$(php /tmp/mokostandards-api/cli/platform_detect.php --path . 2>/dev/null || true)
|
PLATFORM=$(php /tmp/moko-platform/cli/platform_detect.php --path . 2>/dev/null || true)
|
||||||
if [ "$PLATFORM" = "waas-component" ] && [ -f "/tmp/mokostandards-api/deploy/deploy-joomla.php" ]; then
|
if [ "$PLATFORM" = "waas-component" ] && [ -f "/tmp/moko-platform/deploy/deploy-joomla.php" ]; then
|
||||||
php /tmp/mokostandards-api/deploy/deploy-joomla.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
php /tmp/moko-platform/deploy/deploy-joomla.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
||||||
elif [ -f "/tmp/mokostandards-api/deploy/deploy-sftp.php" ]; then
|
elif [ -f "/tmp/moko-platform/deploy/deploy-sftp.php" ]; then
|
||||||
php /tmp/mokostandards-api/deploy/deploy-sftp.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
php /tmp/moko-platform/deploy/deploy-sftp.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
||||||
echo "SFTP deploy to dev complete" >> $GITHUB_STEP_SUMMARY
|
echo "SFTP deploy to dev complete" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
- name: Validate updates.xml integrity
|
||||||
|
run: |
|
||||||
|
ERRORS=0
|
||||||
|
|
||||||
|
if [ ! -f "updates.xml" ]; then
|
||||||
|
echo "::error::updates.xml not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Well-formed XML
|
||||||
|
if ! python3 -c "import xml.etree.ElementTree as ET; ET.parse('updates.xml')" 2>/dev/null; then
|
||||||
|
echo "::error::updates.xml is not valid XML"
|
||||||
|
ERRORS=$((ERRORS+1))
|
||||||
|
fi
|
||||||
|
|
||||||
|
python3 << 'PYEOF'
|
||||||
|
import xml.etree.ElementTree as ET, sys, re, os
|
||||||
|
|
||||||
|
tree = ET.parse("updates.xml")
|
||||||
|
root = tree.getroot()
|
||||||
|
updates = root.findall("update")
|
||||||
|
errors = 0
|
||||||
|
warnings = 0
|
||||||
|
seen_tags = set()
|
||||||
|
|
||||||
|
# All 5 channels MUST be present
|
||||||
|
REQUIRED_CHANNELS = {"stable", "rc", "beta", "alpha", "dev"}
|
||||||
|
VALID_TAGS = REQUIRED_CHANNELS | {"development"} # accept legacy alias
|
||||||
|
REPO = os.environ.get("GITEA_REPO", "")
|
||||||
|
ORG = os.environ.get("GITEA_ORG", "MokoConsulting")
|
||||||
|
REPO_BASE = f"https://git.mokoconsulting.tech/{ORG}/"
|
||||||
|
|
||||||
|
# Gitea release tag names per channel (Moko standard)
|
||||||
|
RELEASE_TAG_MAP = {
|
||||||
|
"stable": "stable",
|
||||||
|
"rc": "release-candidate",
|
||||||
|
"beta": "beta",
|
||||||
|
"alpha": "alpha",
|
||||||
|
"dev": "development",
|
||||||
|
"development": "development",
|
||||||
|
}
|
||||||
|
|
||||||
|
# Joomla update XML required fields per
|
||||||
|
# https://docs.joomla.org/Deploying_an_Update_Server
|
||||||
|
REQUIRED_FIELDS = ["name", "element", "type", "version", "infourl"]
|
||||||
|
|
||||||
|
for i, u in enumerate(updates):
|
||||||
|
tag_el = u.find("tags/tag")
|
||||||
|
tag = tag_el.text.strip() if tag_el is not None and tag_el.text else None
|
||||||
|
label = f"Entry {i+1} (<tag>{tag or '?'}</tag>)"
|
||||||
|
|
||||||
|
# -- Required Joomla fields --
|
||||||
|
for field in REQUIRED_FIELDS:
|
||||||
|
el = u.find(field)
|
||||||
|
if el is None or not (el.text or "").strip():
|
||||||
|
print(f"::error::{label}: missing required <{field}>")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- <downloads><downloadurl> --
|
||||||
|
dl = u.find("downloads/downloadurl")
|
||||||
|
if dl is None or not (dl.text or "").strip():
|
||||||
|
print(f"::error::{label}: missing <downloads><downloadurl>")
|
||||||
|
errors += 1
|
||||||
|
else:
|
||||||
|
dl_url = dl.text.strip()
|
||||||
|
# Must point to org repo
|
||||||
|
if REPO_BASE not in dl_url:
|
||||||
|
print(f"::error::{label}: download URL not under {REPO_BASE}: {dl_url}")
|
||||||
|
errors += 1
|
||||||
|
# Must end in .zip
|
||||||
|
if not dl_url.endswith(".zip"):
|
||||||
|
print(f"::error::{label}: download URL must end in .zip: {dl_url}")
|
||||||
|
errors += 1
|
||||||
|
# Must use correct Gitea release tag in path
|
||||||
|
if tag and tag in RELEASE_TAG_MAP:
|
||||||
|
expected_tag = RELEASE_TAG_MAP[tag]
|
||||||
|
if f"/download/{expected_tag}/" not in dl_url:
|
||||||
|
print(f"::error::{label}: download URL should contain /download/{expected_tag}/ but got: {dl_url}")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- <client> (required for Joomla to match update) --
|
||||||
|
client = u.find("client")
|
||||||
|
if client is None or not (client.text or "").strip():
|
||||||
|
print(f"::error::{label}: missing <client> (required for Joomla update matching)")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- <targetplatform> --
|
||||||
|
tp = u.find("targetplatform")
|
||||||
|
if tp is None:
|
||||||
|
print(f"::error::{label}: missing <targetplatform>")
|
||||||
|
errors += 1
|
||||||
|
else:
|
||||||
|
tp_name = tp.get("name", "")
|
||||||
|
tp_ver = tp.get("version", "")
|
||||||
|
if tp_name != "joomla":
|
||||||
|
print(f"::error::{label}: targetplatform name should be 'joomla', got '{tp_name}'")
|
||||||
|
errors += 1
|
||||||
|
if not tp_ver:
|
||||||
|
print(f"::error::{label}: targetplatform missing version regex")
|
||||||
|
errors += 1
|
||||||
|
elif "5" not in tp_ver or "6" not in tp_ver:
|
||||||
|
print(f"::warning::{label}: targetplatform version may not cover Joomla 5+6: {tp_ver}")
|
||||||
|
warnings += 1
|
||||||
|
|
||||||
|
# -- <type> must be valid Joomla type --
|
||||||
|
type_el = u.find("type")
|
||||||
|
if type_el is not None and type_el.text:
|
||||||
|
valid_types = {"component", "module", "plugin", "template", "library", "package", "file"}
|
||||||
|
if type_el.text.strip() not in valid_types:
|
||||||
|
print(f"::error::{label}: invalid type '{type_el.text}' (expected: {valid_types})")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- <version> format (XX.YY.ZZ with optional suffix) --
|
||||||
|
ver_el = u.find("version")
|
||||||
|
if ver_el is not None and ver_el.text:
|
||||||
|
if not re.match(r"^\d{2}\.\d{2}\.\d{2}(-\w+)?$", ver_el.text.strip()):
|
||||||
|
print(f"::warning::{label}: version '{ver_el.text}' does not match XX.YY.ZZ format")
|
||||||
|
warnings += 1
|
||||||
|
|
||||||
|
# -- <maintainer> and <maintainerurl> --
|
||||||
|
for field in ["maintainer", "maintainerurl"]:
|
||||||
|
el = u.find(field)
|
||||||
|
if el is None or not (el.text or "").strip():
|
||||||
|
print(f"::warning::{label}: missing <{field}>")
|
||||||
|
warnings += 1
|
||||||
|
|
||||||
|
# -- Valid stability tag --
|
||||||
|
if tag is None:
|
||||||
|
print(f"::error::{label}: missing <tags><tag>")
|
||||||
|
errors += 1
|
||||||
|
elif tag not in VALID_TAGS:
|
||||||
|
print(f"::error::{label}: invalid tag '{tag}' (expected: {VALID_TAGS})")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- Duplicate tag check --
|
||||||
|
norm_tag = "dev" if tag == "development" else tag
|
||||||
|
if norm_tag in seen_tags:
|
||||||
|
print(f"::error::{label}: duplicate channel '{tag}'")
|
||||||
|
errors += 1
|
||||||
|
if norm_tag:
|
||||||
|
seen_tags.add(norm_tag)
|
||||||
|
|
||||||
|
# -- All 5 channels must exist --
|
||||||
|
missing = REQUIRED_CHANNELS - seen_tags
|
||||||
|
if missing:
|
||||||
|
print(f"::error::Missing required update channels: {', '.join(sorted(missing))}")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- Version ordering: higher stability must not exceed dev version --
|
||||||
|
channel_versions = {}
|
||||||
|
for u in updates:
|
||||||
|
tag_el = u.find("tags/tag")
|
||||||
|
ver_el = u.find("version")
|
||||||
|
if tag_el is not None and ver_el is not None and tag_el.text and ver_el.text:
|
||||||
|
norm = "dev" if tag_el.text.strip() == "development" else tag_el.text.strip()
|
||||||
|
# Strip suffix for comparison (01.00.18-dev -> 01.00.18)
|
||||||
|
base_ver = re.sub(r"-\w+$", "", ver_el.text.strip())
|
||||||
|
channel_versions[norm] = base_ver
|
||||||
|
|
||||||
|
# Cascade check: dev >= alpha >= beta >= rc >= stable
|
||||||
|
ORDER = ["dev", "alpha", "beta", "rc", "stable"]
|
||||||
|
for j in range(1, len(ORDER)):
|
||||||
|
current = ORDER[j]
|
||||||
|
previous = ORDER[j - 1]
|
||||||
|
if current in channel_versions and previous in channel_versions:
|
||||||
|
if channel_versions[current] > channel_versions[previous]:
|
||||||
|
print(f"::error::{current} version ({channel_versions[current]}) is ahead of {previous} ({channel_versions[previous]})")
|
||||||
|
errors += 1
|
||||||
|
|
||||||
|
# -- Summary --
|
||||||
|
print(f"\nupdates.xml validation: {len(updates)} entries, {errors} error(s), {warnings} warning(s)")
|
||||||
|
if errors > 0:
|
||||||
|
sys.exit(1)
|
||||||
|
PYEOF
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -27,10 +27,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Migrated all workflow and template paths from `.github/` to `.mokogitea/`
|
||||||
|
- Template source paths updated: `templates/gitea/` to `templates/mokogitea/`
|
||||||
|
- HCL definition files removed -- Template repos are now the canonical source
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `branch-cleanup.yml`: auto-delete merged feature branches after PR merge
|
||||||
|
|
||||||
### Planned
|
### Planned
|
||||||
- License/subscription check
|
- License/subscription check
|
||||||
- System email template branding (DB approach)
|
- System email template branding (DB approach)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Trusted IPs: configurable repeatable rows of IP addresses, CIDR ranges, and wildcards that bypass admin session timeout
|
||||||
|
- Supports exact IPs (192.168.1.100), CIDR (10.0.0.0/24), and wildcards (192.168.1.*)
|
||||||
|
- Each entry has a label and enabled toggle for easy management
|
||||||
|
- Current IP display above trusted IPs table so admins can easily add their own IP
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Trusted IP session bypass: moved from `onAfterInitialise` to `boot()` so Joomla's session lifetime is extended before the session handler validates it (was too late, Joomla expired the session first)
|
||||||
|
|
||||||
|
## [02.06.00] - 2026-05-25
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Alias offline bypass: aliases with offline=No override Joomla's global offline setting, allowing access via alias domain while main site is down
|
||||||
|
- Block non-master users from viewing or editing MokoWaaS plugin settings
|
||||||
|
- Master user bypasses ALL tenant restrictions (install from URL, global config, sysinfo, installer, templates)
|
||||||
|
- Admin Help menu redirected to configured support URL (replaces help.joomla.org)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Install API endpoint: extract ZIP to temp directory before passing to Joomla Installer (was passing ZIP path directly)
|
||||||
|
- Clean up extracted temp directory on success or failure
|
||||||
|
- Update site disabled by Joomla when protected=1 — ensureProtectedFlag() now re-enables it
|
||||||
|
- CI: auto-release fetches updates.xml from main before building (preserves all channels)
|
||||||
|
- CI: version_check.php --fix runs after version bump in both workflows
|
||||||
|
- CI: checksums attached as `[filename].sha256` files instead of in release body
|
||||||
|
- CI: auto-release cleaned up — removed duplicate asset loops, inline Python updater, dead code
|
||||||
|
- CI: Step 8b uses `release_body_update.php` CLI instead of inline Python
|
||||||
|
- CI: Step 6 tag creation no longer gated by `is_minor` (was never set)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- CI: auto-release uses stream tag `stable` instead of version tag `vXX`
|
||||||
|
- CI: pre-release package build uses absolute paths (fixes relative path zip error)
|
||||||
|
|
||||||
|
## [02.05.00] - 2026-05-24
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Joomla `protected=1` flag on all MokoWaaS extensions (framework-level disable/uninstall prevention)
|
||||||
|
- Self-healing protected flag — restored each admin session if cleared
|
||||||
|
- Block non-master disable via plugin list toggle (`plugins.publish`)
|
||||||
|
- Package script sets `protected=1, locked=0` on every install/update
|
||||||
|
- Legacy plugin entry in updates.xml for sites upgrading from standalone plugin
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- CI: auto-release workflow `pkg_pkg_` duplication in release names, ZIP filenames, and SHA256 paths
|
||||||
|
- CI: auto-release now strips existing type prefix and uses `<packagename>` for packages
|
||||||
|
- CI: `updates_xml_build` was cascading entries for all lower channels on stable release — now writes only current channel
|
||||||
|
- CI: `targetplatform` regex `((5.[0-9])|(6.[0-9]))` caused Gitea 500 on XML render — simplified to `(5|6)\..*`
|
||||||
|
- updates.xml stable entry now has correct `<tag>stable</tag>` and download URL
|
||||||
|
- README slimmed to overview, detailed content moved to wiki
|
||||||
|
|
||||||
## [02.03.10] - 2026-05-24
|
## [02.03.10] - 2026-05-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
DEFGROUP: Joomla.Plugin
|
DEFGROUP: Joomla.Plugin
|
||||||
INGROUP: MokoWaaS
|
INGROUP: MokoWaaS
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS
|
||||||
VERSION: 02.04.00
|
VERSION: 02.11.02
|
||||||
PATH: /README.md
|
PATH: /README.md
|
||||||
BRIEF: MokoWaaS platform plugin for Joomla
|
BRIEF: MokoWaaS platform plugin for Joomla
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<license>GPL-3.0-or-later</license>
|
<license>GPL-3.0-or-later</license>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||||
<version>02.04.00</version>
|
<version>02.11.02</version>
|
||||||
<description>Minimal API-only component for MokoWaaS. Provides REST endpoints for site health, cache, updates, and backups.</description>
|
<description>Minimal API-only component for MokoWaaS. Provides REST endpoints for site health, cache, updates, and backups.</description>
|
||||||
<namespace path="api/src">Moko\Component\MokoWaaS\Api</namespace>
|
<namespace path="api/src">Moko\Component\MokoWaaS\Api</namespace>
|
||||||
<administration>
|
<administration>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace Moko\Plugin\System\MokoWaaS\Extension;
|
|||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Extension\BootableExtensionInterface;
|
||||||
use Joomla\CMS\Factory;
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\Log\Log;
|
use Joomla\CMS\Log\Log;
|
||||||
use Joomla\CMS\Plugin\CMSPlugin;
|
use Joomla\CMS\Plugin\CMSPlugin;
|
||||||
@@ -38,6 +39,7 @@ use Joomla\CMS\Router\Route;
|
|||||||
use Joomla\CMS\Language\Language;
|
use Joomla\CMS\Language\Language;
|
||||||
use Joomla\CMS\Uri\Uri;
|
use Joomla\CMS\Uri\Uri;
|
||||||
use Joomla\CMS\User\UserHelper;
|
use Joomla\CMS\User\UserHelper;
|
||||||
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MokoWaaS Brand System Plugin
|
* MokoWaaS Brand System Plugin
|
||||||
@@ -47,7 +49,7 @@ use Joomla\CMS\User\UserHelper;
|
|||||||
*
|
*
|
||||||
* @since 01.04.00
|
* @since 01.04.00
|
||||||
*/
|
*/
|
||||||
class MokoWaaS extends CMSPlugin
|
class MokoWaaS extends CMSPlugin implements BootableExtensionInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Obfuscated Grafana URL (XOR + base64).
|
* Obfuscated Grafana URL (XOR + base64).
|
||||||
@@ -114,6 +116,37 @@ class MokoWaaS extends CMSPlugin
|
|||||||
*/
|
*/
|
||||||
protected $app;
|
protected $app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boot the extension — runs BEFORE Joomla creates the session.
|
||||||
|
*
|
||||||
|
* Extends the Joomla session lifetime for trusted IPs so the
|
||||||
|
* session handler does not destroy the session before
|
||||||
|
* onAfterInitialise can run.
|
||||||
|
*
|
||||||
|
* @param ContainerInterface $container The DI container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 02.11.00
|
||||||
|
*/
|
||||||
|
public function boot(ContainerInterface $container): void
|
||||||
|
{
|
||||||
|
$timeout = (int) $this->params->get('admin_session_timeout', 0);
|
||||||
|
|
||||||
|
if ($timeout <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->ipIsTrusted())
|
||||||
|
{
|
||||||
|
// Set both PHP and Joomla session lifetimes before the
|
||||||
|
// session handler runs its expiry check.
|
||||||
|
ini_set('session.gc_maxlifetime', 315360000);
|
||||||
|
Factory::getConfig()->set('lifetime', 525600);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event triggered after the framework has loaded and the application initialise method has been called.
|
* Event triggered after the framework has loaded and the application initialise method has been called.
|
||||||
*
|
*
|
||||||
@@ -653,7 +686,7 @@ class MokoWaaS extends CMSPlugin
|
|||||||
return [
|
return [
|
||||||
'{{BRAND_NAME}}' => $this->params->get('brand_name', 'MokoWaaS'),
|
'{{BRAND_NAME}}' => $this->params->get('brand_name', 'MokoWaaS'),
|
||||||
'{{COMPANY_NAME}}' => $this->params->get('company_name', 'Moko Consulting'),
|
'{{COMPANY_NAME}}' => $this->params->get('company_name', 'Moko Consulting'),
|
||||||
'{{SUPPORT_URL}}' => $this->params->get('support_url', 'https://mokoconsulting.tech'),
|
'{{SUPPORT_URL}}' => $this->params->get('support_url', 'https://mokoconsulting.tech/support'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,6 +969,7 @@ class MokoWaaS extends CMSPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->injectFavicon($doc);
|
$this->injectFavicon($doc);
|
||||||
|
$this->redirectHelpMenu($doc);
|
||||||
|
|
||||||
// Hide MokoWaaS from plugin list for non-master users
|
// Hide MokoWaaS from plugin list for non-master users
|
||||||
if (!$this->isMasterUser())
|
if (!$this->isMasterUser())
|
||||||
@@ -975,6 +1009,32 @@ class MokoWaaS extends CMSPlugin
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect the admin Help menu link to the configured support URL.
|
||||||
|
*
|
||||||
|
* Joomla's Atum template hardcodes the Help link to help.joomla.org.
|
||||||
|
* This replaces it with the WaaS support URL via JS injection.
|
||||||
|
*
|
||||||
|
* @param \Joomla\CMS\Document\HtmlDocument $doc Document object
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 02.10.00
|
||||||
|
*/
|
||||||
|
protected function redirectHelpMenu($doc)
|
||||||
|
{
|
||||||
|
$supportUrl = $this->params->get('support_url', 'https://mokoconsulting.tech/support');
|
||||||
|
|
||||||
|
$doc->addScriptDeclaration("
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.querySelectorAll('a[href*=\"help.joomla.org\"], a[href*=\"docs.joomla.org\"]').forEach(function(link) {
|
||||||
|
link.href = " . json_encode($supportUrl) . ";
|
||||||
|
link.target = '_blank';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protect the plugin from being disabled or uninstalled by non-master users.
|
* Protect the plugin from being disabled or uninstalled by non-master users.
|
||||||
* Does NOT self-heal (no lock) — master users can still disable if needed.
|
* Does NOT self-heal (no lock) — master users can still disable if needed.
|
||||||
@@ -1025,6 +1085,31 @@ class MokoWaaS extends CMSPlugin
|
|||||||
$this->app->redirect('index.php?option=com_plugins');
|
$this->app->redirect('index.php?option=com_plugins');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Block non-master from viewing or editing MokoWaaS plugin settings
|
||||||
|
if ($option === 'com_plugins')
|
||||||
|
{
|
||||||
|
$view = $this->app->input->get('view', '');
|
||||||
|
$layout = $this->app->input->get('layout', '');
|
||||||
|
$extensionId = (int) $this->app->input->get('extension_id', 0);
|
||||||
|
|
||||||
|
if (($view === 'plugin' || $layout === 'edit') && $extensionId > 0)
|
||||||
|
{
|
||||||
|
$db = Factory::getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select('COUNT(*)')
|
||||||
|
->from($db->quoteName('#__extensions'))
|
||||||
|
->where($db->quoteName('extension_id') . ' = ' . $extensionId)
|
||||||
|
->where($db->quoteName('element') . ' = ' . $db->quote('mokowaas'))
|
||||||
|
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'));
|
||||||
|
|
||||||
|
if ((int) $db->setQuery($query)->loadResult() > 0)
|
||||||
|
{
|
||||||
|
$this->app->enqueueMessage('MokoWaaS settings are restricted to the master user.', 'warning');
|
||||||
|
$this->app->redirect('index.php?option=com_plugins');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1042,6 +1127,8 @@ class MokoWaaS extends CMSPlugin
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$db = Factory::getDbo();
|
$db = Factory::getDbo();
|
||||||
|
|
||||||
|
// Set protected=1, locked=0 on MokoWaaS extensions
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->update($db->quoteName('#__extensions'))
|
->update($db->quoteName('#__extensions'))
|
||||||
->set($db->quoteName('protected') . ' = 1')
|
->set($db->quoteName('protected') . ' = 1')
|
||||||
@@ -1051,6 +1138,18 @@ class MokoWaaS extends CMSPlugin
|
|||||||
->where($db->quoteName('protected') . ' = 0');
|
->where($db->quoteName('protected') . ' = 0');
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
$db->execute();
|
$db->execute();
|
||||||
|
|
||||||
|
// Ensure update site stays enabled (protected extensions get their update site disabled by Joomla)
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->update($db->quoteName('#__update_sites') . ' AS us')
|
||||||
|
->join('INNER', $db->quoteName('#__update_sites_extensions') . ' AS use2 ON us.update_site_id = use2.update_site_id')
|
||||||
|
->join('INNER', $db->quoteName('#__extensions') . ' AS e ON use2.extension_id = e.extension_id')
|
||||||
|
->set('us.enabled = 1')
|
||||||
|
->where('us.enabled = 0')
|
||||||
|
->where('(' . $db->quoteName('e.element') . ' = ' . $db->quote('mokowaas')
|
||||||
|
. ' OR ' . $db->quoteName('e.element') . ' = ' . $db->quote('pkg_mokowaas') . ')');
|
||||||
|
$db->setQuery($query);
|
||||||
|
$db->execute();
|
||||||
}
|
}
|
||||||
catch (\Throwable $e)
|
catch (\Throwable $e)
|
||||||
{
|
{
|
||||||
@@ -2747,11 +2846,36 @@ class MokoWaaS extends CMSPlugin
|
|||||||
|
|
||||||
file_put_contents($tmpFile, $zipData);
|
file_put_contents($tmpFile, $zipData);
|
||||||
|
|
||||||
|
// Extract ZIP to temp directory
|
||||||
|
$extractDir = $this->app->getConfig()->get('tmp_path', JPATH_ROOT . '/tmp')
|
||||||
|
. '/mokowaas_extract_' . md5($url);
|
||||||
|
|
||||||
|
if (is_dir($extractDir))
|
||||||
|
{
|
||||||
|
$this->rmdirRecursive($extractDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir($extractDir, 0755, true);
|
||||||
|
|
||||||
|
$zip = new \ZipArchive();
|
||||||
|
|
||||||
|
if ($zip->open($tmpFile) !== true)
|
||||||
|
{
|
||||||
|
@unlink($tmpFile);
|
||||||
|
$this->sendHealthResponse(500, ['error' => 'Failed to open ZIP']);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$zip->extractTo($extractDir);
|
||||||
|
$zip->close();
|
||||||
|
@unlink($tmpFile);
|
||||||
|
|
||||||
// Install using Joomla's installer
|
// Install using Joomla's installer
|
||||||
$installer = \Joomla\CMS\Installer\Installer::getInstance();
|
$installer = \Joomla\CMS\Installer\Installer::getInstance();
|
||||||
$result = $installer->install($tmpFile);
|
$result = $installer->install($extractDir);
|
||||||
|
|
||||||
@unlink($tmpFile);
|
$this->rmdirRecursive($extractDir);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@@ -2774,6 +2898,11 @@ class MokoWaaS extends CMSPlugin
|
|||||||
{
|
{
|
||||||
@unlink($tmpFile ?? '');
|
@unlink($tmpFile ?? '');
|
||||||
|
|
||||||
|
if (!empty($extractDir) && is_dir($extractDir))
|
||||||
|
{
|
||||||
|
$this->rmdirRecursive($extractDir);
|
||||||
|
}
|
||||||
|
|
||||||
$this->sendHealthResponse(500, [
|
$this->sendHealthResponse(500, [
|
||||||
'error' => 'Install exception',
|
'error' => 'Install exception',
|
||||||
'message' => $e->getMessage(),
|
'message' => $e->getMessage(),
|
||||||
@@ -2782,6 +2911,42 @@ class MokoWaaS extends CMSPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively remove a directory.
|
||||||
|
*
|
||||||
|
* @param string $dir Directory path
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 02.06.00
|
||||||
|
*/
|
||||||
|
protected function rmdirRecursive(string $dir): void
|
||||||
|
{
|
||||||
|
if (!is_dir($dir))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$items = new \RecursiveIteratorIterator(
|
||||||
|
new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS),
|
||||||
|
\RecursiveIteratorIterator::CHILD_FIRST
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
if ($item->isDir())
|
||||||
|
{
|
||||||
|
rmdir($item->getPathname());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unlink($item->getPathname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rmdir($dir);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Site Alias handling
|
// Site Alias handling
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
@@ -2944,8 +3109,9 @@ class MokoWaaS extends CMSPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Offline: use Joomla's native offline mode for frontend requests
|
// Offline: use Joomla's native offline mode for frontend requests
|
||||||
if (!empty($alias->offline) && (string) $alias->offline === '1'
|
if ($this->app->isClient('site'))
|
||||||
&& $this->app->isClient('site'))
|
{
|
||||||
|
if (!empty($alias->offline) && (string) $alias->offline === '1')
|
||||||
{
|
{
|
||||||
// Allow health API to still respond
|
// Allow health API to still respond
|
||||||
if ($this->app->input->get('mokowaas', '') !== '')
|
if ($this->app->input->get('mokowaas', '') !== '')
|
||||||
@@ -2961,9 +3127,16 @@ class MokoWaaS extends CMSPlugin
|
|||||||
$this->app->getConfig()->set('offline_message', $message);
|
$this->app->getConfig()->set('offline_message', $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable Joomla's native offline mode — renders through the template's offline.php
|
// Enable Joomla's native offline mode
|
||||||
$this->app->getConfig()->set('offline', 1);
|
$this->app->getConfig()->set('offline', 1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Alias is NOT offline — override Joomla's global offline setting
|
||||||
|
// This allows access via the alias domain even when the main site is offline
|
||||||
|
$this->app->getConfig()->set('offline', 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3203,6 +3376,12 @@ class MokoWaaS extends CMSPlugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trusted IPs — session lifetime already extended in boot()
|
||||||
|
if ($this->ipIsTrusted())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$session = Factory::getSession();
|
$session = Factory::getSession();
|
||||||
$lastHit = $session->get('mokowaas.last_activity', 0);
|
$lastHit = $session->get('mokowaas.last_activity', 0);
|
||||||
$now = time();
|
$now = time();
|
||||||
@@ -3220,6 +3399,93 @@ class MokoWaaS extends CMSPlugin
|
|||||||
$session->set('mokowaas.last_activity', $now);
|
$session->set('mokowaas.last_activity', $now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether the current request IP matches any trusted IP entry.
|
||||||
|
*
|
||||||
|
* Supports exact IPs, CIDR notation (e.g. 10.0.0.0/8), and
|
||||||
|
* wildcard patterns (e.g. 192.168.1.*).
|
||||||
|
*
|
||||||
|
* @return bool True if the current IP is in the trusted list.
|
||||||
|
*
|
||||||
|
* @since 02.11.00
|
||||||
|
*/
|
||||||
|
protected function ipIsTrusted(): bool
|
||||||
|
{
|
||||||
|
$entries = $this->params->get('trusted_ips', '');
|
||||||
|
|
||||||
|
if (empty($entries))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subform stores as JSON string or array
|
||||||
|
if (\is_string($entries))
|
||||||
|
{
|
||||||
|
$entries = json_decode($entries, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!\is_array($entries))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ip = $this->app
|
||||||
|
? $this->app->input->server->getString('REMOTE_ADDR', '')
|
||||||
|
: ($_SERVER['REMOTE_ADDR'] ?? '');
|
||||||
|
$ipLong = ip2long($ip);
|
||||||
|
|
||||||
|
if ($ipLong === false)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($entries as $entry)
|
||||||
|
{
|
||||||
|
if (empty($entry['enabled']) || empty($entry['ip']))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$range = trim($entry['ip']);
|
||||||
|
|
||||||
|
// Wildcard: 192.168.1.*
|
||||||
|
if (str_contains($range, '*'))
|
||||||
|
{
|
||||||
|
$pattern = '/^' . str_replace(['.', '*'], ['\\.', '\\d+'], $range) . '$/';
|
||||||
|
|
||||||
|
if (preg_match($pattern, $ip))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// CIDR: 10.0.0.0/8
|
||||||
|
if (str_contains($range, '/'))
|
||||||
|
{
|
||||||
|
[$subnet, $bits] = explode('/', $range, 2);
|
||||||
|
$subnetLong = ip2long($subnet);
|
||||||
|
$mask = -1 << (32 - (int) $bits);
|
||||||
|
|
||||||
|
if ($subnetLong !== false && ($ipLong & $mask) === ($subnetLong & $mask))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exact match
|
||||||
|
if ($ip === $range)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override Joomla upload restrictions at runtime.
|
* Override Joomla upload restrictions at runtime.
|
||||||
@@ -3328,12 +3594,18 @@ class MokoWaaS extends CMSPlugin
|
|||||||
*/
|
*/
|
||||||
protected function enforceAdminRestrictions()
|
protected function enforceAdminRestrictions()
|
||||||
{
|
{
|
||||||
|
// Master user bypasses ALL restrictions
|
||||||
|
if ($this->isMasterUser())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$input = $this->app->input;
|
$input = $this->app->input;
|
||||||
$option = $input->get('option', '');
|
$option = $input->get('option', '');
|
||||||
$view = $input->get('view', '');
|
$view = $input->get('view', '');
|
||||||
$task = $input->get('task', '');
|
$task = $input->get('task', '');
|
||||||
|
|
||||||
// Disable install-from-URL for ALL users (safety net)
|
// Disable install-from-URL for non-master users
|
||||||
if ($this->params->get('disable_install_url', 1)
|
if ($this->params->get('disable_install_url', 1)
|
||||||
&& $option === 'com_installer'
|
&& $option === 'com_installer'
|
||||||
&& stripos($task, 'install') !== false
|
&& stripos($task, 'install') !== false
|
||||||
@@ -3344,12 +3616,6 @@ class MokoWaaS extends CMSPlugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remaining restrictions only apply to non-master users
|
|
||||||
if ($this->isMasterUser())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$blocked = [];
|
$blocked = [];
|
||||||
|
|
||||||
if ($this->params->get('restrict_installer', 1))
|
if ($this->params->get('restrict_installer', 1))
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* SPDX-LICENSE-IDENTIFIER: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: Joomla.Plugin
|
||||||
|
* INGROUP: MokoWaaS
|
||||||
|
* VERSION: 02.11.00
|
||||||
|
* PATH: /src/Field/CurrentIpField.php
|
||||||
|
* BRIEF: Read-only field that displays the current user's IP address
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Moko\Plugin\System\MokoWaaS\Field;
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Form\FormField;
|
||||||
|
|
||||||
|
class CurrentIpField extends FormField
|
||||||
|
{
|
||||||
|
protected $type = 'CurrentIp';
|
||||||
|
|
||||||
|
protected function getInput()
|
||||||
|
{
|
||||||
|
$currentIp = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
|
||||||
|
|
||||||
|
return '<div class="alert alert-info mb-0 py-2">'
|
||||||
|
. '<strong>Your current IP:</strong> '
|
||||||
|
. '<code>' . htmlspecialchars($currentIp) . '</code> '
|
||||||
|
. '<small class="text-muted">— add this to the table below to keep your session alive.</small>'
|
||||||
|
. '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getLabel()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<form>
|
||||||
|
<field
|
||||||
|
name="ip"
|
||||||
|
type="text"
|
||||||
|
label="PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_LABEL"
|
||||||
|
description="PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_DESC"
|
||||||
|
required="true"
|
||||||
|
hint="e.g. 192.168.1.100 or 10.0.0.0/24"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="label"
|
||||||
|
type="text"
|
||||||
|
label="PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_LABEL"
|
||||||
|
description="PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_DESC"
|
||||||
|
hint="e.g. Office network"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="enabled"
|
||||||
|
type="radio"
|
||||||
|
label="PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ENABLED_LABEL"
|
||||||
|
default="1"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
</form>
|
||||||
@@ -120,6 +120,13 @@ PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_LABEL="Force HTTPS"
|
|||||||
PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_DESC="Redirect all HTTP requests to HTTPS. Supports reverse proxy setups."
|
PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_DESC="Redirect all HTTP requests to HTTPS. Supports reverse proxy setups."
|
||||||
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL="Admin Session Timeout"
|
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL="Admin Session Timeout"
|
||||||
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC="Minutes of idle time before admin sessions expire. 0 uses the Joomla default."
|
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC="Minutes of idle time before admin sessions expire. 0 uses the Joomla default."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_LABEL="Trusted IPs (No Session Timeout)"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_DESC="Sessions from these IP addresses or ranges will never time out. Supports exact IPs, CIDR notation (e.g. 10.0.0.0/24), and wildcards (e.g. 192.168.1.*)."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_LABEL="IP / CIDR"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_DESC="An IP address, CIDR range, or wildcard pattern."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_LABEL="Label"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_DESC="A descriptive label for this entry (e.g. Office, VPN)."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ENABLED_LABEL="Enabled"
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL="Minimum Password Length"
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL="Minimum Password Length"
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC="Minimum number of characters required for user passwords."
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC="Minimum number of characters required for user passwords."
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_UPPER_LABEL="Require Uppercase"
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_UPPER_LABEL="Require Uppercase"
|
||||||
|
|||||||
@@ -120,6 +120,13 @@ PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_LABEL="Force HTTPS"
|
|||||||
PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_DESC="Redirect all HTTP requests to HTTPS. Supports reverse proxy setups."
|
PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_DESC="Redirect all HTTP requests to HTTPS. Supports reverse proxy setups."
|
||||||
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL="Admin Session Timeout"
|
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL="Admin Session Timeout"
|
||||||
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC="Minutes of idle time before admin sessions expire. 0 uses the Joomla default."
|
PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC="Minutes of idle time before admin sessions expire. 0 uses the Joomla default."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_LABEL="Trusted IPs (No Session Timeout)"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_DESC="Sessions from these IP addresses or ranges will never time out. Supports exact IPs, CIDR notation (e.g. 10.0.0.0/24), and wildcards (e.g. 192.168.1.*)."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_LABEL="IP / CIDR"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ADDR_DESC="An IP address, CIDR range, or wildcard pattern."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_LABEL="Label"
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_LABEL_DESC="A descriptive label for this entry (e.g. Office, VPN)."
|
||||||
|
PLG_SYSTEM_MOKOWAAS_TRUSTED_IP_ENABLED_LABEL="Enabled"
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL="Minimum Password Length"
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL="Minimum Password Length"
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC="Minimum number of characters required for user passwords."
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC="Minimum number of characters required for user passwords."
|
||||||
PLG_SYSTEM_MOKOWAAS_PASSWORD_UPPER_LABEL="Require Uppercase"
|
PLG_SYSTEM_MOKOWAAS_PASSWORD_UPPER_LABEL="Require Uppercase"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<license>GNU General Public License version 3 or later; see LICENSE.md</license>
|
<license>GNU General Public License version 3 or later; see LICENSE.md</license>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||||
<version>02.04.00</version>
|
<version>02.11.02</version>
|
||||||
<description>This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform.</description>
|
<description>This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform.</description>
|
||||||
<namespace path=".">Moko\Plugin\System\MokoWaaS</namespace>
|
<namespace path=".">Moko\Plugin\System\MokoWaaS</namespace>
|
||||||
<scriptfile>script.php</scriptfile>
|
<scriptfile>script.php</scriptfile>
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
type="url"
|
type="url"
|
||||||
label="PLG_SYSTEM_MOKOWAAS_SUPPORT_URL_LABEL"
|
label="PLG_SYSTEM_MOKOWAAS_SUPPORT_URL_LABEL"
|
||||||
description="PLG_SYSTEM_MOKOWAAS_SUPPORT_URL_DESC"
|
description="PLG_SYSTEM_MOKOWAAS_SUPPORT_URL_DESC"
|
||||||
default="https://mokoconsulting.tech"
|
default="https://mokoconsulting.tech/support"
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset name="waas_access"
|
<fieldset name="waas_access"
|
||||||
@@ -310,6 +310,7 @@
|
|||||||
<fieldset name="security"
|
<fieldset name="security"
|
||||||
label="PLG_SYSTEM_MOKOWAAS_FIELDSET_SECURITY_LABEL"
|
label="PLG_SYSTEM_MOKOWAAS_FIELDSET_SECURITY_LABEL"
|
||||||
description="PLG_SYSTEM_MOKOWAAS_FIELDSET_SECURITY_DESC"
|
description="PLG_SYSTEM_MOKOWAAS_FIELDSET_SECURITY_DESC"
|
||||||
|
addfieldprefix="Moko\Plugin\System\MokoWaaS\Field"
|
||||||
>
|
>
|
||||||
<field name="force_https" type="radio" default="1"
|
<field name="force_https" type="radio" default="1"
|
||||||
label="PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_LABEL"
|
label="PLG_SYSTEM_MOKOWAAS_FORCE_HTTPS_LABEL"
|
||||||
@@ -322,6 +323,22 @@
|
|||||||
label="PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL"
|
label="PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_LABEL"
|
||||||
description="PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC"
|
description="PLG_SYSTEM_MOKOWAAS_SESSION_TIMEOUT_DESC"
|
||||||
default="60" hint="Minutes (0 = Joomla default)" />
|
default="60" hint="Minutes (0 = Joomla default)" />
|
||||||
|
<field
|
||||||
|
name="current_ip_display"
|
||||||
|
type="CurrentIp"
|
||||||
|
label=""
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="trusted_ips"
|
||||||
|
type="subform"
|
||||||
|
label="PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_LABEL"
|
||||||
|
description="PLG_SYSTEM_MOKOWAAS_TRUSTED_IPS_DESC"
|
||||||
|
formsource="plugins/system/mokowaas/forms/trusted_ip_entry.xml"
|
||||||
|
multiple="true"
|
||||||
|
layout="joomla.form.field.subform.repeatable-table"
|
||||||
|
groupByFieldset="false"
|
||||||
|
buttons="add,remove,move"
|
||||||
|
/>
|
||||||
<field name="password_min_length" type="number" default="12"
|
<field name="password_min_length" type="number" default="12"
|
||||||
label="PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL"
|
label="PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_LABEL"
|
||||||
description="PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC" />
|
description="PLG_SYSTEM_MOKOWAAS_PASSWORD_LENGTH_DESC" />
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
|||||||
return [
|
return [
|
||||||
'{{BRAND_NAME}}' => $params->get('brand_name', 'MokoWaaS'),
|
'{{BRAND_NAME}}' => $params->get('brand_name', 'MokoWaaS'),
|
||||||
'{{COMPANY_NAME}}' => $params->get('company_name', 'Moko Consulting'),
|
'{{COMPANY_NAME}}' => $params->get('company_name', 'Moko Consulting'),
|
||||||
'{{SUPPORT_URL}}' => $params->get('support_url', 'https://mokoconsulting.tech'),
|
'{{SUPPORT_URL}}' => $params->get('support_url', 'https://mokoconsulting.tech/support'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<license>GPL-3.0-or-later</license>
|
<license>GPL-3.0-or-later</license>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||||
<version>02.04.00</version>
|
<version>02.11.02</version>
|
||||||
<description>Joomla Web Services API routes for MokoWaaS site management — health checks, cache, updates, backups, and site info.</description>
|
<description>Joomla Web Services API routes for MokoWaaS site management — health checks, cache, updates, backups, and site info.</description>
|
||||||
<namespace path="src">Moko\Plugin\WebServices\MokoWaaS</namespace>
|
<namespace path="src">Moko\Plugin\WebServices\MokoWaaS</namespace>
|
||||||
<files>
|
<files>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Moko\Plugin\WebServices\MokoWaaS\Extension;
|
|||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
use Joomla\CMS\Plugin\CMSPlugin;
|
use Joomla\CMS\Plugin\CMSPlugin;
|
||||||
|
use Joomla\CMS\Event\Application\BeforeApiRouteEvent;
|
||||||
use Joomla\CMS\Router\ApiRouter;
|
use Joomla\CMS\Router\ApiRouter;
|
||||||
use Joomla\Event\SubscriberInterface;
|
use Joomla\Event\SubscriberInterface;
|
||||||
|
|
||||||
@@ -36,14 +37,16 @@ final class MokoWaaSApi extends CMSPlugin implements SubscriberInterface
|
|||||||
/**
|
/**
|
||||||
* Register API routes for MokoWaaS.
|
* Register API routes for MokoWaaS.
|
||||||
*
|
*
|
||||||
* @param ApiRouter $router The API router
|
* @param BeforeApiRouteEvent $event The API route event (Joomla 6 typed event)
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function onBeforeApiRoute(&$router): void
|
public function onBeforeApiRoute(BeforeApiRouteEvent $event): void
|
||||||
{
|
{
|
||||||
|
$router = $event->getRouter();
|
||||||
|
|
||||||
$router->createCRUDRoutes(
|
$router->createCRUDRoutes(
|
||||||
'v1/mokowaas/health',
|
'v1/mokowaas/health',
|
||||||
'health',
|
'health',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<extension type="package" method="upgrade">
|
<extension type="package" method="upgrade">
|
||||||
<name>MokoWaaS</name>
|
<name>MokoWaaS</name>
|
||||||
<packagename>mokowaas</packagename>
|
<packagename>mokowaas</packagename>
|
||||||
<version>02.04.00</version>
|
<version>02.11.02</version>
|
||||||
<creationDate>2026-05-23</creationDate>
|
<creationDate>2026-05-23</creationDate>
|
||||||
<author>Moko Consulting</author>
|
<author>Moko Consulting</author>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
|
|||||||
+106
-64
@@ -1,83 +1,125 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<!-- Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
<!-- Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
VERSION: 02.04.00
|
VERSION: 02.09.00
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<updates>
|
<updates>
|
||||||
<update>
|
<update>
|
||||||
<name>MokoWaaS</name>
|
<name>MokoWaaS</name>
|
||||||
<description>MokoWaaS update</description>
|
<description>MokoWaaS update</description>
|
||||||
<element>mokowaas</element>
|
<element>pkg_mokowaas</element>
|
||||||
<type>package</type>
|
<type>package</type>
|
||||||
<version>02.04.00-dev</version>
|
<version>02.09.00</version>
|
||||||
<tags><tag>development</tag></tags>
|
<client>site</client>
|
||||||
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
|
||||||
<downloads>
|
|
||||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.04.00-dev.zip</downloadurl>
|
|
||||||
</downloads>
|
|
||||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
|
||||||
<maintainer>Moko Consulting</maintainer>
|
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
|
||||||
</update>
|
|
||||||
<update>
|
|
||||||
<name>MokoWaaS</name>
|
|
||||||
<description>MokoWaaS update</description>
|
|
||||||
<element>mokowaas</element>
|
|
||||||
<type>package</type>
|
|
||||||
<version>02.04.00-alpha</version>
|
|
||||||
<tags><tag>alpha</tag></tags>
|
|
||||||
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/alpha</infourl>
|
|
||||||
<downloads>
|
|
||||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/alpha/pkg_mokowaas-02.04.00-alpha.zip</downloadurl>
|
|
||||||
</downloads>
|
|
||||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
|
||||||
<maintainer>Moko Consulting</maintainer>
|
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
|
||||||
</update>
|
|
||||||
<update>
|
|
||||||
<name>MokoWaaS</name>
|
|
||||||
<description>MokoWaaS update</description>
|
|
||||||
<element>mokowaas</element>
|
|
||||||
<type>package</type>
|
|
||||||
<version>02.04.00-beta</version>
|
|
||||||
<tags><tag>beta</tag></tags>
|
|
||||||
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/beta</infourl>
|
|
||||||
<downloads>
|
|
||||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/beta/pkg_mokowaas-02.04.00-beta.zip</downloadurl>
|
|
||||||
</downloads>
|
|
||||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
|
||||||
<maintainer>Moko Consulting</maintainer>
|
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
|
||||||
</update>
|
|
||||||
<update>
|
|
||||||
<name>MokoWaaS</name>
|
|
||||||
<description>MokoWaaS update</description>
|
|
||||||
<element>mokowaas</element>
|
|
||||||
<type>package</type>
|
|
||||||
<version>02.04.00-rc</version>
|
|
||||||
<tags><tag>rc</tag></tags>
|
|
||||||
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/rc</infourl>
|
|
||||||
<downloads>
|
|
||||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/rc/pkg_mokowaas-02.04.00-rc.zip</downloadurl>
|
|
||||||
</downloads>
|
|
||||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
|
||||||
<maintainer>Moko Consulting</maintainer>
|
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
|
||||||
</update>
|
|
||||||
<update>
|
|
||||||
<name>MokoWaaS</name>
|
|
||||||
<description>MokoWaaS update</description>
|
|
||||||
<element>mokowaas</element>
|
|
||||||
<type>package</type>
|
|
||||||
<version>02.04.00</version>
|
|
||||||
<tags><tag>stable</tag></tags>
|
<tags><tag>stable</tag></tags>
|
||||||
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/stable</infourl>
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/stable</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/stable/pkg_mokowaas-02.04.00.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/stable/pkg_mokowaas-02.09.00.zip</downloadurl>
|
||||||
</downloads>
|
</downloads>
|
||||||
<targetplatform name="joomla" version="(5|6)\..*" />
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
<maintainer>Moko Consulting</maintainer>
|
<maintainer>Moko Consulting</maintainer>
|
||||||
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
</update>
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>MokoWaaS</name>
|
||||||
|
<description>MokoWaaS update</description>
|
||||||
|
<element>pkg_mokowaas</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>02.09.00</version>
|
||||||
|
<client>site</client>
|
||||||
|
<tags><tag>rc</tag></tags>
|
||||||
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.09.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>MokoWaaS</name>
|
||||||
|
<description>MokoWaaS update</description>
|
||||||
|
<element>pkg_mokowaas</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>02.09.00</version>
|
||||||
|
<client>site</client>
|
||||||
|
<tags><tag>beta</tag></tags>
|
||||||
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.09.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>MokoWaaS</name>
|
||||||
|
<description>MokoWaaS update</description>
|
||||||
|
<element>pkg_mokowaas</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>02.09.00</version>
|
||||||
|
<client>site</client>
|
||||||
|
<tags><tag>alpha</tag></tags>
|
||||||
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.09.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>MokoWaaS</name>
|
||||||
|
<description>MokoWaaS update</description>
|
||||||
|
<element>pkg_mokowaas</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>02.09.00</version>
|
||||||
|
<client>site</client>
|
||||||
|
<tags><tag>dev</tag></tags>
|
||||||
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.09.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>System - MokoWaaS</name>
|
||||||
|
<description>MokoWaaS update (legacy plugin)</description>
|
||||||
|
<element>mokowaas</element>
|
||||||
|
<type>plugin</type>
|
||||||
|
<folder>system</folder>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.09.00</version>
|
||||||
|
<tags><tag>stable</tag></tags>
|
||||||
|
<infourl title="MokoWaaS">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.09.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update>
|
||||||
|
<name>MokoWaaS</name>
|
||||||
|
<description>MokoWaaS development build.</description>
|
||||||
|
<element>pkg_mokowaas</element>
|
||||||
|
<type>package</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.11.01</version>
|
||||||
|
<creationDate>2026-05-26</creationDate>
|
||||||
|
<infourl title='MokoWaaS'>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/tag/development</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/releases/download/development/pkg_mokowaas-02.11.01-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>d517b072a0962c156f0e01a0cd3fea232d5c99240cd452632d37c84b157889e2</sha256>
|
||||||
|
<tags><tag>development</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name='joomla' version='(5|6).*'/>
|
||||||
|
</update>
|
||||||
|
|
||||||
</updates>
|
</updates>
|
||||||
|
|||||||
Reference in New Issue
Block a user