From 441916eed26f9644d97e415602ee53cbf96ec2b5 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:09:30 -0500 Subject: [PATCH] ci: updates.xml (Joomla standard), multi-stability entries Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci-joomla.yml | 6 ++--- .github/workflows/repo_health.yml | 6 ++--- .github/workflows/update-server.yml | 40 ++++++++++++++--------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-joomla.yml b/.github/workflows/ci-joomla.yml index d7995d29..190846ed 100644 --- a/.github/workflows/ci-joomla.yml +++ b/.github/workflows/ci-joomla.yml @@ -312,11 +312,11 @@ jobs: fi fi - # Check update.xml exists - if [ -f "update.xml" ] || [ -f "updates.xml" ]; then + # Check updates.xml exists + if [ -f "updates.xml" ] || [ -f "updates.xml" ]; then echo "Update XML present." >> $GITHUB_STEP_SUMMARY else - echo "No update.xml found." >> $GITHUB_STEP_SUMMARY + echo "No updates.xml found." >> $GITHUB_STEP_SUMMARY ERRORS=$((ERRORS + 1)) fi diff --git a/.github/workflows/repo_health.yml b/.github/workflows/repo_health.yml index 0129292b..885203aa 100644 --- a/.github/workflows/repo_health.yml +++ b/.github/workflows/repo_health.yml @@ -595,9 +595,9 @@ jobs: joomla_findings+=("No .ini language files found") fi - # update.xml must exist in root (Joomla update server) - if [ ! -f 'update.xml' ]; then - joomla_findings+=("update.xml missing in root (required for Joomla update server)") + # updates.xml must exist in root (Joomla update server) + if [ ! -f 'updates.xml' ]; then + joomla_findings+=("updates.xml missing in root (required for Joomla update server)") fi # index.html files for directory listing protection diff --git a/.github/workflows/update-server.yml b/.github/workflows/update-server.yml index 91d93651..4d4fc972 100644 --- a/.github/workflows/update-server.yml +++ b/.github/workflows/update-server.yml @@ -10,7 +10,7 @@ # VERSION: 04.05.13 # BRIEF: Update Joomla update server XML feed with stable/rc/dev entries # -# Writes update.xml with multiple entries: +# Writes updates.xml with multiple entries: # - stable on push to main (from auto-release) # - rc on push to rc/** # - development on push to dev/** @@ -47,7 +47,7 @@ permissions: jobs: update-xml: - name: Update update.xml + name: Update updates.xml runs-on: ubuntu-latest steps: @@ -69,7 +69,7 @@ jobs: cd /tmp/mokostandards && composer install --no-dev --no-interaction --quiet 2>/dev/null || true fi - - name: Generate update.xml entry + - name: Generate updates.xml entry run: | BRANCH="${{ github.ref_name }}" REPO="${{ github.repository }}" @@ -149,20 +149,20 @@ jobs: XMLEOF ) - # ── Merge into update.xml ───────────────────────────────────── - if [ ! -f "update.xml" ]; then + # ── Merge into updates.xml ───────────────────────────────────── + if [ ! -f "updates.xml" ]; then # Create fresh - printf '%s\n' '' > update.xml - printf '%s\n' '' >> update.xml - echo "$NEW_ENTRY" >> update.xml - printf '%s\n' '' >> update.xml + printf '%s\n' '' > updates.xml + printf '%s\n' '' >> updates.xml + echo "$NEW_ENTRY" >> updates.xml + printf '%s\n' '' >> updates.xml else # Remove existing entry for this stability, add new one # Use python for reliable XML manipulation python3 -c " import re, sys -with open('update.xml', 'r') as f: +with open('updates.xml', 'r') as f: content = f.read() # Remove existing entry with this stability tag @@ -176,29 +176,29 @@ content = content.replace('', new_entry + '\n') # Clean up empty lines content = re.sub(r'\n{3,}', '\n\n', content) -with open('update.xml', 'w') as f: +with open('updates.xml', 'w') as f: f.write(content) " 2>/dev/null || { # Fallback: just rewrite the whole file if python fails # Keep existing stable entry if present STABLE_ENTRY="" - if [ "$STABILITY" != "stable" ] && grep -q 'stable' update.xml; then - STABLE_ENTRY=$(sed -n '//,/<\/update>/{ /stable<\/tag>/,/<\/update>/p; //,/stable<\/tag>/p }' update.xml | sort -u) + if [ "$STABILITY" != "stable" ] && grep -q 'stable' updates.xml; then + STABLE_ENTRY=$(sed -n '//,/<\/update>/{ /stable<\/tag>/,/<\/update>/p; //,/stable<\/tag>/p }' updates.xml | sort -u) fi RC_ENTRY="" - if [ "$STABILITY" != "rc" ] && grep -q 'rc' update.xml; then + if [ "$STABILITY" != "rc" ] && grep -q 'rc' updates.xml; then RC_ENTRY=$(python3 -c " import re -with open('update.xml') as f: c = f.read() +with open('updates.xml') as f: c = f.read() m = re.search(r'(.*?rc.*?)', c, re.DOTALL) if m: print(m.group(1)) " 2>/dev/null || true) fi DEV_ENTRY="" - if [ "$STABILITY" != "development" ] && grep -q 'development' update.xml; then + if [ "$STABILITY" != "development" ] && grep -q 'development' updates.xml; then DEV_ENTRY=$(python3 -c " import re -with open('update.xml') as f: c = f.read() +with open('updates.xml') as f: c = f.read() m = re.search(r'(.*?development.*?)', c, re.DOTALL) if m: print(m.group(1)) " 2>/dev/null || true) @@ -212,16 +212,16 @@ if m: print(m.group(1)) [ -n "$DEV_ENTRY" ] && echo "$DEV_ENTRY" echo "$NEW_ENTRY" printf '%s\n' '' - } > update.xml + } > updates.xml } fi # Commit git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" - git add update.xml + git add updates.xml git diff --cached --quiet || { - git commit -m "chore: update update.xml (${STABILITY}: ${DISPLAY_VERSION}) [skip ci]" \ + git commit -m "chore: update updates.xml (${STABILITY}: ${DISPLAY_VERSION}) [skip ci]" \ --author="github-actions[bot] " git push }