fix(ci): ensure workflows work for all Joomla extension types

- Source dir: add htdocs/ fallback (components may use htdocs/ not src/)
- Manifest search: increase maxdepth to 3, exclude .git/ and build/
  (covers src/admin/com_xxx.xml and similar nested structures)
- Exclude trigger files (.build-trigger, .beta-trigger, .rc-trigger)
  from release packages
- Both release.yml and update-server.yml now consistent

Tested extension types: template, plugin (system), component, module,
library, package — all use the same generic workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-26 19:35:40 -05:00
parent 03b941b42c
commit 79c220fca2
2 changed files with 17 additions and 4 deletions
+16 -3
View File
@@ -97,7 +97,8 @@ jobs:
[ -z "$VERSION" ] && VERSION="00.00.00"
# Auto-detect extension element from Joomla manifest
MANIFEST=$(find . -maxdepth 2 -name "*.xml" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
# Search depth 3 covers src/admin/com_xxx.xml and similar nested structures
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" ! -path "./build/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
EXT_ELEMENT=""
if [ -n "$MANIFEST" ]; then
EXT_ELEMENT=$(sed -n 's/.*<element>\([^<]*\)<\/element>.*/\1/p' "$MANIFEST" 2>/dev/null | head -1)
@@ -183,7 +184,7 @@ jobs:
sed -i "s/VERSION:[[:space:]]*${CURRENT}/VERSION: ${NEW_VERSION}/" README.md
# Update manifest (templateDetails.xml / *.xml with <extension>)
MANIFEST=$(find . -maxdepth 2 -name "*.xml" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" ! -path "./build/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
if [ -n "$MANIFEST" ]; then
echo "Manifest: ${MANIFEST}"
sed -i "s|<version>${CURRENT}</version>|<version>${NEW_VERSION}</version>|" "$MANIFEST"
@@ -277,6 +278,15 @@ jobs:
- name: Create package
run: |
# Detect source directory (src/ or htdocs/)
SOURCE_DIR="src"
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
if [ ! -d "$SOURCE_DIR" ]; then
echo "::error::No src/ or htdocs/ directory found"
exit 1
fi
echo "Source directory: ${SOURCE_DIR}"
mkdir -p build/package
rsync -av \
--exclude='sftp-config*' \
@@ -286,7 +296,10 @@ jobs:
--exclude='*.key' \
--exclude='.env*' \
--exclude='*.local' \
src/ build/package/
--exclude='.build-trigger' \
--exclude='.beta-trigger' \
--exclude='.rc-trigger' \
"${SOURCE_DIR}/" build/package/
echo "Package contents:"
ls -la build/package/ | head -20
+1 -1
View File
@@ -132,7 +132,7 @@ jobs:
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
# Parse manifest (portable — no grep -P)
MANIFEST=$(find . -maxdepth 2 -name "*.xml" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" ! -path "./build/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
if [ -z "$MANIFEST" ]; then
echo "No Joomla manifest found — skipping"
exit 0