|
| 1 | +name: Publish Latest Bundles |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + workflow_dispatch: {} |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + bundle-and-publish: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout BMAD-METHOD |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version-file: ".nvmrc" |
| 24 | + cache: npm |
| 25 | + |
| 26 | + - name: Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Generate bundles |
| 30 | + run: npm run bundle |
| 31 | + |
| 32 | + - name: Create bundle distribution structure |
| 33 | + run: | |
| 34 | + mkdir -p dist/bundles |
| 35 | +
|
| 36 | + # Copy bundles with clean structure |
| 37 | + cp -r src/modules/bmm/sub-modules/* dist/bundles/ 2>/dev/null || true |
| 38 | + cp -r src/modules/bmb/sub-modules/* dist/bundles/ 2>/dev/null || true |
| 39 | + cp -r src/modules/cis/sub-modules/* dist/bundles/ 2>/dev/null || true |
| 40 | +
|
| 41 | + # Verify bundles were copied (fail if completely empty) |
| 42 | + if [ ! "$(ls -A dist/bundles)" ]; then |
| 43 | + echo "❌ ERROR: No bundles found in dist/bundles/" |
| 44 | + echo "This likely means 'npm run bundle' failed or bundles weren't generated" |
| 45 | + exit 1 |
| 46 | + fi |
| 47 | +
|
| 48 | + # Count bundles per platform |
| 49 | + for platform in claude-code chatgpt gemini; do |
| 50 | + if [ -d "dist/bundles/$platform" ]; then |
| 51 | + COUNT=$(find dist/bundles/$platform -name '*.md' 2>/dev/null | wc -l) |
| 52 | + echo "✅ $platform: $COUNT bundles" |
| 53 | + fi |
| 54 | + done |
| 55 | +
|
| 56 | + # Create index.html for GitHub Pages |
| 57 | + cat > dist/bundles/index.html << 'EOF' |
| 58 | + <!DOCTYPE html> |
| 59 | + <html> |
| 60 | + <head> |
| 61 | + <title>BMAD Bundles - Latest</title> |
| 62 | + <meta charset="utf-8"> |
| 63 | + <style> |
| 64 | + body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; } |
| 65 | + h1 { color: #333; } |
| 66 | + .platform { margin: 30px 0; padding: 20px; background: #f5f5f5; border-radius: 8px; } |
| 67 | + .module { margin: 15px 0; } |
| 68 | + a { color: #0066cc; text-decoration: none; } |
| 69 | + a:hover { text-decoration: underline; } |
| 70 | + code { background: #e0e0e0; padding: 2px 6px; border-radius: 3px; } |
| 71 | + .warning { background: #fff3cd; padding: 15px; border-left: 4px solid #ffc107; margin: 20px 0; } |
| 72 | + </style> |
| 73 | + </head> |
| 74 | + <body> |
| 75 | + <h1>BMAD Web Bundles - Latest (Main Branch)</h1> |
| 76 | +
|
| 77 | + <div class="warning"> |
| 78 | + <strong>⚠️ Latest Build (Unstable)</strong><br> |
| 79 | + These bundles are built from the latest main branch commit. For stable releases, visit |
| 80 | + <a href="https://github.com/bmad-code-org/BMAD-METHOD/releases/latest">GitHub Releases</a>. |
| 81 | + </div> |
| 82 | +
|
| 83 | + <p><strong>Last Updated:</strong> <code>$TIMESTAMP</code></p> |
| 84 | + <p><strong>Commit:</strong> <code>$COMMIT_SHA</code></p> |
| 85 | +
|
| 86 | + <h2>Available Platforms</h2> |
| 87 | +
|
| 88 | + <div class="platform"> |
| 89 | + <h3>Claude Code</h3> |
| 90 | + <div class="module"> |
| 91 | + <strong>BMM (BMad Method)</strong><br> |
| 92 | + <a href="./claude-code/sub-agents/bmm-agent-pm.md">PM Agent</a> | |
| 93 | + <a href="./claude-code/sub-agents/bmm-agent-architect.md">Architect</a> | |
| 94 | + <a href="./claude-code/sub-agents/bmm-agent-tea.md">TEA</a> | |
| 95 | + <a href="./claude-code/sub-agents/bmm-agent-dev.md">Developer</a> | |
| 96 | + <a href="./claude-code/sub-agents/">All BMM Agents</a> |
| 97 | + </div> |
| 98 | + <div class="module"> |
| 99 | + <strong>BMB (BMad Builder)</strong><br> |
| 100 | + <a href="./claude-code/sub-agents/bmb-agent-builder.md">Builder Agent</a> |
| 101 | + </div> |
| 102 | + <div class="module"> |
| 103 | + <strong>CIS (Creative Intelligence Suite)</strong><br> |
| 104 | + <a href="./claude-code/sub-agents/">CIS Agents</a> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | +
|
| 108 | + <div class="platform"> |
| 109 | + <h3>ChatGPT</h3> |
| 110 | + <div class="module"> |
| 111 | + <strong>BMM</strong>: <a href="./chatgpt/sub-agents/">Browse BMM Agents</a><br> |
| 112 | + <strong>BMB</strong>: <a href="./chatgpt/sub-agents/">Browse BMB Agents</a><br> |
| 113 | + <strong>CIS</strong>: <a href="./chatgpt/sub-agents/">Browse CIS Agents</a> |
| 114 | + </div> |
| 115 | + </div> |
| 116 | +
|
| 117 | + <div class="platform"> |
| 118 | + <h3>Gemini</h3> |
| 119 | + <div class="module"> |
| 120 | + <strong>BMM</strong>: <a href="./gemini/sub-agents/">Browse BMM Agents</a><br> |
| 121 | + <strong>BMB</strong>: <a href="./gemini/sub-agents/">Browse BMB Agents</a><br> |
| 122 | + <strong>CIS</strong>: <a href="./gemini/sub-agents/">Browse CIS Agents</a> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | +
|
| 126 | + <h2>Usage</h2> |
| 127 | + <p>Copy the raw markdown URL and paste into your AI platform's custom instructions or project knowledge.</p> |
| 128 | + <p>Example: <code>https://raw.githubusercontent.com/bmad-code-org/bmad-bundles/main/claude-code/sub-agents/bmm-agent-pm.md</code></p> |
| 129 | +
|
| 130 | + <h2>Installation (Recommended)</h2> |
| 131 | + <p>For full IDE integration with slash commands, use the installer:</p> |
| 132 | + <pre>npx bmad-method@alpha install</pre> |
| 133 | +
|
| 134 | + <footer style="margin-top: 50px; padding-top: 20px; border-top: 1px solid #ccc; color: #666;"> |
| 135 | + <p>Built from <a href="https://github.com/bmad-code-org/BMAD-METHOD">BMAD-METHOD</a> repository.</p> |
| 136 | + </footer> |
| 137 | + </body> |
| 138 | + </html> |
| 139 | + EOF |
| 140 | +
|
| 141 | + # Replace placeholders |
| 142 | + TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M UTC") |
| 143 | + COMMIT_SHA=$(git rev-parse --short HEAD) |
| 144 | + sed -i "s/\$TIMESTAMP/$TIMESTAMP/" dist/bundles/index.html |
| 145 | + sed -i "s/\$COMMIT_SHA/$COMMIT_SHA/" dist/bundles/index.html |
| 146 | +
|
| 147 | + - name: Checkout bmad-bundles repo |
| 148 | + uses: actions/checkout@v4 |
| 149 | + with: |
| 150 | + repository: bmad-code-org/bmad-bundles |
| 151 | + path: bmad-bundles |
| 152 | + token: ${{ secrets.BUNDLES_PAT }} |
| 153 | + |
| 154 | + - name: Update bundles |
| 155 | + run: | |
| 156 | + # Clear old bundles |
| 157 | + rm -rf bmad-bundles/* |
| 158 | +
|
| 159 | + # Copy new bundles |
| 160 | + cp -r dist/bundles/* bmad-bundles/ |
| 161 | +
|
| 162 | + # Create .nojekyll for GitHub Pages |
| 163 | + touch bmad-bundles/.nojekyll |
| 164 | +
|
| 165 | + # Create README |
| 166 | + cat > bmad-bundles/README.md << 'EOF' |
| 167 | + # BMAD Web Bundles (Latest) |
| 168 | +
|
| 169 | + **⚠️ Unstable Build**: These bundles are auto-generated from the latest `main` branch. |
| 170 | +
|
| 171 | + For stable releases, visit [GitHub Releases](https://github.com/bmad-code-org/BMAD-METHOD/releases/latest). |
| 172 | +
|
| 173 | + ## Usage |
| 174 | +
|
| 175 | + Copy raw markdown URLs for use in AI platforms: |
| 176 | +
|
| 177 | + - Claude Code: `https://raw.githubusercontent.com/bmad-code-org/bmad-bundles/main/claude-code/sub-agents/{agent}.md` |
| 178 | + - ChatGPT: `https://raw.githubusercontent.com/bmad-code-org/bmad-bundles/main/chatgpt/sub-agents/{agent}.md` |
| 179 | + - Gemini: `https://raw.githubusercontent.com/bmad-code-org/bmad-bundles/main/gemini/sub-agents/{agent}.md` |
| 180 | +
|
| 181 | + ## Browse |
| 182 | +
|
| 183 | + Visit [https://bmad-code-org.github.io/bmad-bundles/](https://bmad-code-org.github.io/bmad-bundles/) to browse bundles. |
| 184 | +
|
| 185 | + ## Installation (Recommended) |
| 186 | +
|
| 187 | + For full IDE integration: |
| 188 | + ```bash |
| 189 | + npx bmad-method@alpha install |
| 190 | + ``` |
| 191 | +
|
| 192 | + --- |
| 193 | +
|
| 194 | + Auto-updated by [BMAD-METHOD](https://github.com/bmad-code-org/BMAD-METHOD) on every main branch merge. |
| 195 | + EOF |
| 196 | +
|
| 197 | + - name: Commit and push to bmad-bundles |
| 198 | + run: | |
| 199 | + cd bmad-bundles |
| 200 | + git config user.name "github-actions[bot]" |
| 201 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 202 | +
|
| 203 | + git add . |
| 204 | +
|
| 205 | + if git diff --staged --quiet; then |
| 206 | + echo "No changes to bundles, skipping commit" |
| 207 | + else |
| 208 | + COMMIT_SHA=$(cd .. && git rev-parse --short HEAD) |
| 209 | + git commit -m "Update bundles from BMAD-METHOD@${COMMIT_SHA}" |
| 210 | + git push |
| 211 | + echo "✅ Bundles published to GitHub Pages" |
| 212 | + fi |
| 213 | +
|
| 214 | + - name: Summary |
| 215 | + run: | |
| 216 | + echo "## 🎉 Bundles Published!" >> $GITHUB_STEP_SUMMARY |
| 217 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 218 | + echo "**Latest bundles** available at:" >> $GITHUB_STEP_SUMMARY |
| 219 | + echo "- 🌐 Browse: https://bmad-code-org.github.io/bmad-bundles/" >> $GITHUB_STEP_SUMMARY |
| 220 | + echo "- 📦 Raw files: https://github.com/bmad-code-org/bmad-bundles" >> $GITHUB_STEP_SUMMARY |
| 221 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 222 | + echo "**Commit**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY |
0 commit comments