From 321c51a5c8691f9053f57da09c49fcdeff0f08b0 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:08:58 -0500 Subject: [PATCH] ci: sync Joomla workflows + updates.xml from main Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/auto-release.yml | 32 +++++++++++------------ .github/workflows/ci-joomla.yml | 6 ++--- .github/workflows/repo_health.yml | 6 ++--- .github/workflows/update-server.yml | 40 ++++++++++++++--------------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 528d4cb..5acbe07 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -8,7 +8,7 @@ # REPO: https://github.com/mokoconsulting-tech/MokoStandards # PATH: /templates/workflows/joomla/auto-release.yml.template # VERSION: 04.05.13 -# BRIEF: Joomla build & release — ZIP package, update.xml, SHA-256 checksum +# BRIEF: Joomla build & release — ZIP package, updates.xml, SHA-256 checksum # # +========================================================================+ # | BUILD & RELEASE PIPELINE (JOOMLA) | @@ -20,10 +20,10 @@ # | 1. Read version from README.md | # | 3. Set platform version (Joomla ) | # | 4. Update [VERSION: XX.YY.ZZ] badges in markdown files | -# | 5. Write update.xml (Joomla update server XML) | +# | 5. Write updates.xml (Joomla update server XML) | # | 6. Create git tag vXX.YY.ZZ | # | 7a. Patch: update existing GitHub Release for this minor | -# | 8. Build ZIP, upload asset, write SHA-256 to update.xml | +# | 8. Build ZIP, upload asset, write SHA-256 to updates.xml | # | | # | Every version change: archives main -> version/XX.YY branch | # | Patch 00 = development (no release). First release = patch 01. | @@ -259,8 +259,8 @@ jobs: fi done - # -- STEP 5: Write update.xml (Joomla update server) --------------------- - - name: "Step 5: Write update.xml" + # -- STEP 5: Write updates.xml (Joomla update server) --------------------- + - name: "Step 5: Write updates.xml" if: >- steps.version.outputs.skip != 'true' && steps.check.outputs.already_released != 'true' @@ -271,7 +271,7 @@ jobs: # -- Parse extension metadata from XML manifest ---------------- MANIFEST=$(find . -maxdepth 2 -name "*.xml" -exec grep -l '/dev/null | head -1) if [ -z "$MANIFEST" ]; then - echo "Warning: No Joomla XML manifest found — skipping update.xml" >> $GITHUB_STEP_SUMMARY + echo "Warning: No Joomla XML manifest found — skipping updates.xml" >> $GITHUB_STEP_SUMMARY exit 0 fi @@ -316,7 +316,7 @@ jobs: DOWNLOAD_URL="https://github.com/${REPO}/releases/download/v${VERSION}/${EXT_ELEMENT}-${VERSION}.zip" INFO_URL="https://github.com/${REPO}/releases/tag/v${VERSION}" - # -- Write update.xml (stable release) -------------------------- + # -- Write updates.xml (stable release) -------------------------- { printf '%s\n' '' printf '%s\n' '' @@ -341,9 +341,9 @@ jobs: printf '%s\n' ' https://mokoconsulting.tech' printf '%s\n' ' ' printf '%s\n' '' - } > update.xml + } > updates.xml - echo "update.xml: ${VERSION} (stable) — ${EXT_TYPE}/${EXT_ELEMENT}" >> $GITHUB_STEP_SUMMARY + echo "updates.xml: ${VERSION} (stable) — ${EXT_TYPE}/${EXT_ELEMENT}" >> $GITHUB_STEP_SUMMARY # -- Commit all changes --------------------------------------------------- - name: Commit release changes @@ -472,19 +472,19 @@ jobs: gh release upload "$RELEASE_TAG" "/tmp/${PACKAGE_NAME}" 2>/dev/null || true } - # -- Update update.xml with SHA-256 for latest patch ------------- - if [ -f "update.xml" ]; then - if grep -q '' update.xml; then - sed -i "s|.*|sha256:${SHA256}|" update.xml + # -- Update updates.xml with SHA-256 for latest patch ------------- + if [ -f "updates.xml" ]; then + if grep -q '' updates.xml; then + sed -i "s|.*|sha256:${SHA256}|" updates.xml else - sed -i "s||\n sha256:${SHA256}|" update.xml + sed -i "s||\n sha256:${SHA256}|" updates.xml fi # Also update the download URL to point to this patch's ZIP DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${RELEASE_TAG}/${PACKAGE_NAME}" - sed -i "s|]*>[^<]*|${DOWNLOAD_URL}|" update.xml + sed -i "s|]*>[^<]*|${DOWNLOAD_URL}|" updates.xml - git add update.xml + git add updates.xml git commit -m "chore(release): SHA-256 + download URL for ${VERSION} [skip ci]" \ --author="github-actions[bot] " || true git push || true diff --git a/.github/workflows/ci-joomla.yml b/.github/workflows/ci-joomla.yml index d7995d2..190846e 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 0129292..885203a 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 91d9365..4d4fc97 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 }