From 55fd62166499cec7fd6926f26d2275c84315602d Mon Sep 17 00:00:00 2001 From: Murat K Ozcan <34237651+muratkeremozcan@users.noreply.github.com> Date: Thu, 20 Nov 2025 13:44:48 -0600 Subject: [PATCH] fix: enabled web bundles for test and dev (#948) * fix: enabled web bundles for test and dev * fix: only bundle non webskip agents * fix: addressed pr comments * fix: addressed pr comments --------- Co-authored-by: Murat Ozcan --- .github/workflows/bundle-latest.yaml | 106 ++++++++++++++++++++------- 1 file changed, 79 insertions(+), 27 deletions(-) diff --git a/.github/workflows/bundle-latest.yaml b/.github/workflows/bundle-latest.yaml index a963cecc..d8a0da0e 100644 --- a/.github/workflows/bundle-latest.yaml +++ b/.github/workflows/bundle-latest.yaml @@ -100,8 +100,53 @@ jobs: fi done - # Create index.html for GitHub Pages - cat > dist/bundles/index.html << 'EOF' + # Generate index.html dynamically based on actual bundles + TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M UTC") + COMMIT_SHA=$(git rev-parse --short HEAD) + + # Function to generate agent links for a module + generate_agent_links() { + local module=$1 + local agent_dir="dist/bundles/$module/agents" + + if [ ! -d "$agent_dir" ]; then + echo "" + return + fi + + local links="" + local count=0 + + # Find all XML files and generate links + for xml_file in "$agent_dir"/*.xml; do + if [ -f "$xml_file" ]; then + local agent_name=$(basename "$xml_file" .xml) + # Convert filename to display name (pm -> PM, tech-writer -> Tech Writer) + local display_name=$(echo "$agent_name" | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++) {if(length($i)==2) $i=toupper($i); else $i=toupper(substr($i,1,1)) tolower(substr($i,2));}}1') + + if [ $count -gt 0 ]; then + links="$links | " + fi + links="$links$display_name" + count=$((count + 1)) + fi + done + + echo "$links" + } + + # Generate agent links for each module + BMM_LINKS=$(generate_agent_links "bmm") + CIS_LINKS=$(generate_agent_links "cis") + BMGD_LINKS=$(generate_agent_links "bmgd") + + # Count agents for bulk downloads + BMM_COUNT=$(find dist/bundles/bmm/agents -name '*.xml' 2>/dev/null | wc -l | tr -d ' ') + CIS_COUNT=$(find dist/bundles/cis/agents -name '*.xml' 2>/dev/null | wc -l | tr -d ' ') + BMGD_COUNT=$(find dist/bundles/bmgd/agents -name '*.xml' 2>/dev/null | wc -l | tr -d ' ') + + # Create index.html + cat > dist/bundles/index.html << EOF @@ -132,50 +177,63 @@ jobs:

Available Modules

+ EOF + + # Add BMM section if agents exist + if [ -n "$BMM_LINKS" ]; then + cat >> dist/bundles/index.html << EOF

BMM (BMad Method)

- PM | - Architect | - TEA | - Developer | - Analyst | - Scrum Master | - UX Designer | - Tech Writer
+ $BMM_LINKS
📁 Browse All | 📦 Download Zip
-
-

BMB (BMad Builder)

- -
+ EOF + fi + # Add CIS section if agents exist + if [ -n "$CIS_LINKS" ]; then + cat >> dist/bundles/index.html << EOF

CIS (Creative Intelligence Suite)

+ $CIS_LINKS
📁 Browse Agents | 📦 Download Zip
+ EOF + fi + + # Add BMGD section if agents exist + if [ -n "$BMGD_LINKS" ]; then + cat >> dist/bundles/index.html << EOF

BMGD (Game Development)

+ $BMGD_LINKS
📁 Browse Agents | 📦 Download Zip
+ EOF + fi + + # Add bulk downloads section + cat >> dist/bundles/index.html << EOF

Bulk Downloads

Download all agents for a module as a zip archive:

Usage

@@ -193,12 +251,6 @@ jobs: EOF - # Replace placeholders - TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M UTC") - COMMIT_SHA=$(git rev-parse --short HEAD) - sed -i "s/\$TIMESTAMP/$TIMESTAMP/" dist/bundles/index.html - sed -i "s/\$COMMIT_SHA/$COMMIT_SHA/" dist/bundles/index.html - - name: Checkout bmad-bundles repo uses: actions/checkout@v4 with: