Skip to content

Commit 449b5b3

Browse files
muratkeremozcanMurat Ozcan
andauthored
chore: github pages for web bundle (#898)
* chore: github pages for web bundle * docs: updated Bundle distribution setup * chore: addressed PR comments --------- Co-authored-by: Murat Ozcan <[email protected]>
1 parent 487d158 commit 449b5b3

File tree

7 files changed

+492
-17
lines changed

7 files changed

+492
-17
lines changed
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
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

.github/workflows/manual-release.yaml

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,52 @@ jobs:
6161
run: |
6262
sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.new_version }}"/' tools/installer/package.json
6363
64-
- name: Build project
65-
run: npm run build
64+
- name: Generate web bundles
65+
run: npm run bundle
66+
67+
- name: Package bundles for release
68+
run: |
69+
mkdir -p dist/release-bundles
70+
71+
# Create staging directory for each platform
72+
mkdir -p dist/staging/{claude-code,chatgpt,gemini}
73+
74+
# Collect all modules per platform
75+
cp -r src/modules/bmm/sub-modules/claude-code/* dist/staging/claude-code/ 2>/dev/null || true
76+
cp -r src/modules/bmb/sub-modules/claude-code/* dist/staging/claude-code/ 2>/dev/null || true
77+
cp -r src/modules/cis/sub-modules/claude-code/* dist/staging/claude-code/ 2>/dev/null || true
78+
79+
cp -r src/modules/bmm/sub-modules/chatgpt/* dist/staging/chatgpt/ 2>/dev/null || true
80+
cp -r src/modules/bmb/sub-modules/chatgpt/* dist/staging/chatgpt/ 2>/dev/null || true
81+
cp -r src/modules/cis/sub-modules/chatgpt/* dist/staging/chatgpt/ 2>/dev/null || true
82+
83+
cp -r src/modules/bmm/sub-modules/gemini/* dist/staging/gemini/ 2>/dev/null || true
84+
cp -r src/modules/bmb/sub-modules/gemini/* dist/staging/gemini/ 2>/dev/null || true
85+
cp -r src/modules/cis/sub-modules/gemini/* dist/staging/gemini/ 2>/dev/null || true
86+
87+
# Verify bundles were copied (fail if completely empty)
88+
for platform in claude-code chatgpt gemini; do
89+
if [ ! "$(ls -A dist/staging/$platform)" ]; then
90+
echo "❌ ERROR: No bundles found for $platform"
91+
echo "This likely means 'npm run bundle' failed or bundles weren't generated"
92+
exit 1
93+
fi
94+
echo "✅ $platform: $(find dist/staging/$platform -name '*.md' | wc -l) bundles"
95+
done
96+
97+
# Create platform-specific archives
98+
tar -czf dist/release-bundles/bmad-bundles-claude-code-v${{ steps.version.outputs.new_version }}.tar.gz \
99+
-C dist/staging/claude-code .
100+
101+
tar -czf dist/release-bundles/bmad-bundles-chatgpt-v${{ steps.version.outputs.new_version }}.tar.gz \
102+
-C dist/staging/chatgpt .
103+
104+
tar -czf dist/release-bundles/bmad-bundles-gemini-v${{ steps.version.outputs.new_version }}.tar.gz \
105+
-C dist/staging/gemini .
106+
107+
# Create all-platforms archive
108+
tar -czf dist/release-bundles/bmad-bundles-all-v${{ steps.version.outputs.new_version }}.tar.gz \
109+
-C dist/staging .
66110
67111
- name: Commit version bump
68112
run: |
@@ -151,23 +195,39 @@ jobs:
151195
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
152196
run: npm publish
153197

154-
- name: Create GitHub Release
155-
uses: actions/create-release@v1
156-
env:
157-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198+
- name: Create GitHub Release with Bundles
199+
uses: softprops/action-gh-release@v2
158200
with:
159201
tag_name: v${{ steps.version.outputs.new_version }}
160-
release_name: "BMad Method v${{ steps.version.outputs.new_version }}"
161-
body: ${{ steps.release_notes.outputs.RELEASE_NOTES }}
202+
name: "BMad Method v${{ steps.version.outputs.new_version }}"
203+
body: |
204+
${{ steps.release_notes.outputs.RELEASE_NOTES }}
205+
206+
## 📦 Web Bundles
207+
208+
Download platform-specific bundles for use in AI platforms:
209+
210+
- `bmad-bundles-claude-code-v${{ steps.version.outputs.new_version }}.tar.gz` - Claude Code / Claude Projects
211+
- `bmad-bundles-chatgpt-v${{ steps.version.outputs.new_version }}.tar.gz` - ChatGPT Custom Instructions
212+
- `bmad-bundles-gemini-v${{ steps.version.outputs.new_version }}.tar.gz` - Gemini Gems
213+
- `bmad-bundles-all-v${{ steps.version.outputs.new_version }}.tar.gz` - All platforms
214+
215+
**Latest bundles** (bleeding edge): https://bmad-code-org.github.io/bmad-bundles/
162216
draft: false
163-
prerelease: false
217+
prerelease: ${{ contains(steps.version.outputs.new_version, 'alpha') || contains(steps.version.outputs.new_version, 'beta') }}
218+
files: |
219+
dist/release-bundles/*.tar.gz
164220
165221
- name: Summary
166222
run: |
167-
echo "🎉 Successfully released v${{ steps.version.outputs.new_version }}!"
168-
echo "📦 Published to NPM with @latest tag"
169-
echo "🏷️ Git tag: v${{ steps.version.outputs.new_version }}"
170-
echo "✅ Users running 'npx bmad-method install' will now get version ${{ steps.version.outputs.new_version }}"
171-
echo ""
172-
echo "📝 Release notes preview:"
173-
cat release_notes.md
223+
echo "## 🎉 Successfully released v${{ steps.version.outputs.new_version }}!" >> $GITHUB_STEP_SUMMARY
224+
echo "" >> $GITHUB_STEP_SUMMARY
225+
echo "### 📦 Distribution" >> $GITHUB_STEP_SUMMARY
226+
echo "- **NPM**: Published with @latest tag" >> $GITHUB_STEP_SUMMARY
227+
echo "- **GitHub Release**: https://github.com/bmad-code-org/BMAD-METHOD/releases/tag/v${{ steps.version.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
228+
echo "- **Web Bundles**: Attached to GitHub Release (4 archives)" >> $GITHUB_STEP_SUMMARY
229+
echo "" >> $GITHUB_STEP_SUMMARY
230+
echo "### ✅ Installation" >> $GITHUB_STEP_SUMMARY
231+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
232+
echo "npx bmad-method@${{ steps.version.outputs.new_version }} install" >> $GITHUB_STEP_SUMMARY
233+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ flattened-codebase.xml
5454
#UAT template testing output files
5555
tools/template-test-generator/test-scenarios/
5656

57-
# Bundler temporary files
57+
# Bundler temporary files and generated bundles
5858
.bundler-temp/
5959

60+
# Generated web bundles (built by CI, not committed)
61+
src/modules/bmm/sub-modules/
62+
src/modules/bmb/sub-modules/
63+
src/modules/cis/sub-modules/
64+
src/modules/bmgd/sub-modules/
65+
6066
# Test Install Output
6167

6268
z*/.claude/settings.local.json

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ your-project/
233233
2. Run `*workflow-init` to set up your project workflow path
234234
3. Follow the [Quick Start](#-quick-start) guide above to choose your planning track
235235

236+
**Alternative:** [**Web Bundles**](./docs/USING_WEB_BUNDLES.md) - Use BMAD agents in Claude Projects, ChatGPT, or Gemini without installation
237+
236238
---
237239

238240
## 🎯 Working with Agents & Commands

0 commit comments

Comments
 (0)