Public Access
Compare commits
155 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 20c036f913 | |||
| 062b33b395 | |||
| 2d8bb5e967 | |||
| a172b21b9b | |||
| 2ce8caad88 | |||
| 0b97aa06c9 | |||
| f2fb64ec5a | |||
| eabc96b506 | |||
| ed54dd5153 | |||
| 40ebb4774c | |||
| bb2c34abbb | |||
| 5680b32e31 | |||
| 88fa860080 | |||
| 0d9c64cd28 | |||
| 3dbd221c69 | |||
| 2cedc0b94e | |||
| 94fde481d2 | |||
| b5c38d76e8 | |||
| ce0502e788 | |||
| cf29777daa | |||
| 61d52ce1cb | |||
| 16305623cc | |||
| e5768d5e44 | |||
| 9342bdf373 | |||
| dad002cc08 | |||
| 37fdef1323 | |||
| 845a377045 | |||
| 1a83a2abd5 | |||
| 9577ea6058 | |||
| c113f0437e | |||
| bfaab8a79e | |||
| 84e54c7567 | |||
| f270ce6a78 | |||
| 7b45f7d92b | |||
| 9859a06a09 | |||
| 926142afa9 | |||
| 6e5a3b902c | |||
| 08130d1bf3 | |||
| 4009d68a7a | |||
| 2312c95dba | |||
| 7a06bcf403 | |||
| a8baf355c4 | |||
| 9520ce3bb8 | |||
| 120dbe3be2 | |||
| 657e6013de | |||
| c7a26c1ce1 | |||
| bdbabd9886 | |||
| e061537404 | |||
| 4637dab159 | |||
| b885f12ece | |||
| e99881ad65 | |||
| fd3c847fb1 | |||
| 424fe658ba | |||
| 0ff87f3631 | |||
| 3164f21ba9 | |||
| 713cb61efc | |||
| fa342a278b | |||
| d91baf996e | |||
| 2100a3bec7 | |||
| 8d772df3e7 | |||
| 3972e4fb84 | |||
| 86b8449eba | |||
| 601451867d | |||
| 09ffcdce49 | |||
| a49e0d7b2a | |||
| bc1a111775 | |||
| 98c41c3a53 | |||
| 52ebcde1ff | |||
| ded17c34b8 | |||
| 1b79de20a9 | |||
| bba1cbc845 | |||
| 3f956f5661 | |||
| 9036d20898 | |||
| 7c1edcf813 | |||
| fec5a48b4a | |||
| 468b962aaa | |||
| cc66a79fea | |||
| 660ae5bed4 | |||
| 5ffaf95d20 | |||
| ddfb479bc2 | |||
| 13e2729124 | |||
| 05ee59d75e | |||
| c4bb08073b | |||
| b32556fdef | |||
| c57a7e4b96 | |||
| 5846ccc3e8 | |||
| 6ba0208571 | |||
| 759b04e088 | |||
| 4dfa2d9722 | |||
| 590ad7337a | |||
| c607966e83 | |||
| 97f2226288 | |||
| b1f2c391cb | |||
| 7e4d88eea5 | |||
| 9fdd6c5cf9 | |||
| 113af457d9 | |||
| abd67f6c43 | |||
| d3dce5d24e | |||
| c9592d8e78 | |||
| 6bf6251705 | |||
| 520acd4fee | |||
| a6c4fe0688 | |||
| 3c420284e3 | |||
| 66543c14d3 | |||
| d9908e264a | |||
| 9206f716e1 | |||
| 84633e22e5 | |||
| 510d1248ab | |||
| 8e30fa54b3 | |||
| 1aaec7d8ff | |||
| 5efdaf6c05 | |||
| 448e11568b | |||
| dce0fe0994 | |||
| 2dc115327b | |||
| 4715dba7fc | |||
| 5ab1782715 | |||
| 08db79da17 | |||
| c94564cec6 | |||
| ac52a697e5 | |||
| 57b458b79a | |||
| 2a84b38194 | |||
| 9d9b78b4e9 | |||
| 092543db1c | |||
| 2286514c59 | |||
| 6993f30513 | |||
| 0b30cc5a6d | |||
| 7b0c239dd2 | |||
| cf278cf914 | |||
| fdeacc73c5 | |||
| 117bba7765 | |||
| 65a11a19ac | |||
| fae2eab41b | |||
| f91b05287a | |||
| 43fd64a15b | |||
| 15074fb0ae | |||
| 415b5403be | |||
| 84fdb39d20 | |||
| 44b9e991b5 | |||
| 9b647b2540 | |||
| cedf10bdff | |||
| 8422292b46 | |||
| b1f3487a43 | |||
| c8f346e069 | |||
| 0da62a99e3 | |||
| 60c8309067 | |||
| 12f7ab7e30 | |||
| ccff69d48c | |||
| 8ab44feed5 | |||
| 483a22a13c | |||
| a3b1fb1f11 | |||
| 5e69242320 | |||
| a183787db6 | |||
| 13ab870418 | |||
| 8fd324f60e | |||
| 3ebfe2da8a |
@@ -38,7 +38,7 @@ composer check # Run all checks
|
|||||||
| `lib/Enterprise/Plugins/` | 11 platform plugins (Joomla, Dolibarr, Node.js, Python, etc.) |
|
| `lib/Enterprise/Plugins/` | 11 platform plugins (Joomla, Dolibarr, Node.js, Python, etc.) |
|
||||||
| `deploy/` | SFTP deployment scripts (Joomla, Dolibarr, health checks) |
|
| `deploy/` | SFTP deployment scripts (Joomla, Dolibarr, health checks) |
|
||||||
| `templates/` | Universal templates, configs, governance schema |
|
| `templates/` | Universal templates, configs, governance schema |
|
||||||
| `.mokogitea/workflows/` | CI/CD workflows (Gitea Actions) |
|
| `.mokogitea/workflows/` | CI/CD workflows (MokoGitea Actions) |
|
||||||
| `bin/moko` | Unified CLI dispatcher — `php bin/moko <command>` |
|
| `bin/moko` | Unified CLI dispatcher — `php bin/moko <command>` |
|
||||||
| `monitoring/sites.json` | Sites list for mcp_mokomonitor |
|
| `monitoring/sites.json` | Sites list for mcp_mokomonitor |
|
||||||
|
|
||||||
@@ -71,6 +71,6 @@ PHPStan runs with `--memory-limit=512M`. CI enforces PHPCS errors; PHPStan is `c
|
|||||||
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js`
|
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js`
|
||||||
- **Attribution**: `Authored-by: Moko Consulting`
|
- **Attribution**: `Authored-by: Moko Consulting`
|
||||||
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
||||||
- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files
|
- **Wiki**: documentation lives in the MokoGitea wiki, not `docs/` files
|
||||||
- **New CLI tools**: extend `CliFramework`, not `CLIApp` (legacy)
|
- **New CLI tools**: extend `CliFramework`, not `CLIApp` (legacy)
|
||||||
- **Standards**: [MokoCli](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home)
|
- **Standards**: [MokoCli](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home)
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ jobs:
|
|||||||
"rule_name": "main",
|
"rule_name": "main",
|
||||||
"enable_push": true,
|
"enable_push": true,
|
||||||
"enable_push_whitelist": true,
|
"enable_push_whitelist": true,
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
"push_whitelist_usernames": ["jmiller", "moko-deploy"],
|
||||||
|
"push_whitelist_actions_user": true,
|
||||||
"enable_force_push": false,
|
"enable_force_push": false,
|
||||||
"enable_force_push_allowlist": false,
|
"enable_force_push_allowlist": false,
|
||||||
"force_push_allowlist_usernames": [],
|
"force_push_allowlist_usernames": [],
|
||||||
@@ -140,10 +141,12 @@ jobs:
|
|||||||
"rule_name": "dev",
|
"rule_name": "dev",
|
||||||
"enable_push": true,
|
"enable_push": true,
|
||||||
"enable_push_whitelist": true,
|
"enable_push_whitelist": true,
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
"push_whitelist_usernames": ["jmiller", "moko-deploy"],
|
||||||
"enable_force_push": false,
|
"push_whitelist_actions_user": true,
|
||||||
"enable_force_push_allowlist": false,
|
"enable_force_push": true,
|
||||||
"force_push_allowlist_usernames": [],
|
"enable_force_push_allowlist": true,
|
||||||
|
"force_push_allowlist_usernames": ["jmiller", "moko-deploy"],
|
||||||
|
"force_push_allowlist_actions_user": true,
|
||||||
"enable_merge_whitelist": false,
|
"enable_merge_whitelist": false,
|
||||||
"required_approvals": 0,
|
"required_approvals": 0,
|
||||||
"block_on_rejected_reviews": false,
|
"block_on_rejected_reviews": false,
|
||||||
@@ -154,10 +157,12 @@ jobs:
|
|||||||
"rule_name": "rc",
|
"rule_name": "rc",
|
||||||
"enable_push": true,
|
"enable_push": true,
|
||||||
"enable_push_whitelist": true,
|
"enable_push_whitelist": true,
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
"push_whitelist_usernames": ["jmiller", "moko-deploy"],
|
||||||
"enable_force_push": false,
|
"push_whitelist_actions_user": true,
|
||||||
"enable_force_push_allowlist": false,
|
"enable_force_push": true,
|
||||||
"force_push_allowlist_usernames": [],
|
"enable_force_push_allowlist": true,
|
||||||
|
"force_push_allowlist_usernames": ["jmiller", "moko-deploy"],
|
||||||
|
"force_push_allowlist_actions_user": true,
|
||||||
"enable_merge_whitelist": false,
|
"enable_merge_whitelist": false,
|
||||||
"required_approvals": 0,
|
"required_approvals": 0,
|
||||||
"block_on_rejected_reviews": false,
|
"block_on_rejected_reviews": false,
|
||||||
@@ -168,7 +173,8 @@ jobs:
|
|||||||
"rule_name": "beta",
|
"rule_name": "beta",
|
||||||
"enable_push": true,
|
"enable_push": true,
|
||||||
"enable_push_whitelist": true,
|
"enable_push_whitelist": true,
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
"push_whitelist_usernames": ["jmiller", "moko-deploy"],
|
||||||
|
"push_whitelist_actions_user": true,
|
||||||
"enable_force_push": false,
|
"enable_force_push": false,
|
||||||
"enable_force_push_allowlist": false,
|
"enable_force_push_allowlist": false,
|
||||||
"force_push_allowlist_usernames": [],
|
"force_push_allowlist_usernames": [],
|
||||||
@@ -182,7 +188,8 @@ jobs:
|
|||||||
"rule_name": "alpha",
|
"rule_name": "alpha",
|
||||||
"enable_push": true,
|
"enable_push": true,
|
||||||
"enable_push_whitelist": true,
|
"enable_push_whitelist": true,
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
"push_whitelist_usernames": ["jmiller", "moko-deploy"],
|
||||||
|
"push_whitelist_actions_user": true,
|
||||||
"enable_force_push": false,
|
"enable_force_push": false,
|
||||||
"enable_force_push_allowlist": false,
|
"enable_force_push_allowlist": false,
|
||||||
"force_push_allowlist_usernames": [],
|
"force_push_allowlist_usernames": [],
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||||
# VERSION: 09.02.00
|
# VERSION: 09.02.00
|
||||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||||
@@ -22,7 +22,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -34,7 +34,8 @@ jobs:
|
|||||||
if: >-
|
if: >-
|
||||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
!startsWith(github.event.head_commit.message, 'Merge pull request') &&
|
||||||
|
!startsWith(github.event.repository.name, 'Template-')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -52,7 +53,7 @@ jobs:
|
|||||||
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
||||||
else
|
else
|
||||||
git clone --depth 1 --branch main --quiet \
|
git clone --depth 1 --branch main --quiet \
|
||||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/mokocli.git" \
|
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/MokoCLI.git" \
|
||||||
/tmp/mokocli
|
/tmp/mokocli
|
||||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||||
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
# PATH: /.mokogitea/workflows/auto-release.yml
|
||||||
# VERSION: 05.00.00
|
# VERSION: 05.01.00
|
||||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||||
#
|
#
|
||||||
# +=======================================================================+
|
# +=======================================================================+
|
||||||
@@ -27,7 +27,7 @@ name: "Universal: Build & Release"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, closed]
|
types: [opened, synchronize, closed]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
@@ -52,7 +52,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||||
|
|
||||||
@@ -64,9 +64,14 @@ jobs:
|
|||||||
promote-rc:
|
promote-rc:
|
||||||
name: Promote to RC
|
name: Promote to RC
|
||||||
runs-on: release
|
runs-on: release
|
||||||
|
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
||||||
if: >-
|
if: >-
|
||||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
!startsWith(github.event.repository.name, 'Template-') &&
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
(
|
||||||
|
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||||
|
(github.event.action == 'synchronize' && github.event.pull_request.merged != true) ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||||
|
)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -74,6 +79,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup mokocli tools
|
- name: Setup mokocli tools
|
||||||
env:
|
env:
|
||||||
@@ -89,7 +95,7 @@ jobs:
|
|||||||
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
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli
|
cd /tmp/mokocli
|
||||||
composer install --no-dev --no-interaction --quiet
|
composer install --no-dev --no-interaction --quiet
|
||||||
@@ -98,18 +104,46 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename branch to rc
|
- name: Rename branch to rc
|
||||||
run: |
|
run: |
|
||||||
php ${MOKO_CLI}/branch_rename.php \
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
AUTH="Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
FROM="${{ github.event.pull_request.head.ref || 'dev' }}"
|
||||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
PR="${{ github.event.pull_request.number }}"
|
||||||
--pr "${{ github.event.pull_request.number }}"
|
|
||||||
|
# Resolve the source branch HEAD commit.
|
||||||
|
SRC_JSON=$(curl -sf -H "$AUTH" "${API_BASE}/branches/${FROM}") \
|
||||||
|
|| { echo "::error::Source branch ${FROM} not found"; exit 1; }
|
||||||
|
SRC_SHA=$(printf '%s' "$SRC_JSON" | python3 -c "import sys, json; print(json.load(sys.stdin)['commit']['id'])" 2>/dev/null || true)
|
||||||
|
[ -n "$SRC_SHA" ] || { echo "::error::Could not resolve HEAD of ${FROM}"; exit 1; }
|
||||||
|
|
||||||
|
# Point rc at the source commit. If rc already exists (a protected branch that
|
||||||
|
# cannot be deleted), force-update its ref in place instead of delete+recreate:
|
||||||
|
# deleting a protected branch fails, which then makes the recreate return HTTP 409.
|
||||||
|
if curl -sf -o /dev/null -H "$AUTH" "${API_BASE}/branches/rc"; then
|
||||||
|
echo "rc exists - force-updating to ${FROM} (${SRC_SHA})"
|
||||||
|
curl -sf -X PATCH -H "$AUTH" -H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/git/refs/heads/rc" -d "{\"sha\":\"${SRC_SHA}\",\"force\":true}" \
|
||||||
|
|| { echo "::error::Failed to force-update rc (CI token needs force-push on the protected rc branch)"; exit 1; }
|
||||||
|
else
|
||||||
|
echo "Creating rc from ${FROM}"
|
||||||
|
curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/branches" -d "{\"new_branch_name\":\"rc\",\"old_branch_name\":\"${FROM}\"}" \
|
||||||
|
|| { echo "::error::Failed to create rc from ${FROM}"; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Repoint the PR at rc, then delete the old source branch (non-fatal).
|
||||||
|
if [ -n "$PR" ]; then
|
||||||
|
curl -s -X PATCH -H "$AUTH" -H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/pulls/${PR}" -d '{"head":"rc"}' >/dev/null || true
|
||||||
|
fi
|
||||||
|
curl -s -X DELETE -H "$AUTH" "${API_BASE}/branches/${FROM}" >/dev/null || true
|
||||||
|
echo "Renamed ${FROM} -> rc"
|
||||||
|
|
||||||
- name: Checkout rc and configure git
|
- name: Checkout rc and configure git
|
||||||
run: |
|
run: |
|
||||||
git fetch origin rc
|
git fetch origin rc
|
||||||
git checkout rc
|
git checkout rc
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
git config --local user.name "mokogitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
|
||||||
- name: Publish RC release
|
- name: Publish RC release
|
||||||
@@ -120,7 +154,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Update RC release notes from CHANGELOG.md
|
- name: Update RC release notes from CHANGELOG.md
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
|
||||||
# Extract [Unreleased] section from changelog
|
# Extract [Unreleased] section from changelog
|
||||||
@@ -162,9 +196,13 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Build & Release Pipeline
|
name: Build & Release Pipeline
|
||||||
runs-on: release
|
runs-on: release
|
||||||
|
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
||||||
if: >-
|
if: >-
|
||||||
github.event.pull_request.merged == true ||
|
!startsWith(github.event.repository.name, 'Template-') &&
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
(
|
||||||
|
github.event.pull_request.merged == true ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||||
|
)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -172,11 +210,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Configure git for bot pushes
|
- name: Configure git for bot pushes
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
git config --local user.name "mokogitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
|
||||||
- name: Check for merge conflict markers
|
- name: Check for merge conflict markers
|
||||||
@@ -207,7 +246,7 @@ jobs:
|
|||||||
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
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli
|
cd /tmp/mokocli
|
||||||
composer install --no-dev --no-interaction --quiet
|
composer install --no-dev --no-interaction --quiet
|
||||||
@@ -268,7 +307,7 @@ jobs:
|
|||||||
!startsWith(steps.platform.outputs.platform, 'joomla')
|
!startsWith(steps.platform.outputs.platform, 'joomla')
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
SEMVER_TAG="v${VERSION}"
|
SEMVER_TAG="v${VERSION}"
|
||||||
|
|
||||||
@@ -293,7 +332,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Update release notes and promote changelog
|
- name: Update release notes and promote changelog
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
|
||||||
# Get the stable release info (version and ID)
|
# Get the stable release info (version and ID)
|
||||||
@@ -362,7 +401,7 @@ jobs:
|
|||||||
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 }}"
|
||||||
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}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
php ${MOKO_CLI}/release_mirror.php \
|
php ${MOKO_CLI}/release_mirror.php \
|
||||||
--version "$VERSION" --tag "$RELEASE_TAG" \
|
--version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
@@ -387,11 +426,11 @@ jobs:
|
|||||||
&& echo "main branch pushed to GitHub mirror" \
|
&& echo "main branch pushed to GitHub mirror" \
|
||||||
|| echo "WARNING: GitHub mirror push failed"
|
|| echo "WARNING: GitHub mirror push failed"
|
||||||
|
|
||||||
- name: "Step 11: Delete rc branch and recreate dev from main"
|
- name: "Step 11: Delete rc branch (dev reset moved to cascade-dev.yml)"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
|
||||||
# Delete rc branch (ephemeral — created by promote-rc)
|
# Delete rc branch (ephemeral — created by promote-rc)
|
||||||
@@ -399,23 +438,15 @@ jobs:
|
|||||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||||
|
|
||||||
# Delete dev branch
|
# dev is reset from main by the dedicated "Cascade Main -> Dev" workflow
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
# (cascade-dev.yml), which runs after this release completes.
|
||||||
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
echo "rc cleaned; dev reset handled by cascade-dev.yml" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# Recreate dev from main (now includes version bump + changelog promotion)
|
|
||||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API_BASE}/branches" \
|
|
||||||
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
|
||||||
|
|
||||||
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: "Step 12: Create version branch from main"
|
- name: "Step 12: Create version branch from main"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
BRANCH_NAME="version/${VERSION}"
|
BRANCH_NAME="version/${VERSION}"
|
||||||
@@ -436,7 +467,7 @@ jobs:
|
|||||||
if: steps.version.outputs.skip != 'true'
|
if: steps.version.outputs.skip != 'true'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
API_BASE="${MOKOGITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
php ${MOKO_CLI}/version_reset_dev.php \
|
php ${MOKO_CLI}/version_reset_dev.php \
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
||||||
--branch dev --path . 2>&1 || true
|
--branch dev --path . 2>&1 || true
|
||||||
@@ -462,5 +493,5 @@ jobs:
|
|||||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
echo "| Release | [View](${MOKOGITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: MokoStandards.Universal
|
# INGROUP: MokoStandards.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Delete feature branches after PR merge
|
# BRIEF: Delete feature branches after PR merge
|
||||||
@@ -33,7 +33,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
BRANCH="${{ github.event.pull_request.head.ref }}"
|
||||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
||||||
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
# URL-encode the branch name's slashes (no PHP dependency on the runner)
|
||||||
|
ENCODED=$(printf '%s' "${BRANCH}" | sed 's|/|%2F|g')
|
||||||
|
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
||||||
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
|||||||
@@ -1,10 +1,106 @@
|
|||||||
# DISABLED — auto-release Step 11 recreates dev from main after every release.
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
# Cascade-dev is redundant and causes version conflicts when both main and dev
|
#
|
||||||
# have different version numbers in templateDetails.xml / manifest.xml.
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
name: "Cascade Main → Dev (DISABLED)"
|
#
|
||||||
on: workflow_dispatch
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
|
# INGROUP: MokoStandards.Cascade
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
|
# PATH: /.mokogitea/workflows/cascade-dev.yml
|
||||||
|
# VERSION: 02.00.00
|
||||||
|
# BRIEF: Cascade main -> dev via PR; auto-merge only if conflict-free, else notify
|
||||||
|
|
||||||
|
name: "Cascade Main -> Dev"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
# ntfy destination is configured via repo or org variables (org vars are inherited).
|
||||||
|
NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
|
||||||
|
NTFY_TOPIC: ${{ vars.CASCADE_NTFY_TOPIC || vars.NTFY_TOPIC || 'gitea-releases' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
noop:
|
cascade:
|
||||||
|
name: Cascade main -> dev
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: echo "Cascade disabled — auto-release handles dev recreation"
|
- name: Open main -> dev PR (auto-merge if clean, else notify)
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
set -uo pipefail
|
||||||
|
API="${MOKOGITEA_URL}/api/v1/repos/${REPO}"
|
||||||
|
AUTH="Authorization: token ${TOKEN}"
|
||||||
|
jqnum() { python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('$1',''))" 2>/dev/null; }
|
||||||
|
|
||||||
|
# 0. dev must exist
|
||||||
|
if ! curl -sf -H "$AUTH" "${API}/branches/dev" >/dev/null 2>&1; then
|
||||||
|
echo "No dev branch - nothing to cascade."; exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 1. is main ahead of dev?
|
||||||
|
AHEAD=$(curl -sf -H "$AUTH" "${API}/compare/dev...main" \
|
||||||
|
| python3 -c "import sys,json; print(json.load(sys.stdin).get('total_commits',0))" 2>/dev/null || echo 0)
|
||||||
|
if [ "${AHEAD:-0}" -eq 0 ]; then
|
||||||
|
echo "dev already up to date with main."; exit 0
|
||||||
|
fi
|
||||||
|
echo "main is ${AHEAD} commit(s) ahead of dev."
|
||||||
|
|
||||||
|
# 2. reuse an open main->dev PR, else create one
|
||||||
|
PR=$(curl -sf -H "$AUTH" "${API}/pulls?state=open&base=dev" \
|
||||||
|
| python3 -c "import sys,json; d=json.load(sys.stdin); print(next((str(p['number']) for p in d if p.get('head',{}).get('ref')=='main'), ''))" 2>/dev/null || echo "")
|
||||||
|
if [ -z "$PR" ]; then
|
||||||
|
RESP=$(curl -s -H "$AUTH" -H "Content-Type: application/json" -X POST "${API}/pulls" \
|
||||||
|
-d '{"head":"main","base":"dev","title":"chore(sync): cascade main -> dev","body":"Automated cascade of main into dev. Auto-merges only if conflict-free; otherwise left open for manual resolution."}')
|
||||||
|
PR=$(printf '%s' "$RESP" | jqnum number)
|
||||||
|
if [ -z "$PR" ]; then
|
||||||
|
echo "::warning::Could not open cascade PR: $RESP"; exit 0
|
||||||
|
fi
|
||||||
|
echo "Opened cascade PR #${PR}"
|
||||||
|
else
|
||||||
|
echo "Reusing open cascade PR #${PR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. wait for MokoGitea to compute mergeability (conflict detection)
|
||||||
|
MERGEABLE=""
|
||||||
|
for _ in 1 2 3 4 5 6; do
|
||||||
|
MERGEABLE=$(curl -sf -H "$AUTH" "${API}/pulls/${PR}" | jqnum mergeable)
|
||||||
|
case "$MERGEABLE" in True|False) break ;; esac
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
echo "mergeable=${MERGEABLE}"
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
curl -sS \
|
||||||
|
-H "Title: ${REPO}: dev cascade needs manual merge" \
|
||||||
|
-H "Tags: warning,twisted_rightwards_arrows" \
|
||||||
|
-H "Priority: high" \
|
||||||
|
-H "Click: ${MOKOGITEA_URL}/${REPO}/pulls/${PR}" \
|
||||||
|
-d "main -> dev cascade PR #${PR} $1 It was NOT auto-merged; resolve it manually." \
|
||||||
|
"${NTFY_URL}/${NTFY_TOPIC}" || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# 4. auto-merge only if conflict-free; otherwise notify
|
||||||
|
if [ "$MERGEABLE" = "True" ]; then
|
||||||
|
CODE=$(curl -s -o /tmp/merge.json -w "%{http_code}" -H "$AUTH" -H "Content-Type: application/json" \
|
||||||
|
-X POST "${API}/pulls/${PR}/merge" -d '{"Do":"merge","merge_when_checks_succeed":true}')
|
||||||
|
if [ "$CODE" -ge 200 ] && [ "$CODE" -lt 300 ]; then
|
||||||
|
echo "Cascade PR #${PR} merged (or scheduled to merge when checks pass)."
|
||||||
|
else
|
||||||
|
echo "::warning::Auto-merge returned HTTP ${CODE}: $(cat /tmp/merge.json)"
|
||||||
|
notify "could not be auto-merged (HTTP ${CODE})."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "::warning::Cascade PR #${PR} has conflicts (mergeable=${MERGEABLE}); sending notification."
|
||||||
|
notify "has conflicts and cannot be merged automatically."
|
||||||
|
fi
|
||||||
|
|||||||
@@ -3,16 +3,22 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: MokoStandards.CI
|
# INGROUP: MokoStandards.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.gitea/workflows/ci-generic.yml
|
# PATH: /.mokogitea/workflows/ci-generic.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: CI pipeline — lint, validate, and test for generic projects (PHP + Node.js)
|
# BRIEF: CI pipeline — lint, validate, and test for generic projects (PHP + Node.js)
|
||||||
|
|
||||||
name: "Generic: Project CI"
|
name: "Generic: Project CI"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
- dev/**
|
||||||
|
- rc/**
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -26,6 +32,8 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
name: Lint & Validate
|
name: Lint & Validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Skip on template repos (Template-*) — they hold placeholder scaffolding, not buildable source.
|
||||||
|
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -124,6 +132,9 @@ jobs:
|
|||||||
name: Tests
|
name: Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: lint
|
needs: lint
|
||||||
|
# Run only when lint succeeded; always() forces evaluation so a skipped
|
||||||
|
# lint (e.g. template repos) skips this job cleanly instead of hanging.
|
||||||
|
if: ${{ always() && needs.lint.result == 'success' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
|
# INGROUP: mokocli.Universal
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
|
# PATH: /.mokogitea/workflows/ci-issue-reporter.yml
|
||||||
|
# VERSION: 01.00.00
|
||||||
|
# BRIEF: Reusable workflow — creates/updates a MokoGitea issue when a CI gate fails.
|
||||||
|
# Clones MokoCLI and runs cli/ci_issue_reporter.sh.
|
||||||
|
|
||||||
|
name: "Universal: CI Issue Reporter"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
gate:
|
||||||
|
description: "CI gate name (e.g. PR Validation, Repository Health)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
details:
|
||||||
|
description: "Human-readable failure description"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
severity:
|
||||||
|
description: "error or warning"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "error"
|
||||||
|
workflow:
|
||||||
|
description: "Workflow name for the issue title"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
secrets:
|
||||||
|
MOKOGITEA_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
report:
|
||||||
|
name: "Report: ${{ inputs.gate }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone MokoCLI
|
||||||
|
env:
|
||||||
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
MOKOGITEA_URL="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}"
|
||||||
|
git clone --depth 1 --filter=blob:none --sparse "${MOKOGITEA_URL}/MokoConsulting/MokoCLI.git" /tmp/mokocli
|
||||||
|
cd /tmp/mokocli && git sparse-checkout set cli/ci_issue_reporter.sh
|
||||||
|
|
||||||
|
- name: Report CI failure
|
||||||
|
env:
|
||||||
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
run: |
|
||||||
|
chmod +x /tmp/mokocli/cli/ci_issue_reporter.sh
|
||||||
|
/tmp/mokocli/cli/ci_issue_reporter.sh \
|
||||||
|
--gate "${{ inputs.gate }}" \
|
||||||
|
--details "${{ inputs.details }}" \
|
||||||
|
--severity "${{ inputs.severity }}" \
|
||||||
|
--workflow "${{ inputs.workflow }}"
|
||||||
@@ -115,7 +115,7 @@ jobs:
|
|||||||
|
|
||||||
- name: "PHPCS (PSR-12)"
|
- name: "PHPCS (PSR-12)"
|
||||||
run: |
|
run: |
|
||||||
vendor/bin/phpcs --standard=phpcs.xml --report=summary --warning-severity=0 lib/ validate/ automation/ 2>&1 || {
|
vendor/bin/phpcs --standard=phpcs.xml --report=summary --warning-severity=0 lib/ validate/ 2>&1 || {
|
||||||
echo "::error::PHPCS found coding standard violations"
|
echo "::error::PHPCS found coding standard violations"
|
||||||
echo "### PHPCS" >> $GITHUB_STEP_SUMMARY
|
echo "### PHPCS" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Coding standard violations detected. Run \`composer phpcs\` locally." >> $GITHUB_STEP_SUMMARY
|
echo "Coding standard violations detected. Run \`composer phpcs\` locally." >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -453,8 +453,8 @@ jobs:
|
|||||||
needs.governance.result == 'failure' ||
|
needs.governance.result == 'failure' ||
|
||||||
needs.templates.result == 'failure')
|
needs.templates.result == 'failure')
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
run: |
|
run: |
|
||||||
chmod +x automation/ci-issue-reporter.sh
|
chmod +x automation/ci-issue-reporter.sh
|
||||||
REPORTER="./automation/ci-issue-reporter.sh"
|
REPORTER="./automation/ci-issue-reporter.sh"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: MokoStandards.Maintenance
|
# INGROUP: MokoStandards.Maintenance
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||||
# PATH: /.gitea/workflows/cleanup.yml
|
# PATH: /.mokogitea/workflows/cleanup.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cleanup:
|
cleanup:
|
||||||
@@ -33,30 +33,30 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
|
||||||
- name: Delete merged branches
|
- name: Delete merged branches
|
||||||
env:
|
env:
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "=== Merged Branch Cleanup ==="
|
echo "=== Merged Branch Cleanup ==="
|
||||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
API="${MOKOGITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
|
|
||||||
# List branches via API
|
# List branches via API
|
||||||
BRANCHES=$(curl -sS -H "Authorization: token ${GA_TOKEN}" \
|
BRANCHES=$(curl -sS -H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
"${API}/branches?limit=50" | jq -r '.[].name')
|
"${API}/branches?limit=50" | jq -r '.[].name')
|
||||||
|
|
||||||
DELETED=0
|
DELETED=0
|
||||||
for BRANCH in $BRANCHES; do
|
for BRANCH in $BRANCHES; do
|
||||||
# Skip protected branches
|
# Skip protected branches
|
||||||
case "$BRANCH" in
|
case "$BRANCH" in
|
||||||
main|master|develop|release/*|hotfix/*) continue ;;
|
main|master|dev|develop|rc|beta|alpha|release|release/*|production|stable|staging|hotfix/*|version/*) continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if branch is merged into main
|
# Check if branch is merged into main
|
||||||
if git merge-base --is-ancestor "origin/${BRANCH}" origin/main 2>/dev/null; then
|
if git merge-base --is-ancestor "origin/${BRANCH}" origin/main 2>/dev/null; then
|
||||||
echo " Deleting merged branch: ${BRANCH}"
|
echo " Deleting merged branch: ${BRANCH}"
|
||||||
curl -sS -X DELETE -H "Authorization: token ${GA_TOKEN}" \
|
curl -sS -X DELETE -H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
"${API}/branches/${BRANCH}" 2>/dev/null || true
|
"${API}/branches/${BRANCH}" 2>/dev/null || true
|
||||||
DELETED=$((DELETED + 1))
|
DELETED=$((DELETED + 1))
|
||||||
fi
|
fi
|
||||||
@@ -66,20 +66,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Clean old workflow runs
|
- name: Clean old workflow runs
|
||||||
env:
|
env:
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "=== Workflow Run Cleanup ==="
|
echo "=== Workflow Run Cleanup ==="
|
||||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
API="${MOKOGITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
CUTOFF=$(date -d "30 days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -v-30d +%Y-%m-%dT%H:%M:%SZ)
|
CUTOFF=$(date -d "30 days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -v-30d +%Y-%m-%dT%H:%M:%SZ)
|
||||||
|
|
||||||
# Get old completed runs
|
# Get old completed runs
|
||||||
RUNS=$(curl -sS -H "Authorization: token ${GA_TOKEN}" \
|
RUNS=$(curl -sS -H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
"${API}/actions/runs?status=completed&limit=50" | \
|
"${API}/actions/runs?status=completed&limit=50" | \
|
||||||
jq -r ".workflow_runs[] | select(.created_at < \"${CUTOFF}\") | .id" 2>/dev/null)
|
jq -r ".workflow_runs[] | select(.created_at < \"${CUTOFF}\") | .id" 2>/dev/null)
|
||||||
|
|
||||||
DELETED=0
|
DELETED=0
|
||||||
for RUN_ID in $RUNS; do
|
for RUN_ID in $RUNS; do
|
||||||
curl -sS -X DELETE -H "Authorization: token ${GA_TOKEN}" \
|
curl -sS -X DELETE -H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
"${API}/actions/runs/${RUN_ID}" 2>/dev/null || true
|
"${API}/actions/runs/${RUN_ID}" 2>/dev/null || true
|
||||||
DELETED=$((DELETED + 1))
|
DELETED=$((DELETED + 1))
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
@@ -49,18 +49,18 @@ jobs:
|
|||||||
- name: Verify Gitea registry
|
- name: Verify Gitea registry
|
||||||
run: |
|
run: |
|
||||||
echo "Gitea Composer registry auto-publishes from tags."
|
echo "Gitea Composer registry auto-publishes from tags."
|
||||||
echo "Package available at: ${GITEA_URL}/api/packages/MokoConsulting/composer"
|
echo "Package available at: ${MOKOGITEA_URL}/api/packages/MokoConsulting/composer"
|
||||||
echo "Install: composer require mokoconsulting/mokocli"
|
echo "Install: composer require mokoconsulting/mokocli"
|
||||||
|
|
||||||
# Packagist — notify of new version
|
# Packagist — notify of new version (points to GitHub mirror which Packagist can access)
|
||||||
- name: Notify Packagist
|
- name: Notify Packagist
|
||||||
if: secrets.PACKAGIST_TOKEN != ''
|
if: ${{ secrets.PACKAGIST_TOKEN != '' }}
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
echo "Notifying Packagist of version ${VERSION}..."
|
echo "Notifying Packagist of version ${VERSION}..."
|
||||||
curl -sf -X POST \
|
curl -sf -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"repository":{"url":"https://git.mokoconsulting.tech/MokoConsulting/mokocli"}}' \
|
-d '{"repository":{"url":"https://github.com/mokoconsulting-tech/mokocli"}}' \
|
||||||
"https://packagist.org/api/update-package?username=mokoconsulting&apiToken=${{ secrets.PACKAGIST_TOKEN }}" \
|
"https://packagist.org/api/update-package?username=mokoconsulting&apiToken=${{ secrets.PACKAGIST_TOKEN }}" \
|
||||||
&& echo "Packagist notified" \
|
&& echo "Packagist notified" \
|
||||||
|| echo "::warning::Packagist notification failed (package may not be registered yet)"
|
|| echo "::warning::Packagist notification failed (package may not be registered yet)"
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: MokoStandards.Deploy
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
|
||||||
# PATH: /templates/workflows/joomla/deploy-manual.yml.template
|
|
||||||
# VERSION: 04.07.00
|
|
||||||
# BRIEF: Manual SFTP deploy to dev server for Joomla repos
|
|
||||||
|
|
||||||
name: "Universal: Deploy to Dev (Manual)"
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
clear_remote:
|
|
||||||
description: 'Delete all remote files before uploading'
|
|
||||||
required: false
|
|
||||||
default: 'false'
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: SFTP Deploy to Dev
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
||||||
|
|
||||||
- name: Setup PHP
|
|
||||||
run: |
|
|
||||||
php -v && composer --version
|
|
||||||
|
|
||||||
- name: Setup MokoStandards tools
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
|
||||||
MOKO_CLONE_HOST: ${{ secrets.GA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GA_TOKEN || github.token }}"}}'
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 --branch main --quiet \
|
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
|
||||||
/tmp/mokostandards-api 2>/dev/null || true
|
|
||||||
if [ -d "/tmp/mokostandards-api" ] && [ -f "/tmp/mokostandards-api/composer.json" ]; then
|
|
||||||
cd /tmp/mokostandards-api && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check FTP configuration
|
|
||||||
id: check
|
|
||||||
env:
|
|
||||||
HOST: ${{ vars.DEV_FTP_HOST }}
|
|
||||||
PATH_VAR: ${{ vars.DEV_FTP_PATH }}
|
|
||||||
PORT: ${{ vars.DEV_FTP_PORT }}
|
|
||||||
run: |
|
|
||||||
if [ -z "$HOST" ] || [ -z "$PATH_VAR" ]; then
|
|
||||||
echo "DEV_FTP_HOST or DEV_FTP_PATH not configured -- cannot deploy"
|
|
||||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "host=$HOST" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
REMOTE="${PATH_VAR%/}"
|
|
||||||
echo "remote=$REMOTE" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
[ -z "$PORT" ] && PORT="22"
|
|
||||||
echo "port=$PORT" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Deploy via SFTP
|
|
||||||
if: steps.check.outputs.skip != 'true'
|
|
||||||
env:
|
|
||||||
SFTP_KEY: ${{ secrets.DEV_FTP_KEY }}
|
|
||||||
SFTP_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
|
||||||
SFTP_USER: ${{ vars.DEV_FTP_USERNAME }}
|
|
||||||
run: |
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && { echo "No src/ or htdocs/ -- nothing to deploy"; exit 0; }
|
|
||||||
|
|
||||||
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
|
||||||
"${{ steps.check.outputs.host }}" "${{ steps.check.outputs.port }}" "$SFTP_USER" "${{ steps.check.outputs.remote }}" \
|
|
||||||
> /tmp/sftp-config.json
|
|
||||||
|
|
||||||
if [ -n "$SFTP_KEY" ]; then
|
|
||||||
echo "$SFTP_KEY" > /tmp/deploy_key
|
|
||||||
chmod 600 /tmp/deploy_key
|
|
||||||
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
|
||||||
else
|
|
||||||
printf ',"password":"%s"}' "$SFTP_PASS" >> /tmp/sftp-config.json
|
|
||||||
fi
|
|
||||||
|
|
||||||
DEPLOY_ARGS=(--path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json)
|
|
||||||
[ "${{ inputs.clear_remote }}" = "true" ] && DEPLOY_ARGS+=(--clear-remote)
|
|
||||||
|
|
||||||
PLATFORM=$(php /tmp/mokostandards-api/cli/platform_detect.php --path . 2>/dev/null || true)
|
|
||||||
if [ "$PLATFORM" = "waas-component" ] && [ -f "/tmp/mokostandards-api/deploy/deploy-joomla.php" ]; then
|
|
||||||
php /tmp/mokostandards-api/deploy/deploy-joomla.php "${DEPLOY_ARGS[@]}"
|
|
||||||
else
|
|
||||||
php /tmp/mokostandards-api/deploy/deploy-sftp.php "${DEPLOY_ARGS[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
|
||||||
|
|
||||||
- name: Summary
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ "${{ steps.check.outputs.skip }}" = "true" ]; then
|
|
||||||
echo "### Deploy Skipped -- FTP not configured" >> $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
echo "### Manual Dev Deploy Complete" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Host | \`${{ steps.check.outputs.host }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Remote | \`${{ steps.check.outputs.remote }}\` |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "| Clear | ${{ inputs.clear_remote }} |" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: MokoStandards.Security
|
# INGROUP: MokoStandards.Security
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards-API
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
||||||
# PATH: /templates/workflows/gitleaks.yml.template
|
# PATH: /.mokogitea/workflows/gitleaks.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: mokocli.Automation
|
# INGROUP: mokocli.Automation
|
||||||
# VERSION: 09.39.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Auto-create feature branch when an issue is opened
|
# BRIEF: Auto-create feature branch when an issue is opened
|
||||||
|
|
||||||
name: "Universal: Issue Branch"
|
name: "Universal: Issue Branch"
|
||||||
@@ -19,7 +19,7 @@ permissions:
|
|||||||
issues: write
|
issues: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-branch:
|
create-branch:
|
||||||
@@ -28,8 +28,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Create branch and comment
|
- name: Create branch and comment
|
||||||
run: |
|
run: |
|
||||||
TOKEN="${{ secrets.GA_TOKEN }}"
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
API="${MOKOGITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
ISSUE_NUM="${{ github.event.issue.number }}"
|
ISSUE_NUM="${{ github.event.issue.number }}"
|
||||||
ISSUE_TITLE="${{ github.event.issue.title }}"
|
ISSUE_TITLE="${{ github.event.issue.title }}"
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
echo "Created branch: ${BRANCH}"
|
echo "Created branch: ${BRANCH}"
|
||||||
|
|
||||||
# Comment on issue with branch link
|
# Comment on issue with branch link
|
||||||
REPO_URL="${GITEA_URL}/${{ github.repository }}"
|
REPO_URL="${MOKOGITEA_URL}/${{ github.repository }}"
|
||||||
BODY="Branch created: [\`${BRANCH}\`](${REPO_URL}/src/branch/${BRANCH})\n\n\`\`\`bash\ngit fetch origin\ngit checkout ${BRANCH}\n\`\`\`"
|
BODY="Branch created: [\`${BRANCH}\`](${REPO_URL}/src/branch/${BRANCH})\n\n\`\`\`bash\ngit fetch origin\ngit checkout ${BRANCH}\n\`\`\`"
|
||||||
|
|
||||||
curl -sf -X POST \
|
curl -sf -X POST \
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: MokoStandards.Notifications
|
# INGROUP: MokoStandards.Notifications
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||||
# PATH: /.gitea/workflows/notify.yml
|
# PATH: /.mokogitea/workflows/notify.yml
|
||||||
# VERSION: 01.00.00
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ name: "Universal: Notifications"
|
|||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows:
|
workflows:
|
||||||
- "Joomla Build & Release"
|
- "Universal: Build & Release"
|
||||||
- "Joomla Extension CI"
|
- "Joomla: Extension CI"
|
||||||
- "Deploy"
|
- "Generic: Project CI"
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: moko-platform.CI
|
# INGROUP: mokocli.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /templates/workflows/universal/pr-check.yml.template
|
# PATH: /.mokogitea/workflows/pr-check.yml
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: PR gate — branch policy + code validation before merge
|
# BRIEF: PR gate — branch policy + code validation before merge
|
||||||
|
|
||||||
@@ -47,15 +47,15 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
fix/*|bugfix/*)
|
fix/*|bugfix/*)
|
||||||
if [ "$BASE" != "dev" ]; then
|
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Fix branches must target 'dev', not '${BASE}'"
|
REASON="Fix branches must target 'dev' or 'main', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
patch/*)
|
patch/*)
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ]; then
|
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ] && [ "$BASE" != "main" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Patch branches must target 'dev' or 'rc', not '${BASE}'"
|
REASON="Patch branches must target 'dev', 'rc', or 'main', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
hotfix/*)
|
hotfix/*)
|
||||||
@@ -86,7 +86,8 @@ jobs:
|
|||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`fix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- \`patch/*\` → \`dev\`, \`rc\`, or \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -96,6 +97,80 @@ jobs:
|
|||||||
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
||||||
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# ── Docs Update Gate (main PRs) ─────────────────────────────────────────
|
||||||
|
require-docs:
|
||||||
|
name: Require Docs Update
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Enforce only on PRs merging into main: README.md + CHANGELOG.md must both be updated.
|
||||||
|
if: ${{ github.base_ref == 'main' }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Require README.md and CHANGELOG.md in the PR diff
|
||||||
|
run: |
|
||||||
|
BASE="${{ github.event.pull_request.base.sha }}"
|
||||||
|
HEAD="${{ github.event.pull_request.head.sha }}"
|
||||||
|
CHANGED="$(git diff --name-only "$BASE" "$HEAD" 2>/dev/null || true)"
|
||||||
|
if [ -z "$CHANGED" ]; then
|
||||||
|
git fetch -q origin "${{ github.base_ref }}" 2>/dev/null || true
|
||||||
|
CHANGED="$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" 2>/dev/null || true)"
|
||||||
|
fi
|
||||||
|
echo "Changed files in PR:"
|
||||||
|
echo "$CHANGED"
|
||||||
|
MISSING=""
|
||||||
|
echo "$CHANGED" | grep -qxE 'README\.md' || MISSING="README.md"
|
||||||
|
echo "$CHANGED" | grep -qxE 'CHANGELOG\.md' || MISSING="${MISSING:+$MISSING, }CHANGELOG.md"
|
||||||
|
if [ -n "$MISSING" ]; then
|
||||||
|
echo "::error::PRs into main must update: ${MISSING}"
|
||||||
|
{
|
||||||
|
echo "## Docs Update Required"
|
||||||
|
echo ""
|
||||||
|
echo "PRs merging into \`main\` must update both **README.md** and **CHANGELOG.md**."
|
||||||
|
echo ""
|
||||||
|
echo "Not updated in this PR: **${MISSING}**"
|
||||||
|
} >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Docs update present (README.md + CHANGELOG.md)"
|
||||||
|
echo "## Docs Update: Passed" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|
||||||
|
# ── Wiki Update Reminder (main PRs, non-blocking) ───────────────────────
|
||||||
|
wiki-reminder:
|
||||||
|
name: Wiki Update Reminder
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.base_ref == 'main' }}
|
||||||
|
steps:
|
||||||
|
- name: Remind to update the wiki
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
SERVER: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
PR: ${{ github.event.pull_request.number }}
|
||||||
|
run: |
|
||||||
|
set -uo pipefail
|
||||||
|
{
|
||||||
|
echo "## Wiki Update Reminder"
|
||||||
|
echo ""
|
||||||
|
echo "Docs are **wiki-first** at MokoConsulting. If this change affects behavior, usage, configuration, or standards, update the repo wiki:"
|
||||||
|
echo ""
|
||||||
|
echo "- ${SERVER}/${REPO}/wiki"
|
||||||
|
echo ""
|
||||||
|
echo "_Non-blocking reminder._"
|
||||||
|
} >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
# Post a single PR comment (idempotent via hidden marker); best-effort, never fails.
|
||||||
|
API="${SERVER}/api/v1/repos/${REPO}/issues/${PR}/comments"
|
||||||
|
if [ -n "${TOKEN:-}" ] && [ -n "${PR:-}" ]; then
|
||||||
|
existing="$(curl -sf -H "Authorization: token ${TOKEN}" "$API" 2>/dev/null | grep -c 'wiki-reminder' || true)"
|
||||||
|
if [ "${existing:-0}" -eq 0 ]; then
|
||||||
|
curl -sf -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" -X POST "$API" \
|
||||||
|
-d '{"body":"<!-- wiki-reminder -->\n\n**Wiki reminder:** docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. _(non-blocking)_"}' >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Wiki reminder emitted (non-blocking)."
|
||||||
|
|
||||||
# ── Secret Scanning ──────────────────────────────────────────────────
|
# ── Secret Scanning ──────────────────────────────────────────────────
|
||||||
gitleaks:
|
gitleaks:
|
||||||
name: Secret Scan
|
name: Secret Scan
|
||||||
@@ -126,6 +201,8 @@ jobs:
|
|||||||
validate:
|
validate:
|
||||||
name: Validate PR
|
name: Validate PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Skip on template repos (Template-*) — no real manifest/source/changelog to validate.
|
||||||
|
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -147,11 +224,12 @@ jobs:
|
|||||||
- name: Detect platform
|
- name: Detect platform
|
||||||
id: platform
|
id: platform
|
||||||
run: |
|
run: |
|
||||||
# Read platform from XML manifest (<platform> tag) or plain text fallback
|
# Platform comes from the MokoGitea metadata API (public GET); manifest.xml is no longer used.
|
||||||
PLATFORM=$(sed -n 's/.*<platform>\([^<]*\)<\/platform>.*/\1/p' .mokogitea/manifest.xml 2>/dev/null | head -1)
|
API="${GITHUB_SERVER_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${GITHUB_REPOSITORY}/metadata"
|
||||||
[ -z "$PLATFORM" ] && PLATFORM=$(cat .mokogitea/manifest.xml 2>/dev/null | tr -d '[:space:]')
|
PLATFORM="$(curl -sf "$API" 2>/dev/null | python3 -c "import sys, json; print(json.load(sys.stdin).get('platform') or '')" 2>/dev/null || true)"
|
||||||
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
||||||
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Detected platform: $PLATFORM"
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
||||||
@@ -272,7 +350,7 @@ jobs:
|
|||||||
joomla)
|
joomla)
|
||||||
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
||||||
if [ -z "$MANIFEST" ]; then
|
if [ -z "$MANIFEST" ]; then
|
||||||
echo "::warning::No Joomla manifest found (WaaS site)"
|
echo "::warning::No Joomla manifest found (MokoSuite site)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "Manifest: ${MANIFEST}"
|
echo "Manifest: ${MANIFEST}"
|
||||||
@@ -285,7 +363,7 @@ jobs:
|
|||||||
# Block legacy raw/branch update server URLs on MokoGitea
|
# Block legacy raw/branch update server URLs on MokoGitea
|
||||||
RAW_URLS=$(grep -n 'raw/branch' "$MANIFEST" | grep -i 'mokoconsulting\|mokogitea\|git\.mokoconsulting\.tech' || true)
|
RAW_URLS=$(grep -n 'raw/branch' "$MANIFEST" | grep -i 'mokoconsulting\|mokogitea\|git\.mokoconsulting\.tech' || true)
|
||||||
if [ -n "$RAW_URLS" ]; then
|
if [ -n "$RAW_URLS" ]; then
|
||||||
echo "::error::Manifest contains legacy raw/branch update server URL on MokoGitea. Use the Gitea Pages URL instead (e.g. /{REPO}/updates.xml not /{REPO}/raw/branch/main/updates.xml)"
|
echo "::error::Manifest contains legacy raw/branch update server URL on MokoGitea. Use the MokoGitea Pages URL instead (e.g. /{REPO}/updates.xml not /{REPO}/raw/branch/main/updates.xml)"
|
||||||
echo "$RAW_URLS"
|
echo "$RAW_URLS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -492,43 +570,33 @@ jobs:
|
|||||||
name: Build RC Package
|
name: Build RC Package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [branch-policy, validate]
|
needs: [branch-policy, validate]
|
||||||
|
# Run only when both gates succeeded; always() forces evaluation so a skipped
|
||||||
|
# validate (e.g. template repos) skips this job cleanly instead of hanging.
|
||||||
|
if: ${{ always() && needs.branch-policy.result == 'success' && needs.validate.result == 'success' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger RC pre-release
|
- name: Trigger RC pre-release
|
||||||
env:
|
env:
|
||||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
BRANCH: ${{ github.head_ref }}
|
BRANCH: ${{ github.head_ref }}
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
run: |
|
run: |
|
||||||
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
curl -s -X POST "${MOKOGITEA_URL}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${MOKOGITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
||||||
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# ── Issue Reporter ──────────────────────────────────────────────────────
|
# ── Issue Reporter ──────────────────────────────────────────────────────
|
||||||
report-issues:
|
report-issues:
|
||||||
name: Report Issues
|
name: Report Issues
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [branch-policy, validate]
|
needs: [branch-policy, validate]
|
||||||
if: >-
|
if: >-
|
||||||
always() &&
|
always() &&
|
||||||
needs.validate.result == 'failure'
|
needs.validate.result == 'failure'
|
||||||
|
uses: ./.mokogitea/workflows/ci-issue-reporter.yml
|
||||||
steps:
|
with:
|
||||||
- name: Checkout
|
gate: "PR Validation"
|
||||||
uses: actions/checkout@v4
|
workflow: "PR Check"
|
||||||
with:
|
severity: error
|
||||||
sparse-checkout: automation/ci-issue-reporter.sh
|
details: "PR validation failed (syntax, manifest, changelog, or source checks). See the CI run for the specific check that failed."
|
||||||
sparse-checkout-cone-mode: false
|
secrets: inherit
|
||||||
|
|
||||||
- name: "File issue for PR validation failure"
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
run: |
|
|
||||||
chmod +x automation/ci-issue-reporter.sh
|
|
||||||
./automation/ci-issue-reporter.sh \
|
|
||||||
--gate "PR Validation" \
|
|
||||||
--workflow "PR Check" \
|
|
||||||
--severity error \
|
|
||||||
--details "PR validation failed (syntax, manifest, changelog, or source checks). See the CI run for the specific check that failed."
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Release
|
# INGROUP: mokocli.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
# PATH: /.mokogitea/workflows/pre-release.yml
|
||||||
# VERSION: 05.01.00
|
# VERSION: 05.02.00
|
||||||
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
||||||
|
|
||||||
name: "Universal: Pre-Release"
|
name: "Universal: Pre-Release"
|
||||||
@@ -48,9 +48,13 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
||||||
runs-on: release
|
runs-on: release
|
||||||
|
# Skip on template repos (Template-*) — they scaffold other repos and do not release.
|
||||||
if: >-
|
if: >-
|
||||||
github.event_name == 'workflow_dispatch' ||
|
!startsWith(github.event.repository.name, 'Template-') &&
|
||||||
github.event_name == 'push'
|
(
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
github.event_name == 'push'
|
||||||
|
)
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -59,6 +63,11 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
ref: ${{ github.ref_name }}
|
ref: ${{ github.ref_name }}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Update submodules to main
|
||||||
|
run: |
|
||||||
|
git submodule foreach --quiet 'git checkout main && git pull --quiet origin main' 2>/dev/null || true
|
||||||
|
|
||||||
- name: Setup mokocli tools
|
- name: Setup mokocli tools
|
||||||
env:
|
env:
|
||||||
@@ -75,7 +84,7 @@ jobs:
|
|||||||
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
|
||||||
rm -rf /tmp/mokocli
|
rm -rf /tmp/mokocli
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git
|
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoCLI.git
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli
|
||||||
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet
|
||||||
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV
|
||||||
@@ -147,8 +156,8 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Commit version bump
|
# Commit version bump
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
git config --local user.email "mokogitea-actions[bot]@mokoconsulting.tech"
|
||||||
git config --local user.name "gitea-actions[bot]"
|
git config --local user.name "mokogitea-actions[bot]"
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
git add -A
|
git add -A
|
||||||
git diff --cached --quiet || {
|
git diff --cached --quiet || {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Universal
|
# INGROUP: mokocli.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.mokogitea/workflows/rc-revert.yml
|
# PATH: /.mokogitea/workflows/rc-revert.yml
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: Rename rc/ branch back to dev/ when PR is closed without merge
|
# BRIEF: Rename rc/ branch back to dev/ when PR is closed without merge
|
||||||
@@ -25,16 +25,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >-
|
if: >-
|
||||||
github.event.pull_request.merged == false &&
|
github.event.pull_request.merged == false &&
|
||||||
startsWith(github.event.pull_request.head.ref, 'rc/')
|
startsWith(github.event.pull_request.head.ref, 'rc/') &&
|
||||||
|
!startsWith(github.event.repository.name, 'Template-')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Rename branch
|
- name: Rename branch
|
||||||
|
env:
|
||||||
|
BRANCH: ${{ github.event.pull_request.head.ref }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
set -euo pipefail
|
||||||
|
# BRANCH is attacker-controlled (PR head ref). Strict allowlist before ANY use.
|
||||||
|
if ! printf '%s' "$BRANCH" | grep -Eq '^rc/[A-Za-z0-9._/-]+$'; then
|
||||||
|
echo "::error::Refusing unsafe branch name: $BRANCH"; exit 1
|
||||||
|
fi
|
||||||
SUFFIX="${BRANCH#rc/}"
|
SUFFIX="${BRANCH#rc/}"
|
||||||
DEV_BRANCH="dev/${SUFFIX}"
|
DEV_BRANCH="dev/${SUFFIX}"
|
||||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
API="${GITEA_URL}/api/v1/repos/${REPO}/branches"
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
||||||
|
|
||||||
# Create dev/ branch from rc/ branch
|
# Create dev/ branch from rc/ branch
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X POST \
|
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X POST \
|
||||||
@@ -42,25 +51,22 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"new_branch_name\": \"${DEV_BRANCH}\", \"old_branch_name\": \"${BRANCH}\"}" \
|
-d "{\"new_branch_name\": \"${DEV_BRANCH}\", \"old_branch_name\": \"${BRANCH}\"}" \
|
||||||
"${API}" 2>/dev/null || true)
|
"${API}" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ "$STATUS" = "201" ]; then
|
if [ "$STATUS" = "201" ]; then
|
||||||
echo "Created branch: ${DEV_BRANCH}" >> $GITHUB_STEP_SUMMARY
|
echo "Created branch: ${DEV_BRANCH}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
else
|
else
|
||||||
echo "::error::Failed to create ${DEV_BRANCH} from ${BRANCH} (HTTP ${STATUS})"
|
echo "::error::Failed to create ${DEV_BRANCH} from ${BRANCH} (HTTP ${STATUS})"; exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete rc/ branch
|
# Read BRANCH from the environment inside PHP (getenv, no string interpolation -> no PHP injection)
|
||||||
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
ENCODED=$(php -r 'echo rawurlencode(getenv("BRANCH"));')
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
||||||
-H "Authorization: token ${TOKEN}" \
|
-H "Authorization: token ${TOKEN}" \
|
||||||
"${API}/${ENCODED}" 2>/dev/null || true)
|
"${API}/${ENCODED}" 2>/dev/null || true)
|
||||||
|
|
||||||
if [ "$STATUS" = "204" ]; then
|
if [ "$STATUS" = "204" ]; then
|
||||||
echo "Deleted branch: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
echo "Deleted branch: ${BRANCH}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
else
|
else
|
||||||
echo "::warning::Failed to delete ${BRANCH} (HTTP ${STATUS})"
|
echo "::warning::Failed to delete ${BRANCH} (HTTP ${STATUS})"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "### RC Reverted" >> $GITHUB_STEP_SUMMARY
|
echo "### RC Reverted" >> "$GITHUB_STEP_SUMMARY"
|
||||||
echo "${BRANCH} → ${DEV_BRANCH}" >> $GITHUB_STEP_SUMMARY
|
echo "${BRANCH} → ${DEV_BRANCH}" >> "$GITHUB_STEP_SUMMARY"
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Validation
|
# INGROUP: mokocli.Validation
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /templates/workflows/joomla/repo_health.yml.template
|
# PATH: /.mokogitea/workflows/repo-health.yml
|
||||||
# VERSION: 09.23.00
|
# VERSION: 09.23.00
|
||||||
# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts.
|
# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts.
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
- name: Check actor permission (admin only)
|
- name: Check actor permission (admin only)
|
||||||
id: perm
|
id: perm
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }}
|
TOKEN: ${{ secrets.MOKOGITEA_TOKEN || github.token }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
ACTOR: ${{ github.actor }}
|
ACTOR: ${{ github.actor }}
|
||||||
run: |
|
run: |
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
|
|
||||||
# Hardcoded authorized users — always allowed
|
# Hardcoded authorized users — always allowed
|
||||||
case "$ACTOR" in
|
case "$ACTOR" in
|
||||||
jmiller|gitea-actions[bot])
|
jmiller|mokogitea-actions[bot])
|
||||||
ALLOWED=true
|
ALLOWED=true
|
||||||
PERMISSION=admin
|
PERMISSION=admin
|
||||||
METHOD="hardcoded allowlist"
|
METHOD="hardcoded allowlist"
|
||||||
@@ -671,42 +671,30 @@ jobs:
|
|||||||
# ═══════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════
|
||||||
# Issue Reporter — file issues for failed gates
|
# Issue Reporter — file issues for failed gates
|
||||||
# ═══════════════════════════════════════════════════════════════════════
|
# ═══════════════════════════════════════════════════════════════════════
|
||||||
report-issues:
|
report-scripts:
|
||||||
name: "Report Issues"
|
name: "Report: Scripts Governance"
|
||||||
runs-on: ubuntu-latest
|
needs: [access_check, scripts_governance]
|
||||||
needs: [access_check, scripts_governance, repo_health]
|
|
||||||
if: >-
|
if: >-
|
||||||
always() &&
|
always() &&
|
||||||
(needs.scripts_governance.result == 'failure' ||
|
needs.scripts_governance.result == 'failure'
|
||||||
needs.repo_health.result == 'failure')
|
uses: ./.mokogitea/workflows/ci-issue-reporter.yml
|
||||||
|
with:
|
||||||
|
gate: "Scripts Governance"
|
||||||
|
workflow: "Repo Health"
|
||||||
|
severity: error
|
||||||
|
details: "Scripts directory policy violations detected. Review required and allowed directories."
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
steps:
|
report-health:
|
||||||
- name: Checkout
|
name: "Report: Repository Health"
|
||||||
uses: actions/checkout@v4
|
needs: [access_check, repo_health]
|
||||||
with:
|
if: >-
|
||||||
sparse-checkout: automation/ci-issue-reporter.sh
|
always() &&
|
||||||
sparse-checkout-cone-mode: false
|
needs.repo_health.result == 'failure'
|
||||||
|
uses: ./.mokogitea/workflows/ci-issue-reporter.yml
|
||||||
- name: "File issues for failed gates"
|
with:
|
||||||
env:
|
gate: "Repository Health"
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
workflow: "Repo Health"
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
severity: error
|
||||||
run: |
|
details: "Repository health checks failed — missing required artifacts, disallowed files, or content warnings. Check the CI run summary."
|
||||||
chmod +x automation/ci-issue-reporter.sh
|
secrets: inherit
|
||||||
REPORTER="./automation/ci-issue-reporter.sh"
|
|
||||||
WF="Repo Health"
|
|
||||||
|
|
||||||
report_gate() {
|
|
||||||
local gate="$1" result="$2" details="$3"
|
|
||||||
if [ "$result" = "failure" ]; then
|
|
||||||
"$REPORTER" --gate "$gate" --details "$details" --workflow "$WF" --severity error
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
report_gate "Scripts Governance" \
|
|
||||||
"${{ needs.scripts_governance.result }}" \
|
|
||||||
"Scripts directory policy violations detected. Review required and allowed directories."
|
|
||||||
|
|
||||||
report_gate "Repository Health" \
|
|
||||||
"${{ needs.repo_health.result }}" \
|
|
||||||
"Repository health checks failed — missing required artifacts, disallowed files, or content warnings. Check the CI run summary."
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
MOKOGITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
sync:
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
name: Sync Workflows to Repos
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '.mokogitea/workflows/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ startsWith(github.event.repository.name, 'Template-') }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout mokocli
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: MokoConsulting/MokoCLI
|
||||||
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: https://git.mokoconsulting.tech/MokoConsulting/.mokogitea/raw/branch/main/actions/setup-php@v1
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-dev --no-interaction
|
||||||
|
|
||||||
|
- name: Sync workflows to generic repos
|
||||||
|
run: php automation/bulk_sync.php --platform generic --org MokoConsulting --workflows-only --auto-merge --token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
env:
|
||||||
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: MokoGitea.Workflow.Template
|
||||||
|
# INGROUP: MokoStandards.CI
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
|
||||||
|
# PATH: /.mokogitea/workflows/version-set.yml
|
||||||
|
# VERSION: 01.00.00
|
||||||
|
# BRIEF: Set or reset the extension version across all version-bearing files
|
||||||
|
|
||||||
|
name: "Joomla: Set Version"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: "Version number (e.g. 01.00.00)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
branch:
|
||||||
|
description: "Branch to update (default: current)"
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
set-version:
|
||||||
|
name: Set Version to ${{ inputs.version }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ !startsWith(github.event.repository.name, 'Template-') }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Validate version format
|
||||||
|
run: |
|
||||||
|
VERSION="${{ inputs.version }}"
|
||||||
|
if ! echo "$VERSION" | grep -qP '^\d{2}\.\d{2}\.\d{2}$'; then
|
||||||
|
echo "::error::Invalid version format '${VERSION}' — expected XX.YY.ZZ (e.g. 01.00.00)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.MOKOGITEA_TOKEN || github.token }}
|
||||||
|
ref: ${{ inputs.branch || github.ref }}
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Update manifest version
|
||||||
|
run: |
|
||||||
|
MANIFEST=""
|
||||||
|
for XML_FILE in $(find . -maxdepth 3 -name "*.xml" -not -path "./.git/*" -not -path "./vendor/*"); do
|
||||||
|
if grep -q "<extension" "$XML_FILE" 2>/dev/null; then
|
||||||
|
MANIFEST="$XML_FILE"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$MANIFEST" ]; then
|
||||||
|
echo "::warning::No Joomla extension manifest found — skipping manifest update"
|
||||||
|
else
|
||||||
|
OLD_VER=$(grep -oP '<version>\K[^<]+' "$MANIFEST" | head -1)
|
||||||
|
sed -i "s|<version>${OLD_VER}</version>|<version>${VERSION}</version>|" "$MANIFEST"
|
||||||
|
echo "Manifest: ${OLD_VER} → ${VERSION} (${MANIFEST})"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update README.md version
|
||||||
|
run: |
|
||||||
|
if [ -f "README.md" ]; then
|
||||||
|
if grep -qP '^\s*VERSION:\s*\d' README.md; then
|
||||||
|
sed -i -E "s/(VERSION:\s*)[0-9]{2}\.[0-9]{2}\.[0-9]{2}/\1${VERSION}/" README.md
|
||||||
|
echo "README.md version updated to ${VERSION}"
|
||||||
|
else
|
||||||
|
echo "::warning::No VERSION line found in README.md — skipping"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update CHANGELOG.md
|
||||||
|
run: |
|
||||||
|
if [ -f "CHANGELOG.md" ]; then
|
||||||
|
DATE=$(date +%Y-%m-%d)
|
||||||
|
# Check if this version already has an entry
|
||||||
|
if grep -q "^\#\# \[${VERSION}\]" CHANGELOG.md; then
|
||||||
|
echo "CHANGELOG.md already has entry for ${VERSION} — skipping"
|
||||||
|
else
|
||||||
|
# Insert new version entry after [Unreleased] or at the top after header
|
||||||
|
if grep -q '^\#\# \[Unreleased\]' CHANGELOG.md; then
|
||||||
|
sed -i "/^\#\# \[Unreleased\]/a\\\\n## [${VERSION}] --- ${DATE}" CHANGELOG.md
|
||||||
|
else
|
||||||
|
sed -i "/^\# Changelog/a\\\\n## [Unreleased]\n\n## [${VERSION}] --- ${DATE}" CHANGELOG.md
|
||||||
|
fi
|
||||||
|
echo "CHANGELOG.md: added entry for ${VERSION}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "::warning::No CHANGELOG.md found — skipping"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update FILE INFORMATION blocks
|
||||||
|
run: |
|
||||||
|
# Update VERSION in file header blocks (# VERSION: XX.YY.ZZ)
|
||||||
|
find . -maxdepth 1 -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.php" -o -name "*.md" \) \
|
||||||
|
-not -path "./.git/*" -not -path "./vendor/*" -print0 2>/dev/null | \
|
||||||
|
while IFS= read -r -d '' FILE; do
|
||||||
|
if head -20 "$FILE" | grep -qP '^\s*#?\s*VERSION:\s*\d{2}\.\d{2}\.\d{2}'; then
|
||||||
|
sed -i -E "s/(#?\s*VERSION:\s*)[0-9]{2}\.[0-9]{2}\.[0-9]{2}/\1${VERSION}/" "$FILE"
|
||||||
|
echo "Updated FILE INFORMATION VERSION in ${FILE}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Commit and push
|
||||||
|
run: |
|
||||||
|
git config user.name "Moko Consulting [bot]"
|
||||||
|
git config user.email "hello@mokoconsulting.tech"
|
||||||
|
git add -A
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No version changes detected — nothing to commit"
|
||||||
|
else
|
||||||
|
git commit -m "chore: set version to ${VERSION} [skip bump]
|
||||||
|
|
||||||
|
Authored-by: Moko Consulting"
|
||||||
|
git push
|
||||||
|
echo "### Version Set" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Version updated to \`${VERSION}\` on branch \`${GITHUB_REF_NAME}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: MokoGitea.Workflow
|
||||||
# INGROUP: mokocli.Universal
|
# INGROUP: mokocli.Universal
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||||
# PATH: /.mokogitea/workflows/workflow-sync-trigger.yml
|
# PATH: /.mokogitea/workflows/workflow-sync-trigger.yml
|
||||||
# VERSION: 01.01.00
|
# VERSION: 01.01.00
|
||||||
# BRIEF: Trigger workflow sync to live repos when a PR is merged to main
|
# BRIEF: Trigger workflow sync to live repos when a PR is merged to main
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
name: "Universal: Workflow Sync Trigger"
|
name: "Universal: Workflow Sync Trigger"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
branches:
|
branches:
|
||||||
@@ -26,8 +27,10 @@ jobs:
|
|||||||
name: Sync workflows to live repos
|
name: Sync workflows to live repos
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >-
|
if: >-
|
||||||
github.event.pull_request.merged == true &&
|
startsWith(github.event.repository.name, 'Template-') &&
|
||||||
!contains(github.event.pull_request.title, '[skip sync]')
|
(github.event_name == 'workflow_dispatch' ||
|
||||||
|
(github.event.pull_request.merged == true &&
|
||||||
|
!contains(github.event.pull_request.title, '[skip sync]')))
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Determine platform from repo name
|
- name: Determine platform from repo name
|
||||||
@@ -49,8 +52,14 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKOGITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
GITEA_URL="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}"
|
MOKOGITEA_URL="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}"
|
||||||
git clone --depth 1 "${GITEA_URL}/MokoConsulting/mokocli.git" /tmp/mokocli
|
git clone --depth 1 "${MOKOGITEA_URL}/MokoConsulting/MokoCLI.git" /tmp/mokocli
|
||||||
|
|
||||||
|
- name: Install PHP
|
||||||
|
run: |
|
||||||
|
if ! command -v php &> /dev/null; then
|
||||||
|
apt-get update -qq && apt-get install -y -qq php-cli php-json php-curl > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+11
-6
@@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoCli.Root
|
DEFGROUP: MokoCli.Root
|
||||||
INGROUP: MokoCli
|
INGROUP: MokoCli
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /CHANGELOG.md
|
PATH: /CHANGELOG.md
|
||||||
BRIEF: Release changelog
|
BRIEF: Release changelog
|
||||||
-->
|
-->
|
||||||
@@ -12,12 +12,17 @@ BRIEF: Release changelog
|
|||||||
# Changelog
|
# Changelog
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [09.39.00] --- 2026-06-23
|
## [09.43.00] --- 2026-07-05
|
||||||
|
|
||||||
## [09.38.00] --- 2026-06-21
|
## [09.43.00] --- 2026-07-05
|
||||||
|
|
||||||
## [09.38.00] --- 2026-06-21
|
## [09.42.00] --- 2026-07-04
|
||||||
|
|
||||||
## [09.38.00] --- 2026-06-21
|
## [09.42.00] --- 2026-07-04
|
||||||
|
|
||||||
## [09.38.00] --- 2026-06-21
|
### Fixed
|
||||||
|
- branch_rename.php: force-update the target branch ref in place instead of delete+recreate, so `moko repo:rename-branch` works when the target (e.g. `rc`) is a protected branch that cannot be deleted — previously the delete silently failed and the recreate returned HTTP 409
|
||||||
|
|
||||||
|
## [09.42.00] --- 2026-07-04
|
||||||
|
|
||||||
|
## [09.42.00] --- 2026-07-04
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge
|
|||||||
7. **Merging to main** triggers the stable release pipeline:
|
7. **Merging to main** triggers the stable release pipeline:
|
||||||
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
||||||
- Stability suffix stripped (clean version)
|
- Stability suffix stripped (clean version)
|
||||||
- Gitea release created with ZIP/tar.gz packages
|
- MokoGitea release created with ZIP/tar.gz packages
|
||||||
- `updates.xml` updated (Joomla extensions)
|
- `updates.xml` updated (Joomla extensions)
|
||||||
- `dev` branch recreated from `main`
|
- `dev` branch recreated from `main`
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,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
|
||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoPlatform.Root
|
DEFGROUP: MokoCLI.Root
|
||||||
INGROUP: MokoPlatform
|
INGROUP: MokoCLI
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /PLUGIN_SCRIPTS.md
|
PATH: /PLUGIN_SCRIPTS.md
|
||||||
BRIEF: Plugin system CLI documentation
|
BRIEF: Plugin system CLI documentation
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
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
|
||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoPlatform.Root
|
DEFGROUP: MokoCLI.Root
|
||||||
INGROUP: MokoPlatform
|
INGROUP: MokoCLI
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /README.md
|
PATH: /README.md
|
||||||
VERSION: 09.39.00
|
VERSION: 09.43.00
|
||||||
BRIEF: Project overview and documentation
|
BRIEF: Project overview and documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ BRIEF: Project overview and documentation
|
|||||||
|
|
||||||
PHP implementation of mokocli — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
|
PHP implementation of mokocli — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
|
||||||
|
|
||||||
> **Primary platform**: [Gitea — git.mokoconsulting.tech](https://git.mokoconsulting.tech/MokoConsulting/MokoCli-API)
|
> **Primary platform**: [MokoGitea — git.mokoconsulting.tech](https://git.mokoconsulting.tech/MokoConsulting/MokoCli-API)
|
||||||
> **Backup mirror**: [GitHub](https://github.com/MokoConsulting/MokoCli-API) *(read-only mirror)*
|
> **Backup mirror**: [GitHub](https://github.com/MokoConsulting/MokoCli-API) *(read-only mirror)*
|
||||||
|
|
||||||
## What Lives Here
|
## What Lives Here
|
||||||
@@ -25,7 +25,7 @@ PHP implementation of mokocli — enterprise standards, automation framework, wo
|
|||||||
|-----------|---------|
|
|-----------|---------|
|
||||||
| `lib/Enterprise/` | 38 PHP enterprise library classes (platform adapters, sync, validation, plugins) |
|
| `lib/Enterprise/` | 38 PHP enterprise library classes (platform adapters, sync, validation, plugins) |
|
||||||
| `cli/` | CLI scripts (archive, create, release, sync rulesets, version management) |
|
| `cli/` | CLI scripts (archive, create, release, sync rulesets, version management) |
|
||||||
| `automation/` | Bulk sync, push files, repo cleanup, Gitea migration |
|
| `automation/` | Bulk sync, push files, repo cleanup, MokoGitea migration |
|
||||||
| `validate/` | 18 validation scripts (health, structure, secrets, syntax, drift) |
|
| `validate/` | 18 validation scripts (health, structure, secrets, syntax, drift) |
|
||||||
| `templates/` | **Workflow templates** and config templates synced to governed repos |
|
| `templates/` | **Workflow templates** and config templates synced to governed repos |
|
||||||
| `definitions/` | Repository structure definitions (`.tf` format) |
|
| `definitions/` | Repository structure definitions (`.tf` format) |
|
||||||
@@ -42,7 +42,7 @@ composer require mokoconsulting-tech/enterprise
|
|||||||
|
|
||||||
### Composer Registry
|
### Composer Registry
|
||||||
|
|
||||||
This package is served from Gitea package registry. Add this to your `composer.json`:
|
This package is served from MokoGitea package registry. Add this to your `composer.json`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -73,10 +73,10 @@ vendor/bin/moko inventory -- --path .
|
|||||||
| Variable | Purpose |
|
| Variable | Purpose |
|
||||||
|----------|---------|
|
|----------|---------|
|
||||||
| `GIT_PLATFORM` | `gitea` (default) or `github` |
|
| `GIT_PLATFORM` | `gitea` (default) or `github` |
|
||||||
| `GA_TOKEN` | Gitea API / Gitea Actions token |
|
| `GA_TOKEN` | MokoGitea API / MokoGitea Actions token |
|
||||||
| `GH_TOKEN` | GitHub API token (for mirror sync) |
|
| `GH_TOKEN` | GitHub API token (for mirror sync) |
|
||||||
| `GITEA_URL` | Gitea instance URL (default: `https://git.mokoconsulting.tech`) |
|
| `GITEA_URL` | MokoGitea instance URL (default: `https://git.mokoconsulting.tech`) |
|
||||||
| `GITEA_ORG` | Gitea organization (default: `MokoConsulting`) |
|
| `GITEA_ORG` | MokoGitea organization (default: `MokoConsulting`) |
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,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
|
||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoPlatform.Index
|
DEFGROUP: MokoCLI.Index
|
||||||
INGROUP: MokoPlatform.Analysis
|
INGROUP: MokoCLI.Analysis
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /analysis/index.md
|
PATH: /analysis/index.md
|
||||||
BRIEF: Analysis directory index
|
BRIEF: Analysis directory index
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.CLI
|
* DEFGROUP: MokoCLI.Enterprise.CLI
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/audit_query.php
|
* PATH: /cli/audit_query.php
|
||||||
* BRIEF: Search, filter, and export audit logs
|
* BRIEF: Search, filter, and export audit logs
|
||||||
|
|||||||
+37
-17
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/branch_rename.php
|
* PATH: /cli/branch_rename.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
|
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -64,26 +64,46 @@ class BranchRenameCli extends CliFramework
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: Delete target branch if it already exists
|
// Step 2: Point the target branch at the source commit.
|
||||||
|
// If the target already exists (e.g. a protected `rc` branch that cannot be
|
||||||
|
// deleted), force-update its ref in place instead of delete+recreate: deleting a
|
||||||
|
// protected branch fails, which then makes the recreate return HTTP 409.
|
||||||
|
$sourceSha = '';
|
||||||
|
if (isset($check['body']['commit']['id']) && is_string($check['body']['commit']['id'])) {
|
||||||
|
$sourceSha = $check['body']['commit']['id'];
|
||||||
|
}
|
||||||
$targetCheck = $this->apiRequest('GET', "{$apiBase}/branches/{$to}", $headers);
|
$targetCheck = $this->apiRequest('GET', "{$apiBase}/branches/{$to}", $headers);
|
||||||
if ($targetCheck['code'] === 200) {
|
if ($targetCheck['code'] === 200) {
|
||||||
echo "Target branch '{$to}' already exists — deleting\n";
|
echo "Target branch '{$to}' already exists - force-updating to {$from}
|
||||||
|
";
|
||||||
if (!$this->dryRun) {
|
if (!$this->dryRun) {
|
||||||
$this->apiRequest('DELETE', "{$apiBase}/branches/{$to}", $headers);
|
if ($sourceSha === '') {
|
||||||
|
$this->log('ERROR', "Cannot resolve HEAD commit of source '{$from}'");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
$ref = $this->apiRequest('PATCH', "{$apiBase}/git/refs/heads/{$to}", $headers, [
|
||||||
|
'sha' => $sourceSha,
|
||||||
|
'force' => true,
|
||||||
|
]);
|
||||||
|
if ($ref['code'] < 200 || $ref['code'] >= 300) {
|
||||||
|
$this->log('ERROR', "Failed to force-update '{$to}': HTTP {$ref['code']} (needs force-push perm)");
|
||||||
|
$this->log('ERROR', json_encode($ref['body']));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
echo "Creating branch: {$to} (from {$from})
|
||||||
// Step 3: Create new branch from source
|
";
|
||||||
echo "Creating branch: {$to} (from {$from})\n";
|
if (!$this->dryRun) {
|
||||||
if (!$this->dryRun) {
|
$create = $this->apiRequest('POST', "{$apiBase}/branches", $headers, [
|
||||||
$create = $this->apiRequest('POST', "{$apiBase}/branches", $headers, [
|
'new_branch_name' => $to,
|
||||||
'new_branch_name' => $to,
|
'old_branch_name' => $from,
|
||||||
'old_branch_name' => $from,
|
]);
|
||||||
]);
|
if ($create['code'] < 200 || $create['code'] >= 300) {
|
||||||
if ($create['code'] < 200 || $create['code'] >= 300) {
|
$this->log('ERROR', "Failed to create branch '{$to}': HTTP {$create['code']}");
|
||||||
$this->log('ERROR', "Failed to create branch '{$to}': HTTP {$create['code']}");
|
$this->log('ERROR', json_encode($create['body']));
|
||||||
$this->log('ERROR', json_encode($create['body']));
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/bulk_workflow_push.php
|
* PATH: /cli/bulk_workflow_push.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
|
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/bulk_workflow_trigger.php
|
* PATH: /cli/bulk_workflow_trigger.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Trigger a workflow across multiple repos at once
|
* BRIEF: Trigger a workflow across multiple repos at once
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,230 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# ============================================================================
|
||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Automation.CI
|
||||||
|
# INGROUP: mokocli.CLI
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoCLI
|
||||||
|
# PATH: /cli/ci_issue_reporter.sh
|
||||||
|
# VERSION: 10.00.00
|
||||||
|
# BRIEF: Creates or updates a Gitea issue when a CI gate fails.
|
||||||
|
# Deduplicates by searching open issues with the "ci-auto" label
|
||||||
|
# whose title matches the gate. If a matching issue exists, a comment
|
||||||
|
# is appended instead of opening a duplicate.
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ── Defaults ────────────────────────────────────────────────────────────────
|
||||||
|
MOKOGITEA_URL="${MOKOGITEA_URL:-https://git.mokoconsulting.tech}"
|
||||||
|
MOKOGITEA_TOKEN="${MOKOGITEA_TOKEN:-}"
|
||||||
|
REPO="${GITHUB_REPOSITORY:-}"
|
||||||
|
RUN_URL="${GITHUB_SERVER_URL:-${MOKOGITEA_URL}}/${REPO}/actions/runs/${GITHUB_RUN_ID:-0}"
|
||||||
|
LABEL_NAME="ci-auto"
|
||||||
|
LABEL_COLOR="#e11d48"
|
||||||
|
|
||||||
|
GATE=""
|
||||||
|
DETAILS=""
|
||||||
|
SEVERITY="error"
|
||||||
|
WORKFLOW=""
|
||||||
|
|
||||||
|
# ── Parse arguments ─────────────────────────────────────────────────────────
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: ci_issue_reporter.sh --gate NAME --details TEXT [OPTIONS]
|
||||||
|
|
||||||
|
Required:
|
||||||
|
--gate CI gate name (e.g. "Code Quality", "Self-Health")
|
||||||
|
--details Human-readable failure description
|
||||||
|
|
||||||
|
Optional:
|
||||||
|
--severity "error" (default) or "warning"
|
||||||
|
--workflow Workflow name for the issue title
|
||||||
|
--repo owner/repo (default: \$GITHUB_REPOSITORY)
|
||||||
|
--run-url URL to the CI run (auto-detected from env)
|
||||||
|
--token Gitea API token (default: \$MOKOGITEA_TOKEN)
|
||||||
|
--url Gitea base URL (default: \$MOKOGITEA_URL)
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--gate) GATE="$2"; shift 2 ;;
|
||||||
|
--details) DETAILS="$2"; shift 2 ;;
|
||||||
|
--severity) SEVERITY="$2"; shift 2 ;;
|
||||||
|
--workflow) WORKFLOW="$2"; shift 2 ;;
|
||||||
|
--repo) REPO="$2"; shift 2 ;;
|
||||||
|
--run-url) RUN_URL="$2"; shift 2 ;;
|
||||||
|
--token) MOKOGITEA_TOKEN="$2"; shift 2 ;;
|
||||||
|
--url) MOKOGITEA_URL="$2"; shift 2 ;;
|
||||||
|
-h|--help) usage ;;
|
||||||
|
*) echo "Unknown option: $1"; usage ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ -z "$GATE" ]] && { echo "ERROR: --gate is required"; usage; }
|
||||||
|
[[ -z "$DETAILS" ]] && { echo "ERROR: --details is required"; usage; }
|
||||||
|
[[ -z "$MOKOGITEA_TOKEN" ]] && { echo "ERROR: MOKOGITEA_TOKEN not set"; exit 1; }
|
||||||
|
[[ -z "$REPO" ]] && { echo "ERROR: GITHUB_REPOSITORY not set"; exit 1; }
|
||||||
|
|
||||||
|
API="${MOKOGITEA_URL}/api/v1/repos/${REPO}"
|
||||||
|
|
||||||
|
# ── Build title ─────────────────────────────────────────────────────────────
|
||||||
|
if [[ -n "$WORKFLOW" ]]; then
|
||||||
|
TITLE="[CI] ${WORKFLOW}: ${GATE} failed"
|
||||||
|
else
|
||||||
|
TITLE="[CI] ${GATE} failed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ── Ensure label exists ─────────────────────────────────────────────────────
|
||||||
|
ensure_label() {
|
||||||
|
local exists
|
||||||
|
exists=$(curl -sf -o /dev/null -w '%{http_code}' \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
"${API}/labels" 2>/dev/null || echo "000")
|
||||||
|
|
||||||
|
if [[ "$exists" == "200" ]]; then
|
||||||
|
local found
|
||||||
|
found=$(curl -sf \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
"${API}/labels" 2>/dev/null \
|
||||||
|
| grep -o "\"name\":\"${LABEL_NAME}\"" || true)
|
||||||
|
|
||||||
|
if [[ -z "$found" ]]; then
|
||||||
|
curl -sf -X POST \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/labels" \
|
||||||
|
-d "{\"name\":\"${LABEL_NAME}\",\"color\":\"${LABEL_COLOR}\",\"description\":\"Auto-created by CI issue reporter\"}" \
|
||||||
|
> /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Search for existing open issue ──────────────────────────────────────────
|
||||||
|
find_existing_issue() {
|
||||||
|
local query
|
||||||
|
query=$(printf '%s' "[CI] ${GATE}" | sed 's/ /%20/g; s/\[/%5B/g; s/\]/%5D/g')
|
||||||
|
|
||||||
|
local response
|
||||||
|
response=$(curl -sf \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
"${API}/issues?type=issues&state=open&labels=${LABEL_NAME}&q=${query}&limit=5" \
|
||||||
|
2>/dev/null || echo "[]")
|
||||||
|
|
||||||
|
echo "$response" \
|
||||||
|
| grep -oP '"number":\s*\K[0-9]+' \
|
||||||
|
| head -1
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Build issue body ────────────────────────────────────────────────────────
|
||||||
|
build_body() {
|
||||||
|
local severity_badge
|
||||||
|
if [[ "$SEVERITY" == "error" ]]; then
|
||||||
|
severity_badge="**Severity:** Error"
|
||||||
|
else
|
||||||
|
severity_badge="**Severity:** Warning"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<BODY
|
||||||
|
## CI Gate Failure: ${GATE}
|
||||||
|
|
||||||
|
${severity_badge}
|
||||||
|
**Workflow:** ${WORKFLOW:-unknown}
|
||||||
|
**Branch:** ${GITHUB_REF_NAME:-unknown}
|
||||||
|
**Commit:** \`${GITHUB_SHA:0:8}\`
|
||||||
|
**Run:** [View CI run](${RUN_URL})
|
||||||
|
|
||||||
|
### Details
|
||||||
|
|
||||||
|
${DETAILS}
|
||||||
|
|
||||||
|
### Resolution
|
||||||
|
|
||||||
|
Fix the issue described above and push a new commit. This issue will be closed automatically when the gate passes, or can be closed manually.
|
||||||
|
|
||||||
|
---
|
||||||
|
*Auto-created by [ci-issue-reporter](${MOKOGITEA_URL}/MokoConsulting/MokoCLI/src/branch/main/cli/ci_issue_reporter.sh)*
|
||||||
|
BODY
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Build comment body (for existing issues) ────────────────────────────────
|
||||||
|
build_comment() {
|
||||||
|
cat <<COMMENT
|
||||||
|
### CI failure recurrence
|
||||||
|
|
||||||
|
**Branch:** ${GITHUB_REF_NAME:-unknown}
|
||||||
|
**Commit:** \`${GITHUB_SHA:0:8}\`
|
||||||
|
**Run:** [View CI run](${RUN_URL})
|
||||||
|
|
||||||
|
${DETAILS}
|
||||||
|
COMMENT
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Main ────────────────────────────────────────────────────────────────────
|
||||||
|
ensure_label
|
||||||
|
|
||||||
|
EXISTING=$(find_existing_issue)
|
||||||
|
|
||||||
|
if [[ -n "$EXISTING" ]]; then
|
||||||
|
COMMENT_BODY=$(build_comment)
|
||||||
|
COMMENT_JSON=$(printf '%s' "$COMMENT_BODY" | python3 -c "
|
||||||
|
import sys, json
|
||||||
|
print(json.dumps({'body': sys.stdin.read()}))" 2>/dev/null)
|
||||||
|
|
||||||
|
HTTP=$(curl -sf -o /dev/null -w '%{http_code}' -X POST \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/issues/${EXISTING}/comments" \
|
||||||
|
-d "${COMMENT_JSON}" 2>/dev/null || echo "000")
|
||||||
|
|
||||||
|
if [[ "$HTTP" == "201" ]]; then
|
||||||
|
echo "Commented on existing issue #${EXISTING}"
|
||||||
|
else
|
||||||
|
echo "WARNING: Failed to comment on issue #${EXISTING} (HTTP ${HTTP})"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ISSUE_BODY=$(build_body)
|
||||||
|
ISSUE_JSON=$(python3 -c "
|
||||||
|
import sys, json
|
||||||
|
body = sys.stdin.read()
|
||||||
|
print(json.dumps({
|
||||||
|
'title': sys.argv[1],
|
||||||
|
'body': body,
|
||||||
|
'labels': []
|
||||||
|
}))" "$TITLE" <<< "$ISSUE_BODY" 2>/dev/null)
|
||||||
|
|
||||||
|
RESPONSE=$(curl -sf -X POST \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/issues" \
|
||||||
|
-d "${ISSUE_JSON}" 2>/dev/null || echo "{}")
|
||||||
|
|
||||||
|
ISSUE_NUM=$(echo "$RESPONSE" | grep -oP '"number":\s*\K[0-9]+' | head -1)
|
||||||
|
|
||||||
|
if [[ -n "$ISSUE_NUM" ]]; then
|
||||||
|
LABEL_ID=$(curl -sf \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
"${API}/labels" 2>/dev/null \
|
||||||
|
| grep -oP "\"id\":\s*\K[0-9]+(?=[^}]*\"name\":\s*\"${LABEL_NAME}\")" \
|
||||||
|
| head -1 || true)
|
||||||
|
|
||||||
|
if [[ -n "$LABEL_ID" ]]; then
|
||||||
|
curl -sf -X POST \
|
||||||
|
-H "Authorization: token ${MOKOGITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API}/issues/${ISSUE_NUM}/labels" \
|
||||||
|
-d "{\"labels\":[${LABEL_ID}]}" \
|
||||||
|
> /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Created issue #${ISSUE_NUM}: ${TITLE}"
|
||||||
|
else
|
||||||
|
echo "WARNING: Failed to create issue"
|
||||||
|
echo "Response: ${RESPONSE}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/client_dashboard.php
|
* PATH: /cli/client_dashboard.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Generate unified client dashboard HTML
|
* BRIEF: Generate unified client dashboard HTML
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/client_inventory.php
|
* PATH: /cli/client_inventory.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Discover and list all client-waas repos with their server configuration status
|
* BRIEF: Discover and list all client-waas repos with their server configuration status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/client_provision.php
|
* PATH: /cli/client_provision.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Provision a new client environment end-to-end
|
* BRIEF: Provision a new client environment end-to-end
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class ClientProvisionCli extends CliFramework
|
|||||||
'variables' => 'setVariables',
|
'variables' => 'setVariables',
|
||||||
'secrets' => 'setSecrets',
|
'secrets' => 'setSecrets',
|
||||||
'monitoring' => 'setupMonitoring',
|
'monitoring' => 'setupMonitoring',
|
||||||
'summary' => 'printSummary',
|
'summary' => 'printProvisioningSummary',
|
||||||
];
|
];
|
||||||
|
|
||||||
$exitCode = 0;
|
$exitCode = 0;
|
||||||
@@ -383,7 +383,7 @@ class ClientProvisionCli extends CliFramework
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function printSummary(): int
|
private function printProvisioningSummary(): int
|
||||||
{
|
{
|
||||||
$vars = $this->config['variables'] ?? [];
|
$vars = $this->config['variables'] ?? [];
|
||||||
$secrets = $this->config['secrets'] ?? [];
|
$secrets = $this->config['secrets'] ?? [];
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ class CreateProjectCli extends CliFramework
|
|||||||
|
|
||||||
$repoRoot = dirname(__DIR__, 2);
|
$repoRoot = dirname(__DIR__, 2);
|
||||||
$templatesDir = "{$repoRoot}/templates/projects";
|
$templatesDir = "{$repoRoot}/templates/projects";
|
||||||
|
if (!is_dir($templatesDir)) {
|
||||||
|
$this->log('ERROR', "Project templates directory not found: {$templatesDir}");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
$repos = [];
|
$repos = [];
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.CLI
|
* DEFGROUP: MokoCLI.CLI
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/deploy_joomla.php
|
* PATH: /cli/deploy_joomla.php
|
||||||
* BRIEF: Smart Joomla deploy — routes files to correct server directories by extension type
|
* BRIEF: Smart Joomla deploy — routes files to correct server directories by extension type
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/grafana_dashboard.php
|
* PATH: /cli/grafana_dashboard.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Manage Grafana dashboards via API
|
* BRIEF: Manage Grafana dashboards via API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/joomla_build.php
|
* PATH: /cli/joomla_build.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
|
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
|
||||||
* NOTE: Called by pre-release and auto-release workflows.
|
* NOTE: Called by pre-release and auto-release workflows.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/joomla_metadata_validate.php
|
* PATH: /cli/joomla_metadata_validate.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML
|
* BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/manifest_detect.php
|
* PATH: /cli/manifest_detect.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Auto-detect manifest fields from source files and optionally push to API
|
* BRIEF: Auto-detect manifest fields from source files and optionally push to API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/manifest_integrity.php
|
* PATH: /cli/manifest_integrity.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Cross-check manifest API fields against repo contents across the org
|
* BRIEF: Cross-check manifest API fields against repo contents across the org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/manifest_licensing.php
|
* PATH: /cli/manifest_licensing.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests
|
* BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/manifest_read.php
|
* PATH: /cli/manifest_read.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Read repo metadata from Gitea manifest API, auto-detect the rest
|
* BRIEF: Read repo metadata from Gitea manifest API, auto-detect the rest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/platform_detect.php
|
* PATH: /cli/platform_detect.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Auto-detect repository platform type and optionally update manifest
|
* BRIEF: Auto-detect repository platform type and optionally update manifest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
+1
-14
@@ -40,7 +40,6 @@ class ReleaseCli extends CliFramework
|
|||||||
$bulkSyncFile = file_exists("{$repoRoot}/.mokogitea/workflows/bulk-repo-sync.yml")
|
$bulkSyncFile = file_exists("{$repoRoot}/.mokogitea/workflows/bulk-repo-sync.yml")
|
||||||
? "{$repoRoot}/.mokogitea/workflows/bulk-repo-sync.yml"
|
? "{$repoRoot}/.mokogitea/workflows/bulk-repo-sync.yml"
|
||||||
: "{$repoRoot}/.github/workflows/bulk-repo-sync.yml";
|
: "{$repoRoot}/.github/workflows/bulk-repo-sync.yml";
|
||||||
$cleanupFile = "{$repoRoot}/templates/workflows/shared/repository-cleanup.yml.template";
|
|
||||||
|
|
||||||
// -- Step 1: Read current version --
|
// -- Step 1: Read current version --
|
||||||
$readme = "{$repoRoot}/README.md";
|
$readme = "{$repoRoot}/README.md";
|
||||||
@@ -131,19 +130,7 @@ class ReleaseCli extends CliFramework
|
|||||||
file_put_contents($bulkSyncFile, $bulkContent);
|
file_put_contents($bulkSyncFile, $bulkContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- Step 5: Update repository-cleanup.yml current branch --
|
// -- Step 5: Commit changes --
|
||||||
echo "Updating repository-cleanup.yml -> chore/sync-mokostandards-v{$minorVersion}\n";
|
|
||||||
if (!$this->dryRun) {
|
|
||||||
$cleanupContent = file_get_contents($cleanupFile);
|
|
||||||
$cleanupContent = preg_replace(
|
|
||||||
'/CURRENT="chore\/sync-mokostandards-v[^"]*"/',
|
|
||||||
"CURRENT=\"chore/sync-mokostandards-v{$minorVersion}\"",
|
|
||||||
$cleanupContent
|
|
||||||
);
|
|
||||||
file_put_contents($cleanupFile, $cleanupContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- Step 6: Commit changes --
|
|
||||||
if (!$this->dryRun) {
|
if (!$this->dryRun) {
|
||||||
echo "Committing...\n";
|
echo "Committing...\n";
|
||||||
passthru("cd {$repoRoot} && git add -A && git commit -m \"chore(release): prepare {$currentVersion} release [skip ci]\"");
|
passthru("cd {$repoRoot} && git add -A && git commit -m \"chore(release): prepare {$currentVersion} release [skip ci]\"");
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/release_cascade.php
|
* PATH: /cli/release_cascade.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Cascade release zip to all lower stability channels
|
* BRIEF: Cascade release zip to all lower stability channels
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
+79
-1
@@ -270,12 +270,90 @@ class ReleasePackageCli extends CliFramework
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if sub-source is itself a Joomla package (nested package)
|
||||||
|
$nestedPkgManifests = glob("{$subSourceDir}/pkg_*.xml") ?: [];
|
||||||
|
$isNestedPackage = !empty($nestedPkgManifests) && is_dir("{$subSourceDir}/packages");
|
||||||
|
|
||||||
$subZip = new \ZipArchive();
|
$subZip = new \ZipArchive();
|
||||||
if ($subZip->open($subZipPath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) !== true) {
|
if ($subZip->open($subZipPath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) !== true) {
|
||||||
$this->log('ERROR', "Failed to create sub-package ZIP: {$subZipPath}");
|
$this->log('ERROR', "Failed to create sub-package ZIP: {$subZipPath}");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$this->addDirToZip($subZip, $subSourceDir, '', $this->excludePatterns);
|
|
||||||
|
if ($isNestedPackage) {
|
||||||
|
// Build nested package: zip each sub-extension, then assemble
|
||||||
|
echo " Building nested package: {$subName}\n";
|
||||||
|
$nestedPkgDirs = glob("{$subSourceDir}/packages/*", GLOB_ONLYDIR) ?: [];
|
||||||
|
|
||||||
|
$nestedManifested = [];
|
||||||
|
foreach ($nestedPkgManifests as $npmf) {
|
||||||
|
$npmXml = @simplexml_load_file($npmf);
|
||||||
|
if ($npmXml && isset($npmXml->files)) {
|
||||||
|
foreach ($npmXml->files->file as $fn) {
|
||||||
|
$nzn = pathinfo((string) $fn, PATHINFO_FILENAME);
|
||||||
|
if (!empty($nzn)) {
|
||||||
|
$nestedManifested[$nzn] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use a subdirectory to avoid filename collisions with outer ZIPs
|
||||||
|
$nestedOutputDir = "{$outputDir}/nested_{$subName}";
|
||||||
|
@mkdir($nestedOutputDir, 0755, true);
|
||||||
|
|
||||||
|
foreach ($nestedPkgDirs as $npd) {
|
||||||
|
$nestedSubName = basename($npd);
|
||||||
|
if (!empty($nestedManifested) && !isset($nestedManifested[$nestedSubName])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$nestedSubZipPath = "{$nestedOutputDir}/{$nestedSubName}.zip";
|
||||||
|
$nsZip = new \ZipArchive();
|
||||||
|
if ($nsZip->open($nestedSubZipPath, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) !== true) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$this->addDirToZip($nsZip, $npd, '', $this->excludePatterns);
|
||||||
|
$nsZip->close();
|
||||||
|
$subZip->addFile($nestedSubZipPath, "packages/{$nestedSubName}.zip");
|
||||||
|
echo " Nested sub: {$nestedSubName}.zip\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch nested manifest: ensure folder="packages" so Joomla finds sub-ZIPs
|
||||||
|
foreach ($nestedPkgManifests as $npmf) {
|
||||||
|
$npmContent = file_get_contents($npmf);
|
||||||
|
if ($npmContent !== false
|
||||||
|
&& strpos($npmContent, '<files>') !== false
|
||||||
|
&& strpos($npmContent, 'folder="packages"') === false
|
||||||
|
) {
|
||||||
|
$npmContent = str_replace('<files>', '<files folder="packages">', $npmContent);
|
||||||
|
file_put_contents($npmf, $npmContent);
|
||||||
|
echo " Fixed: added folder=\"packages\" to " . basename($npmf) . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add top-level files (manifest, script, etc.) with exclude filter
|
||||||
|
$nestedTopFiles = array_merge(
|
||||||
|
glob("{$subSourceDir}/*.xml") ?: [],
|
||||||
|
glob("{$subSourceDir}/*.php") ?: []
|
||||||
|
);
|
||||||
|
foreach ($nestedTopFiles as $ntf) {
|
||||||
|
if (!$this->isExcluded(basename($ntf), $this->excludePatterns)) {
|
||||||
|
$subZip->addFile($ntf, basename($ntf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add all top-level directories except packages/
|
||||||
|
$nestedTopDirs = glob("{$subSourceDir}/*", GLOB_ONLYDIR) ?: [];
|
||||||
|
foreach ($nestedTopDirs as $ntd) {
|
||||||
|
$ndName = basename($ntd);
|
||||||
|
if ($ndName === 'packages') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$this->addDirToZip($subZip, $ntd, $ndName, $this->excludePatterns);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->addDirToZip($subZip, $subSourceDir, '', $this->excludePatterns);
|
||||||
|
}
|
||||||
$subZip->close();
|
$subZip->close();
|
||||||
|
|
||||||
$zip->addFile($subZipPath, "packages/{$subName}.zip");
|
$zip->addFile($subZipPath, "packages/{$subName}.zip");
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/release_publish.php
|
* PATH: /cli/release_publish.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Publish a release and create copies for all lesser stability streams.
|
* BRIEF: Publish a release and create copies for all lesser stability streams.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/scaffold_client.php
|
* PATH: /cli/scaffold_client.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
|
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,294 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: mokocli.CLI
|
||||||
|
* INGROUP: mokocli
|
||||||
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
|
* PATH: /cli/theme_vars_check.php
|
||||||
|
* BRIEF: Validate a client MokoOnyx theme package — required CSS variables
|
||||||
|
* (derived dynamically from the MokoOnyx standard theme) are defined in
|
||||||
|
* the client's light/dark custom CSS, required files exist, the manifest
|
||||||
|
* is sane, and (optionally) the repo's Gitea metadata is set.
|
||||||
|
*
|
||||||
|
* Standalone (no CliFramework dependency) so it runs even when the shared
|
||||||
|
* framework autoloader is unavailable.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* php theme_vars_check.php --path . --reference /tmp/mokoonyx [--github-output]
|
||||||
|
* [--api-base <url> --repo <owner/repo> --token <token>]
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
$opts = getopt('', ['path:', 'reference:', 'github-output', 'api-base:', 'repo:', 'token:']);
|
||||||
|
$path = isset($opts['path']) && is_string($opts['path']) && $opts['path'] !== '' ? $opts['path'] : '.';
|
||||||
|
$ref = isset($opts['reference']) && is_string($opts['reference']) ? $opts['reference'] : '';
|
||||||
|
$gh = array_key_exists('github-output', $opts);
|
||||||
|
|
||||||
|
$root = realpath($path);
|
||||||
|
if ($root === false) { $root = $path; }
|
||||||
|
|
||||||
|
$src = is_dir("$root/src") ? "$root/src" : (is_dir("$root/source") ? "$root/source" : null);
|
||||||
|
if ($src === null) {
|
||||||
|
fwrite(STDERR, "ERROR: no src/ or source/ directory under $root\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$errors = 0;
|
||||||
|
$summary = [];
|
||||||
|
$fail = function (string $msg) use (&$errors, &$summary): void {
|
||||||
|
echo " [FAIL] $msg\n";
|
||||||
|
$summary[] = "FAIL: $msg";
|
||||||
|
$errors++;
|
||||||
|
};
|
||||||
|
$ok = function (string $msg): void { echo " [ok] $msg\n"; };
|
||||||
|
$note = function (string $msg): void { echo " [note] $msg\n"; };
|
||||||
|
|
||||||
|
/** Extract the set of CSS custom-property names DEFINED in a CSS string. */
|
||||||
|
$definedVars = static function (string $css): array {
|
||||||
|
// Matches "--name:" at a declaration position (not var(--name) uses).
|
||||||
|
preg_match_all('/(?:^|[\s;{])(--[a-z0-9_-]+)\s*:/i', $css, $m);
|
||||||
|
return array_values(array_unique(array_map('strtolower', $m[1] ?? [])));
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Find the MokoOnyx standard theme file for a mode inside a reference checkout. */
|
||||||
|
$findStandard = static function (string $ref, string $mode): ?string {
|
||||||
|
if ($ref === '') { return null; }
|
||||||
|
foreach ([
|
||||||
|
"$ref/source/media/css/theme/$mode.standard.css",
|
||||||
|
"$ref/media/templates/site/mokoonyx/css/theme/$mode.standard.css",
|
||||||
|
"$ref/$mode.standard.css",
|
||||||
|
] as $cand) {
|
||||||
|
if (is_file($cand)) { return $cand; }
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
$cssDir = "$src/media/templates/site/mokoonyx/css";
|
||||||
|
$themeDir = "$cssDir/theme";
|
||||||
|
$manifest = "$src/templateDetails.xml";
|
||||||
|
$customs = ['light' => "$themeDir/light.custom.css", 'dark' => "$themeDir/dark.custom.css"];
|
||||||
|
|
||||||
|
echo "MokoOnyx theme validation: $src\n\n";
|
||||||
|
|
||||||
|
// 1) Required files -------------------------------------------------------
|
||||||
|
echo "=== Required files ===\n";
|
||||||
|
$requiredFiles = [
|
||||||
|
'templateDetails.xml' => $manifest,
|
||||||
|
'theme/light.custom.css' => $customs['light'],
|
||||||
|
'theme/dark.custom.css' => $customs['dark'],
|
||||||
|
'user.css' => "$cssDir/user.css",
|
||||||
|
];
|
||||||
|
foreach ($requiredFiles as $label => $file) {
|
||||||
|
is_file($file) ? $ok("$label present") : $fail("missing required file: $label");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1b) Forbidden committed files ------------------------------------------
|
||||||
|
echo "\n=== Forbidden files ===\n";
|
||||||
|
$scan = static function (string $dir, array $skip) use (&$scan): array {
|
||||||
|
$out = [];
|
||||||
|
foreach (scandir($dir) ?: [] as $e) {
|
||||||
|
if ($e === '.' || $e === '..') { continue; }
|
||||||
|
$p = "$dir/$e";
|
||||||
|
if (is_dir($p)) {
|
||||||
|
if (in_array($e, $skip, true)) { continue; }
|
||||||
|
$out = array_merge($out, $scan($p, $skip));
|
||||||
|
} else {
|
||||||
|
$out[] = $p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $out;
|
||||||
|
};
|
||||||
|
$forbidden = [];
|
||||||
|
if (is_dir("$root/.claude")) { $forbidden[] = '.claude/'; }
|
||||||
|
foreach ($scan($root, ['.git', 'vendor', 'node_modules']) as $f) {
|
||||||
|
$b = basename($f);
|
||||||
|
$rel = ltrim(str_replace('\\', '/', substr($f, strlen($root))), '/');
|
||||||
|
if ($b === '.mcp.json' || $b === 'TODO.md'
|
||||||
|
|| fnmatch('.mcp_*.json', $b) || fnmatch('sftp-config*.json', $b)
|
||||||
|
|| fnmatch('*.min.css', $b) || fnmatch('*.min.js', $b)) {
|
||||||
|
$forbidden[] = $rel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$forbidden = array_values(array_unique($forbidden));
|
||||||
|
if ($forbidden) {
|
||||||
|
$shown = array_slice($forbidden, 0, 10);
|
||||||
|
$more = count($forbidden) - count($shown);
|
||||||
|
$fail('forbidden file(s) committed: ' . implode(', ', $shown) . ($more > 0 ? " (+$more more)" : ''));
|
||||||
|
} else {
|
||||||
|
$ok('no forbidden files committed');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) CSS variables — required set derived from the MokoOnyx standard theme
|
||||||
|
echo "\n=== CSS variables vs MokoOnyx standard theme ===\n";
|
||||||
|
if ($ref === '') {
|
||||||
|
$note('no --reference given; skipping variable parity check');
|
||||||
|
} else {
|
||||||
|
foreach ($customs as $mode => $customFile) {
|
||||||
|
$std = $findStandard($ref, $mode);
|
||||||
|
if ($std === null) {
|
||||||
|
$fail("$mode: standard theme not found under reference '$ref'");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!is_file($customFile)) {
|
||||||
|
continue; // already reported missing
|
||||||
|
}
|
||||||
|
$required = $definedVars((string) file_get_contents($std));
|
||||||
|
$defined = $definedVars((string) file_get_contents($customFile));
|
||||||
|
$missing = array_values(array_diff($required, $defined));
|
||||||
|
if ($missing) {
|
||||||
|
$shown = array_slice($missing, 0, 15);
|
||||||
|
$more = count($missing) - count($shown);
|
||||||
|
$fail("$mode mode missing " . count($missing) . '/' . count($required)
|
||||||
|
. ' standard variable(s): ' . implode(', ', $shown) . ($more > 0 ? " (+$more more)" : ''));
|
||||||
|
} else {
|
||||||
|
$ok("$mode mode defines all " . count($required) . ' standard variables');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) Manifest sanity ------------------------------------------------------
|
||||||
|
echo "\n=== Manifest (templateDetails.xml) ===\n";
|
||||||
|
if (is_file($manifest)) {
|
||||||
|
$xml = @simplexml_load_file($manifest);
|
||||||
|
if ($xml === false) {
|
||||||
|
$fail('templateDetails.xml is not well-formed XML');
|
||||||
|
} else {
|
||||||
|
$version = isset($xml->version) ? trim((string) $xml->version) : '';
|
||||||
|
$version !== '' ? $ok("version $version") : $fail('<version> is missing or empty');
|
||||||
|
|
||||||
|
$server = isset($xml->updateservers->server) ? trim((string) $xml->updateservers->server) : '';
|
||||||
|
if ($server === '') {
|
||||||
|
$fail('<updateservers><server> is missing');
|
||||||
|
} elseif (strpos($server, '/raw/branch/') !== false) {
|
||||||
|
$fail('update server uses a legacy raw/branch URL; use the dynamic MokoGitea feed');
|
||||||
|
} else {
|
||||||
|
$ok("update server: $server");
|
||||||
|
}
|
||||||
|
|
||||||
|
isset($xml->dlid) ? $ok('<dlid> license-key field present')
|
||||||
|
: $fail('<dlid prefix="dlid=" suffix=""/> is missing');
|
||||||
|
|
||||||
|
// Element naming convention (MokoOnyx client theme file package)
|
||||||
|
$type = trim((string) ($xml['type'] ?? ''));
|
||||||
|
$element = isset($xml->element) ? trim((string) $xml->element) : '';
|
||||||
|
if ($type === 'file' && $element !== '') {
|
||||||
|
strpos($element, 'file_mokoonyx_') === 0
|
||||||
|
? $ok("element naming ok ($element)")
|
||||||
|
: $fail("element '$element' should start with 'file_mokoonyx_' for a MokoOnyx client theme package");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required manifest fields
|
||||||
|
foreach (['name', 'element', 'author', 'creationDate'] as $field) {
|
||||||
|
(isset($xml->$field) && trim((string) $xml->$field) !== '')
|
||||||
|
? $ok("<$field> present")
|
||||||
|
: $fail("<$field> is missing or empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
// scriptfile (if declared) must exist
|
||||||
|
if (isset($xml->scriptfile)) {
|
||||||
|
$sf = trim((string) $xml->scriptfile);
|
||||||
|
is_file("$src/$sf") ? $ok("scriptfile '$sf' present")
|
||||||
|
: $fail("<scriptfile> references '$sf' which is not in src/");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fileset integrity — every referenced file/folder must exist in src/
|
||||||
|
if (isset($xml->fileset)) {
|
||||||
|
$missingFs = [];
|
||||||
|
foreach ($xml->fileset->files as $files) {
|
||||||
|
$folder = trim((string) ($files['folder'] ?? ''));
|
||||||
|
$baseDir = $folder !== '' ? "$src/$folder" : $src;
|
||||||
|
foreach ($files->filename as $fn) {
|
||||||
|
$rel = ($folder !== '' ? "$folder/" : '') . trim((string) $fn);
|
||||||
|
if (!is_file("$baseDir/" . trim((string) $fn))) { $missingFs[] = $rel; }
|
||||||
|
}
|
||||||
|
foreach ($files->folder as $fd) {
|
||||||
|
$rel = ($folder !== '' ? "$folder/" : '') . trim((string) $fd) . '/';
|
||||||
|
if (!is_dir("$baseDir/" . trim((string) $fd))) { $missingFs[] = $rel; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($missingFs) {
|
||||||
|
$shown = array_slice($missingFs, 0, 10);
|
||||||
|
$more = count($missingFs) - count($shown);
|
||||||
|
$fail('fileset references ' . count($missingFs) . ' missing path(s): '
|
||||||
|
. implode(', ', $shown) . ($more > 0 ? " (+$more more)" : ''));
|
||||||
|
} else {
|
||||||
|
$ok('all fileset paths exist in src/');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4) Repository metadata via Gitea API (optional) -------------------------
|
||||||
|
$apiBase = isset($opts['api-base']) && is_string($opts['api-base']) ? rtrim($opts['api-base'], '/') : '';
|
||||||
|
$repoSlug = isset($opts['repo']) && is_string($opts['repo']) ? trim($opts['repo']) : '';
|
||||||
|
$token = isset($opts['token']) && is_string($opts['token']) ? trim($opts['token']) : '';
|
||||||
|
if ($apiBase !== '' && $repoSlug !== '' && $token !== '') {
|
||||||
|
echo "\n=== Repository metadata (Gitea API) ===\n";
|
||||||
|
$url = "$apiBase/repos/$repoSlug";
|
||||||
|
$ctx = stream_context_create(['http' => [
|
||||||
|
'method' => 'GET',
|
||||||
|
'header' => "Authorization: token $token\r\nAccept: application/json\r\n",
|
||||||
|
'ignore_errors' => true,
|
||||||
|
'timeout' => 15,
|
||||||
|
]]);
|
||||||
|
$resp = @file_get_contents($url, false, $ctx);
|
||||||
|
$data = $resp !== false ? json_decode($resp, true) : null;
|
||||||
|
if (!is_array($data) || !isset($data['name'])) {
|
||||||
|
$fail("could not read repo metadata from Gitea API ($url)");
|
||||||
|
} else {
|
||||||
|
trim((string) ($data['description'] ?? '')) !== '' ? $ok('description set')
|
||||||
|
: $fail('repo description is empty');
|
||||||
|
trim((string) ($data['website'] ?? '')) !== '' ? $ok('website set: ' . $data['website'])
|
||||||
|
: $fail('repo website is empty');
|
||||||
|
$topics = $data['topics'] ?? [];
|
||||||
|
(is_array($topics) && count($topics) > 0) ? $ok(count($topics) . ' topic(s) set')
|
||||||
|
: $fail('repo has no topics');
|
||||||
|
|
||||||
|
// Required topics
|
||||||
|
$requiredTopics = ['joomla', 'client-waas', 'mokoonyx'];
|
||||||
|
$haveTopics = array_map('strtolower', is_array($topics) ? $topics : []);
|
||||||
|
$missingTopics = array_values(array_diff($requiredTopics, $haveTopics));
|
||||||
|
$missingTopics
|
||||||
|
? $fail('missing required topic(s): ' . implode(', ', $missingTopics))
|
||||||
|
: $ok('required topics present (' . implode(', ', $requiredTopics) . ')');
|
||||||
|
|
||||||
|
((string) ($data['default_branch'] ?? '')) === 'main' ? $ok('default branch is main')
|
||||||
|
: $fail("default branch is '" . ($data['default_branch'] ?? '') . "' (expected main)");
|
||||||
|
|
||||||
|
// Branch protection on main
|
||||||
|
$bresp = @file_get_contents("$apiBase/repos/$repoSlug/branches/main", false, $ctx);
|
||||||
|
$bdata = $bresp !== false ? json_decode($bresp, true) : null;
|
||||||
|
if (is_array($bdata) && array_key_exists('protected', $bdata)) {
|
||||||
|
$bdata['protected'] ? $ok('main branch is protected')
|
||||||
|
: $fail('main branch is not protected');
|
||||||
|
} else {
|
||||||
|
$note('could not read branch protection state for main');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "\n=== Repository metadata (Gitea API) ===\n";
|
||||||
|
$note('API args not provided; skipping repo metadata check');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Output / exit -----------------------------------------------------------
|
||||||
|
echo "\n";
|
||||||
|
if ($gh && ($f = getenv('GITHUB_STEP_SUMMARY'))) {
|
||||||
|
$md = "## MokoOnyx Theme Validation\n\n";
|
||||||
|
$md .= $errors === 0
|
||||||
|
? "All checks passed.\n"
|
||||||
|
: implode("\n", array_map(static fn ($l) => "- $l", $summary)) . "\n";
|
||||||
|
@file_put_contents($f, $md, FILE_APPEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($errors > 0) {
|
||||||
|
echo "FAILED: $errors issue(s) found.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
echo "All MokoOnyx theme validation checks passed.\n";
|
||||||
|
exit(0);
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/updates_xml_sync.php
|
* PATH: /cli/updates_xml_sync.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Sync updates.xml to target branches via Gitea API
|
* BRIEF: Sync updates.xml to target branches via Gitea API
|
||||||
* NOTE: Called by pre-release and auto-release workflows after updates.xml
|
* NOTE: Called by pre-release and auto-release workflows after updates.xml
|
||||||
* is modified on the current branch. Pushes the file to other branches
|
* is modified on the current branch. Pushes the file to other branches
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/version_auto_bump.php
|
* PATH: /cli/version_auto_bump.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash
|
* BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
+22
-3
@@ -214,7 +214,8 @@ class VersionBumpCli extends CliFramework
|
|||||||
$newContent = preg_replace(
|
$newContent = preg_replace(
|
||||||
$xmlPattern,
|
$xmlPattern,
|
||||||
'${1}' . $newBase . '</version>',
|
'${1}' . $newBase . '</version>',
|
||||||
$content
|
$content,
|
||||||
|
1
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$xmlPattern = '#<version>\d{2}\.\d{2}\.\d{2}'
|
$xmlPattern = '#<version>\d{2}\.\d{2}\.\d{2}'
|
||||||
@@ -222,9 +223,13 @@ class VersionBumpCli extends CliFramework
|
|||||||
$newContent = preg_replace(
|
$newContent = preg_replace(
|
||||||
$xmlPattern,
|
$xmlPattern,
|
||||||
"<version>{$newFull}</version>",
|
"<version>{$newFull}</version>",
|
||||||
$content
|
$content,
|
||||||
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if ($newContent !== null) {
|
||||||
|
$newContent = preg_replace('#(\s*<version>[^<]*</version>)\s*<version>[^<]*</version>#', '$1', $newContent);
|
||||||
|
}
|
||||||
if ($newContent !== null && $newContent !== $content) {
|
if ($newContent !== null && $newContent !== $content) {
|
||||||
file_put_contents($xmlFile, $newContent);
|
file_put_contents($xmlFile, $newContent);
|
||||||
$updatedFiles[] = substr($xmlFile, strlen($root) + 1);
|
$updatedFiles[] = substr($xmlFile, strlen($root) + 1);
|
||||||
@@ -234,6 +239,20 @@ class VersionBumpCli extends CliFramework
|
|||||||
if (!empty($updatedFiles)) {
|
if (!empty($updatedFiles)) {
|
||||||
fwrite(STDERR, "Updated " . count($updatedFiles) . " Joomla manifest(s): " . implode(', ', $updatedFiles) . "\n");
|
fwrite(STDERR, "Updated " . count($updatedFiles) . " Joomla manifest(s): " . implode(', ', $updatedFiles) . "\n");
|
||||||
}
|
}
|
||||||
|
// Joomla schema version: create empty SQL update file if sql/updates/mysql/ exists
|
||||||
|
$sqlUpdateDirs = array_merge(
|
||||||
|
SourceResolver::globSource($root, 'packages/*/sql/updates/mysql'),
|
||||||
|
SourceResolver::globSource($root, 'sql/updates/mysql'),
|
||||||
|
glob("{$root}/sql/updates/mysql") ?: []
|
||||||
|
);
|
||||||
|
$sqlUpdateDirs = array_unique(array_filter($sqlUpdateDirs, 'is_dir'));
|
||||||
|
foreach ($sqlUpdateDirs as $sqlDir) {
|
||||||
|
$sqlFile = "{$sqlDir}/{$newBase}.sql";
|
||||||
|
if (!file_exists($sqlFile)) {
|
||||||
|
file_put_contents($sqlFile, "/* {$newBase} — no schema changes */\n");
|
||||||
|
fwrite(STDERR, "Created SQL update file: " . substr($sqlFile, strlen($root) + 1) . "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
$packageJsonFile = "{$root}/package.json";
|
$packageJsonFile = "{$root}/package.json";
|
||||||
if (file_exists($packageJsonFile)) {
|
if (file_exists($packageJsonFile)) {
|
||||||
$pkgContent = file_get_contents($packageJsonFile);
|
$pkgContent = file_get_contents($packageJsonFile);
|
||||||
@@ -370,7 +389,7 @@ class VersionBumpCli extends CliFramework
|
|||||||
/**
|
/**
|
||||||
* Scan git release tags for the highest version across all channels.
|
* Scan git release tags for the highest version across all channels.
|
||||||
*
|
*
|
||||||
* Checks release names like "MokoSuiteClient (VERSION: 09.39.00)" in
|
* Checks release names like "MokoSuiteClient (VERSION: 09.43.00)" in
|
||||||
* git tags (stable, release-candidate, development, etc.) to find the
|
* git tags (stable, release-candidate, development, etc.) to find the
|
||||||
* highest version that has been released on any channel.
|
* highest version that has been released on any channel.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/version_check.php
|
* PATH: /cli/version_check.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Validate version consistency across README, manifests, and sub-packages
|
* BRIEF: Validate version consistency across README, manifests, and sub-packages
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -131,9 +131,11 @@ class VersionCheckCli extends CliFramework
|
|||||||
$updated = preg_replace(
|
$updated = preg_replace(
|
||||||
$vPat,
|
$vPat,
|
||||||
"<version>{$highestVersion}</version>",
|
"<version>{$highestVersion}</version>",
|
||||||
$content
|
$content,
|
||||||
|
1
|
||||||
);
|
);
|
||||||
if ($updated !== null) {
|
if ($updated !== null) {
|
||||||
|
$updated = preg_replace('#(\s*<version>[^<]*</version>)\s*<version>[^<]*</version>#', '$1', $updated);
|
||||||
file_put_contents($mokoManifest, $updated);
|
file_put_contents($mokoManifest, $updated);
|
||||||
} echo " Fixed: .mokogitea/manifest.xml -> {$highestVersion}\n";
|
} echo " Fixed: .mokogitea/manifest.xml -> {$highestVersion}\n";
|
||||||
}
|
}
|
||||||
@@ -185,8 +187,9 @@ class VersionCheckCli extends CliFramework
|
|||||||
if (!file_exists($file)) {
|
if (!file_exists($file)) {
|
||||||
continue;
|
continue;
|
||||||
} $content = file_get_contents($file);
|
} $content = file_get_contents($file);
|
||||||
$updated = preg_replace('#<version>[^<]*</version>#', "<version>{$highestVersion}</version>", $content);
|
$updated = preg_replace('#<version>[^<]*</version>#', "<version>{$highestVersion}</version>", $content, 1);
|
||||||
if ($updated !== null) {
|
if ($updated !== null) {
|
||||||
|
$updated = preg_replace('#(\s*<version>[^<]*</version>)\s*<version>[^<]*</version>#', '$1', $updated);
|
||||||
file_put_contents($file, $updated);
|
file_put_contents($file, $updated);
|
||||||
} echo " Fixed: {$source} -> {$highestVersion}\n";
|
} echo " Fixed: {$source} -> {$highestVersion}\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,8 +164,12 @@ class VersionSetPlatformCli extends CliFramework
|
|||||||
$updated = preg_replace(
|
$updated = preg_replace(
|
||||||
'|<version>[^<]*</version>|',
|
'|<version>[^<]*</version>|',
|
||||||
"<version>{$version}</version>",
|
"<version>{$version}</version>",
|
||||||
$content
|
$content,
|
||||||
|
1
|
||||||
);
|
);
|
||||||
|
if ($updated !== null) {
|
||||||
|
$updated = preg_replace('#(\s*<version>[^<]*</version>)\s*<version>[^<]*</version>#', '$1', $updated);
|
||||||
|
}
|
||||||
if ($updated !== null && $updated !== $content) {
|
if ($updated !== null && $updated !== $content) {
|
||||||
file_put_contents($file, $updated);
|
file_put_contents($file, $updated);
|
||||||
$relPath = str_replace($root . '/', '', $file);
|
$relPath = str_replace($root . '/', '', $file);
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/wiki_sync.php
|
* PATH: /cli/wiki_sync.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Sync select wiki pages from mokocli to all template repos
|
* BRIEF: Sync select wiki pages from mokocli to all template repos
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: mokocli
|
* INGROUP: mokocli
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /cli/workflow_sync.php
|
* PATH: /cli/workflow_sync.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform
|
* BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -71,8 +71,8 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "phpunit",
|
"test": "phpunit",
|
||||||
"phpcs": "phpcs --standard=phpcs.xml lib/ validate/ automation/",
|
"phpcs": "phpcs --standard=phpcs.xml lib/ validate/",
|
||||||
"phpstan": "phpstan analyse -c phpstan.neon lib/ validate/ automation/",
|
"phpstan": "phpstan analyse -c phpstan.neon lib/ validate/",
|
||||||
"psalm": "psalm --config=psalm.xml",
|
"psalm": "psalm --config=psalm.xml",
|
||||||
"check": [
|
"check": [
|
||||||
"@phpcs",
|
"@phpcs",
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/backup-before-deploy.php
|
* PATH: /deploy/backup-before-deploy.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
|
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,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
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/deploy-and-verify.php
|
* PATH: /deploy/deploy-and-verify.php
|
||||||
* BRIEF: Deploy with automatic health check and rollback on failure
|
* BRIEF: Deploy with automatic health check and rollback on failure
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/deploy-dolibarr.php
|
* PATH: /deploy/deploy-dolibarr.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
|
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/deploy-joomla.php
|
* PATH: /deploy/deploy-joomla.php
|
||||||
* BRIEF: Smart Joomla deploy — routes files to correct Joomla directories based on XML manifest
|
* BRIEF: Smart Joomla deploy — routes files to correct Joomla directories based on XML manifest
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/deploy-sftp.php
|
* PATH: /deploy/deploy-sftp.php
|
||||||
* BRIEF: Deploy a repository src/ directory to a remote web server via SFTP
|
* BRIEF: Deploy a repository src/ directory to a remote web server via SFTP
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/health-check.php
|
* PATH: /deploy/health-check.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Post-deploy health check — verify a Joomla site is responding correctly
|
* BRIEF: Post-deploy health check — verify a Joomla site is responding correctly
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/rollback-joomla.php
|
* PATH: /deploy/rollback-joomla.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot
|
* BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Deploy
|
* DEFGROUP: MokoCLI.Scripts.Deploy
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /deploy/sync-joomla.php
|
* PATH: /deploy/sync-joomla.php
|
||||||
* VERSION: 09.39.00
|
* VERSION: 09.43.00
|
||||||
* BRIEF: Sync Joomla site directories between two servers via rsync over SSH
|
* BRIEF: Sync Joomla site directories between two servers via rsync over SSH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Fix
|
* DEFGROUP: MokoCLI.Scripts.Fix
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /fix/fix_line_endings.php
|
* PATH: /fix/fix_line_endings.php
|
||||||
* BRIEF: CLI script to normalise CRLF/CR to LF in tracked source files
|
* BRIEF: CLI script to normalise CRLF/CR to LF in tracked source files
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Fix
|
* DEFGROUP: MokoCLI.Scripts.Fix
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /fix/fix_permissions.php
|
* PATH: /fix/fix_permissions.php
|
||||||
* BRIEF: CLI script to normalise file permissions (dirs 755, files 644, scripts 755)
|
* BRIEF: CLI script to normalise file permissions (dirs 755, files 644, scripts 755)
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Fix
|
* DEFGROUP: MokoCLI.Scripts.Fix
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /fix/fix_tabs.php
|
* PATH: /fix/fix_tabs.php
|
||||||
* BRIEF: CLI script to convert tabs to spaces in tracked source files
|
* BRIEF: CLI script to convert tabs to spaces in tracked source files
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Scripts.Fix
|
* DEFGROUP: MokoCLI.Scripts.Fix
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /fix/fix_trailing_spaces.php
|
* PATH: /fix/fix_trailing_spaces.php
|
||||||
* BRIEF: CLI script to remove trailing whitespace from tracked source files
|
* BRIEF: CLI script to remove trailing whitespace from tracked source files
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,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
|
||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoPlatform.Index
|
DEFGROUP: MokoCLI.Index
|
||||||
INGROUP: MokoPlatform.Fix
|
INGROUP: MokoCLI.Fix
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /fix/index.md
|
PATH: /fix/index.md
|
||||||
BRIEF: Fix directory index
|
BRIEF: Fix directory index
|
||||||
|
|||||||
@@ -2,8 +2,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
|
||||||
FILE INFORMATION
|
FILE INFORMATION
|
||||||
DEFGROUP: MokoPlatform.Root
|
DEFGROUP: MokoCLI.Root
|
||||||
INGROUP: MokoPlatform
|
INGROUP: MokoCLI
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
PATH: /index.md
|
PATH: /index.md
|
||||||
BRIEF: Scripts directory index
|
BRIEF: Scripts directory index
|
||||||
@@ -61,7 +61,7 @@ Shared library code
|
|||||||
- GitHub client
|
- GitHub client
|
||||||
|
|
||||||
### [Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki)
|
### [Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki)
|
||||||
All documentation lives in the Gitea wiki.
|
All documentation lives in the MokoGitea wiki.
|
||||||
|
|
||||||
### [Tests](tests/)
|
### [Tests](tests/)
|
||||||
Test scripts
|
Test scripts
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Lib
|
* DEFGROUP: MokoCLI.Lib
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/CliBase.php
|
* PATH: /lib/CliBase.php
|
||||||
* BRIEF: Standalone base CLI class for scripts that do not use CliFramework
|
* BRIEF: Standalone base CLI class for scripts that do not use CliFramework
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Lib
|
* DEFGROUP: MokoCLI.Lib
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Common.php
|
* PATH: /lib/Common.php
|
||||||
* BRIEF: Common utility functions for scripts
|
* BRIEF: Common utility functions for scripts
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/AbstractProjectPlugin.php
|
* PATH: /lib/Enterprise/AbstractProjectPlugin.php
|
||||||
* BRIEF: Abstract base class for project plugins
|
* BRIEF: Abstract base class for project plugins
|
||||||
@@ -23,7 +23,7 @@ namespace MokoCli;
|
|||||||
*
|
*
|
||||||
* Provides common functionality for all project type plugins
|
* Provides common functionality for all project type plugins
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
abstract class AbstractProjectPlugin implements ProjectPluginInterface
|
abstract class AbstractProjectPlugin implements ProjectPluginInterface
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.API
|
* DEFGROUP: MokoCLI.Enterprise.API
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/ApiClient.php
|
* PATH: /lib/Enterprise/ApiClient.php
|
||||||
* BRIEF: HTTP API client library
|
* BRIEF: HTTP API client library
|
||||||
@@ -31,7 +31,7 @@ declare(strict_types=1);
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ declare(strict_types=1);
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Audit
|
* DEFGROUP: MokoCLI.Enterprise.Audit
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/AuditLogger.php
|
* PATH: /lib/Enterprise/AuditLogger.php
|
||||||
* BRIEF: Enterprise audit logging
|
* BRIEF: Enterprise audit logging
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Checkpoint
|
* DEFGROUP: MokoCLI.Enterprise.Checkpoint
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/CheckpointManager.php
|
* PATH: /lib/Enterprise/CheckpointManager.php
|
||||||
* BRIEF: Checkpoint manager for resumable operations
|
* BRIEF: Checkpoint manager for resumable operations
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.CLI
|
* DEFGROUP: MokoCLI.Enterprise.CLI
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/CliFramework.php
|
* PATH: /lib/Enterprise/CliFramework.php
|
||||||
* BRIEF: CliFramework — unified base class for all mokocli CLI scripts
|
* BRIEF: CliFramework — unified base class for all mokocli CLI scripts
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Config
|
* DEFGROUP: MokoCLI.Enterprise.Config
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/Config.php
|
* PATH: /lib/Enterprise/Config.php
|
||||||
* BRIEF: Configuration manager
|
* BRIEF: Configuration manager
|
||||||
@@ -32,7 +32,7 @@ declare(strict_types=1);
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise
|
* DEFGROUP: MokoCLI.Enterprise
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/ConfigValidator.php
|
* PATH: /lib/Enterprise/ConfigValidator.php
|
||||||
* BRIEF: Validate project config against plugin JSON schema
|
* BRIEF: Validate project config against plugin JSON schema
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise
|
* DEFGROUP: MokoCLI.Enterprise
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/EnterpriseReadinessValidator.php
|
* PATH: /lib/Enterprise/EnterpriseReadinessValidator.php
|
||||||
* BRIEF: Enterprise readiness validation library
|
* BRIEF: Enterprise readiness validation library
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Recovery
|
* DEFGROUP: MokoCLI.Enterprise.Recovery
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/ErrorRecovery.php
|
* PATH: /lib/Enterprise/ErrorRecovery.php
|
||||||
* BRIEF: Error recovery framework
|
* BRIEF: Error recovery framework
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise
|
* DEFGROUP: MokoCLI.Enterprise
|
||||||
* INGROUP: MokoPlatform.Lib
|
* INGROUP: MokoCLI.Lib
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/FileFixUtility.php
|
* PATH: /lib/Enterprise/FileFixUtility.php
|
||||||
* BRIEF: Utility class for fixing file formatting issues (line endings, permissions, tabs, trailing spaces)
|
* BRIEF: Utility class for fixing file formatting issues (line endings, permissions, tabs, trailing spaces)
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Platform
|
* DEFGROUP: MokoCLI.Enterprise.Platform
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/GitHubAdapter.php
|
* PATH: /lib/Enterprise/GitHubAdapter.php
|
||||||
* BRIEF: GitHub implementation of GitPlatformAdapter
|
* BRIEF: GitHub implementation of GitPlatformAdapter
|
||||||
@@ -31,7 +31,7 @@ use RuntimeException;
|
|||||||
* - Topics: PUT with {"names": [...]}
|
* - Topics: PUT with {"names": [...]}
|
||||||
* - Workflow dir: .github/workflows
|
* - Workflow dir: .github/workflows
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @since 04.06.10
|
* @since 04.06.10
|
||||||
* @see GitPlatformAdapter
|
* @see GitPlatformAdapter
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Platform
|
* DEFGROUP: MokoCLI.Enterprise.Platform
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/GitPlatformAdapter.php
|
* PATH: /lib/Enterprise/GitPlatformAdapter.php
|
||||||
* BRIEF: Interface defining all git platform operations for GitHub/Gitea abstraction
|
* BRIEF: Interface defining all git platform operations for GitHub/Gitea abstraction
|
||||||
@@ -25,7 +25,7 @@ namespace MokoCli;
|
|||||||
* Implementations exist for GitHub (GitHubAdapter) and Gitea (MokoGiteaAdapter),
|
* Implementations exist for GitHub (GitHubAdapter) and Gitea (MokoGiteaAdapter),
|
||||||
* allowing scripts to work against either platform transparently.
|
* allowing scripts to work against either platform transparently.
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.06.10
|
* @version 04.06.10
|
||||||
*/
|
*/
|
||||||
interface GitPlatformAdapter
|
interface GitPlatformAdapter
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Validation
|
* DEFGROUP: MokoCLI.Enterprise.Validation
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/InputValidator.php
|
* PATH: /lib/Enterprise/InputValidator.php
|
||||||
* BRIEF: Input validation library
|
* BRIEF: Input validation library
|
||||||
@@ -31,7 +31,7 @@ declare(strict_types=1);
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise
|
* DEFGROUP: MokoCLI.Enterprise
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/ManifestParser.php
|
* PATH: /lib/Enterprise/ManifestParser.php
|
||||||
* BRIEF: Parser for the XML-based manifest.xml repository manifest
|
* BRIEF: Parser for the XML-based manifest.xml repository manifest
|
||||||
@@ -28,7 +28,7 @@ use SimpleXMLElement;
|
|||||||
* Reads, writes, and validates the manifest.xml repository manifest.
|
* Reads, writes, and validates the manifest.xml repository manifest.
|
||||||
* The file uses XML format (no file extension) and lives at .mokogitea/manifest.xml.
|
* The file uses XML format (no file extension) and lives at .mokogitea/manifest.xml.
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.07.00
|
* @version 04.07.00
|
||||||
*/
|
*/
|
||||||
class ManifestParser
|
class ManifestParser
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Metrics
|
* DEFGROUP: MokoCLI.Enterprise.Metrics
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/MetricsCollector.php
|
* PATH: /lib/Enterprise/MetricsCollector.php
|
||||||
* BRIEF: Metrics collection framework
|
* BRIEF: Metrics collection framework
|
||||||
@@ -46,7 +46,7 @@ declare(strict_types=1);
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.00.04
|
* @version 04.00.04
|
||||||
* @author mokocli Team
|
* @author mokocli Team
|
||||||
* @license GPL-3.0-or-later
|
* @license GPL-3.0-or-later
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Platform
|
* DEFGROUP: MokoCLI.Enterprise.Platform
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/MokoGiteaAdapter.php
|
* PATH: /lib/Enterprise/MokoGiteaAdapter.php
|
||||||
* BRIEF: Gitea implementation of GitPlatformAdapter
|
* BRIEF: Gitea implementation of GitPlatformAdapter
|
||||||
@@ -33,7 +33,7 @@ use RuntimeException;
|
|||||||
* - Branch protection: flat API (not rulesets)
|
* - Branch protection: flat API (not rulesets)
|
||||||
* - Workflow dir: .mokogitea/workflows
|
* - Workflow dir: .mokogitea/workflows
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @since 04.06.10
|
* @since 04.06.10
|
||||||
* @see GitPlatformAdapter
|
* @see GitPlatformAdapter
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise
|
* DEFGROUP: MokoCLI.Enterprise
|
||||||
* INGROUP: MokoPlatform.Lib
|
* INGROUP: MokoCLI.Lib
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/PackageBuilder.php
|
* PATH: /lib/Enterprise/PackageBuilder.php
|
||||||
* BRIEF: Builds release packages for generic, Dolibarr module, and Joomla component projects
|
* BRIEF: Builds release packages for generic, Dolibarr module, and Joomla component projects
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Platform
|
* DEFGROUP: MokoCLI.Enterprise.Platform
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/PlatformAdapterFactory.php
|
* PATH: /lib/Enterprise/PlatformAdapterFactory.php
|
||||||
* BRIEF: Factory for creating platform-specific GitPlatformAdapter instances
|
* BRIEF: Factory for creating platform-specific GitPlatformAdapter instances
|
||||||
@@ -33,7 +33,7 @@ use RuntimeException;
|
|||||||
* $repos = $adapter->listOrgRepos('mokoconsulting-tech');
|
* $repos = $adapter->listOrgRepos('mokoconsulting-tech');
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 04.06.10
|
* @version 04.06.10
|
||||||
*
|
*
|
||||||
* @since 04.00.00
|
* @since 04.00.00
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/PluginFactory.php
|
* PATH: /lib/Enterprise/PluginFactory.php
|
||||||
* BRIEF: Plugin factory for project type detection
|
* BRIEF: Plugin factory for project type detection
|
||||||
@@ -23,7 +23,7 @@ namespace MokoCli;
|
|||||||
*
|
*
|
||||||
* Provides convenient methods for plugin instantiation with dependency injection
|
* Provides convenient methods for plugin instantiation with dependency injection
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
class PluginFactory
|
class PluginFactory
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ declare(strict_types=1);
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform.Enterprise
|
* INGROUP: MokoCLI.Enterprise
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/PluginRegistry.php
|
* PATH: /lib/Enterprise/PluginRegistry.php
|
||||||
* BRIEF: Plugin registry for available project plugins
|
* BRIEF: Plugin registry for available project plugins
|
||||||
@@ -35,7 +35,7 @@ use MokoCli\Plugins\McpServerPlugin;
|
|||||||
*
|
*
|
||||||
* Manages plugin discovery, registration, and lifecycle
|
* Manages plugin discovery, registration, and lifecycle
|
||||||
*
|
*
|
||||||
* @package MokoPlatform\Enterprise
|
* @package MokoCLI\Enterprise
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*/
|
*/
|
||||||
class PluginRegistry
|
class PluginRegistry
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/Plugins/ApiPlugin.php
|
* PATH: /lib/Enterprise/Plugins/ApiPlugin.php
|
||||||
* BRIEF: Enterprise plugin for API/Microservices projects
|
* BRIEF: Enterprise plugin for API/Microservices projects
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/Plugins/DocumentationPlugin.php
|
* PATH: /lib/Enterprise/Plugins/DocumentationPlugin.php
|
||||||
* BRIEF: Enterprise plugin for documentation projects
|
* BRIEF: Enterprise plugin for documentation projects
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/Plugins/DolibarrPlugin.php
|
* PATH: /lib/Enterprise/Plugins/DolibarrPlugin.php
|
||||||
* BRIEF: Enterprise plugin for Dolibarr modules
|
* BRIEF: Enterprise plugin for Dolibarr modules
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*
|
*
|
||||||
* FILE INFORMATION
|
* FILE INFORMATION
|
||||||
* DEFGROUP: MokoPlatform.Enterprise.Plugins
|
* DEFGROUP: MokoCLI.Enterprise.Plugins
|
||||||
* INGROUP: MokoPlatform
|
* INGROUP: MokoCLI
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
|
||||||
* PATH: /lib/Enterprise/Plugins/GenericPlugin.php
|
* PATH: /lib/Enterprise/Plugins/GenericPlugin.php
|
||||||
* BRIEF: Enterprise plugin for generic projects
|
* BRIEF: Enterprise plugin for generic projects
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user