-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (193 loc) · 7.62 KB
/
Copy pathbuild-dxt-artifacts.yml
File metadata and controls
227 lines (193 loc) · 7.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Build DXT Package Artifacts
on:
push:
branches: ['**'] # Trigger on all branches
pull_request:
branches: [main]
workflow_dispatch: # Allow manual trigger
jobs:
# Quality Gate Job - ensures code quality before building
quality-check:
name: Quality Assurance Pipeline
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run comprehensive quality checks
env:
# Securely inject BambooHR credentials for integration testing
# If secrets are missing/deleted, tests will gracefully skip
BAMBOO_API_KEY: ${{ secrets.BAMBOO_API_KEY }}
BAMBOO_SUBDOMAIN: ${{ secrets.BAMBOO_SUBDOMAIN }}
run: |
echo "🔍 Running fail-fast quality pipeline..."
# Check if integration testing credentials are available
if [ -n "$BAMBOO_API_KEY" ] && [ -n "$BAMBOO_SUBDOMAIN" ]; then
echo "🔑 BambooHR credentials available - integration tests will run"
else
echo "⚠️ BambooHR credentials not available - integration tests will be skipped"
echo " This is expected behavior if secrets are not configured"
fi
# Security audit
echo "🛡️ Security audit..."
npm audit --audit-level=high
# Code quality
echo "🧹 Code quality checks..."
npm run quality
# MCP protocol validation
echo "🔍 MCP protocol validation..."
npm run validate:protocol
# Test suite (includes integration tests if credentials available)
echo "🧪 Test execution..."
npm test
- name: Quality check summary
env:
# Need credentials to determine correct summary message
BAMBOO_API_KEY: ${{ secrets.BAMBOO_API_KEY }}
BAMBOO_SUBDOMAIN: ${{ secrets.BAMBOO_SUBDOMAIN }}
run: |
echo "## ✅ Quality Assurance Passed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- 🛡️ Security audit: No high/critical vulnerabilities" >> $GITHUB_STEP_SUMMARY
echo "- 🧹 Code quality: ESLint + Prettier + TypeScript passed" >> $GITHUB_STEP_SUMMARY
echo "- 🔍 MCP protocol: Latest version (2025-06-18) validated" >> $GITHUB_STEP_SUMMARY
if [ -n "$BAMBOO_API_KEY" ] && [ -n "$BAMBOO_SUBDOMAIN" ]; then
echo "- 🧪 Test suite: All tests passing (including BambooHR integration)" >> $GITHUB_STEP_SUMMARY
else
echo "- 🧪 Test suite: All tests passing (integration tests skipped - no credentials)" >> $GITHUB_STEP_SUMMARY
fi
# NPM Build Job
build-npm:
name: Build NPM Package
runs-on: ubuntu-latest
needs: quality-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build with quality assurance
run: |
echo "🔨 Building with comprehensive QA pipeline..."
chmod +x scripts/build.sh
./scripts/build.sh
- name: Upload NPM build artifacts
uses: actions/upload-artifact@v4
with:
name: npm-build-${{ github.sha }}
path: |
server/
package.json
manifest.json
README.md
LICENSE
retention-days: 30
if-no-files-found: error
# DXT Package Build Job
build-dxt:
name: Build DXT Package
runs-on: ubuntu-latest
needs: quality-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install DXT CLI
run: npm install -g @anthropic-ai/dxt
- name: Install dependencies
run: npm ci
- name: Build DXT package with quality assurance
run: |
echo "📦 Building DXT package with comprehensive QA..."
chmod +x scripts/build-dxt.sh
./scripts/build-dxt.sh
- name: Verify DXT package
run: |
echo "🔍 Verifying DXT package..."
if [ -d "dist" ] && ls dist/*.dxt 1> /dev/null 2>&1; then
DXT_FILE=$(ls dist/*.dxt | head -1)
DXT_SIZE=$(du -sh "$DXT_FILE" | cut -f1)
echo "✅ DXT package created: $(basename "$DXT_FILE") ($DXT_SIZE)"
# Validate the DXT package
if command -v dxt &> /dev/null; then
echo "🔍 Validating DXT package structure..."
cd dist
dxt validate "$(basename "$DXT_FILE")" || echo "⚠️ DXT validation completed with warnings"
cd ..
fi
else
echo "❌ No DXT package found!"
exit 1
fi
- name: Upload DXT package artifact
uses: actions/upload-artifact@v4
with:
name: bamboohr-mcp-dxt-${{ github.sha }}
path: dist/*.dxt
retention-days: 90
if-no-files-found: error
- name: Upload DXT build summary
uses: actions/upload-artifact@v4
with:
name: dxt-build-info-${{ github.sha }}
path: |
dist/bamboohr-mcp-latest.dxt
manifest.json
retention-days: 30
if-no-files-found: warn
# Summary Job
build-summary:
name: Build Summary
runs-on: ubuntu-latest
needs: [build-npm, build-dxt]
if: always()
steps:
- name: Generate build summary
run: |
echo "## 🚀 Build Pipeline Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.quality-check.result }}" = "success" ]; then
echo "✅ **Quality Assurance**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Quality Assurance**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.build-npm.result }}" = "success" ]; then
echo "✅ **NPM Build**: Completed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **NPM Build**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.build-dxt.result }}" = "success" ]; then
echo "✅ **DXT Package**: Created" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **DXT Package**: Failed" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📦 Available Artifacts" >> $GITHUB_STEP_SUMMARY
echo "- **NPM Build**: \`npm-build-${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **DXT Package**: \`bamboohr-mcp-dxt-${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📥 How to Download" >> $GITHUB_STEP_SUMMARY
echo "1. Go to the [Actions tab](../../actions)" >> $GITHUB_STEP_SUMMARY
echo "2. Click on this workflow run" >> $GITHUB_STEP_SUMMARY
echo "3. Scroll to the bottom and download artifacts" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔧 Installation" >> $GITHUB_STEP_SUMMARY
echo "- Download the DXT package artifact" >> $GITHUB_STEP_SUMMARY
echo "- Extract the \`.dxt\` file" >> $GITHUB_STEP_SUMMARY
echo "- Install in Claude Desktop via Settings → Extensions" >> $GITHUB_STEP_SUMMARY