-
Notifications
You must be signed in to change notification settings - Fork 0
461 lines (405 loc) · 19.2 KB
/
Copy pathdeploy-snapshot.yml
File metadata and controls
461 lines (405 loc) · 19.2 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
name: Deploy Snapshot to GitHub Pages
on:
workflow_run:
workflows: ["Java CI with Maven"]
types:
- completed
branches: [main]
workflow_dispatch:
permissions:
contents: write # Required: push to gh-pages branch for snapshot deployment
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# Only run if maven workflow succeeded (for workflow_run trigger)
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for jgit timestamp provider
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'sandbox_target/*.target') }}
restore-keys: ${{ runner.os }}-maven-
- name: Build Update Site
run: mvn -Pproduct,repo -T 1C clean verify -DskipTests
- name: Prepare snapshot directory
run: |
mkdir -p gh-pages-content/snapshots/latest
cp -r sandbox_updatesite/target/repository/* gh-pages-content/snapshots/latest/
- name: Create or update composite metadata
run: |
cd gh-pages-content/snapshots
# Use current timestamp as fallback for manual triggers
TIMESTAMP="${{ github.event.head_commit.timestamp }}"
if [ -z "$TIMESTAMP" ]; then
TIMESTAMP="$(date +%s)000"
fi
# Create compositeContent.xml
cat > compositeContent.xml << EOF
<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Sandbox Snapshots'
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='$TIMESTAMP'/>
</properties>
<children size='1'>
<child location='latest'/>
</children>
</repository>
EOF
# Create compositeArtifacts.xml
cat > compositeArtifacts.xml << EOF
<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='Sandbox Snapshots'
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='$TIMESTAMP'/>
</properties>
<children size='1'>
<child location='latest'/>
</children>
</repository>
EOF
- name: Create modern dashboard index.html
run: |
cat > gh-pages-content/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sandbox - Eclipse JDT Cleanups & Tools Dashboard</title>
<style>
:root {
--primary: #3498db;
--primary-dark: #2c3e50;
--secondary: #2ecc71;
--warning: #f39c12;
--danger: #e74c3c;
--light-bg: #f8f9fa;
--card-shadow: 0 2px 8px rgba(0,0,0,0.1);
--card-hover-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: #333;
background: var(--light-bg);
}
.hero {
background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
color: white;
padding: 3rem 2rem;
text-align: center;
}
.hero h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
}
.hero p {
font-size: 1.2rem;
opacity: 0.9;
}
.badges {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.5rem;
margin-top: 1.5rem;
}
.badges img {
height: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.section {
margin-bottom: 3rem;
}
.section h2 {
color: var(--primary-dark);
font-size: 1.8rem;
margin-bottom: 1.5rem;
border-bottom: 3px solid var(--primary);
padding-bottom: 0.5rem;
}
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
}
.card {
background: white;
border-radius: 8px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: var(--card-hover-shadow);
}
.card h3 {
color: var(--primary-dark);
font-size: 1.3rem;
margin-bottom: 0.5rem;
}
.card p {
color: #666;
margin-bottom: 1rem;
}
.card a {
color: var(--primary);
text-decoration: none;
font-weight: 500;
}
.card a:hover {
text-decoration: underline;
}
.url-display {
background: var(--light-bg);
padding: 0.75rem;
border-radius: 4px;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
word-break: break-all;
margin-top: 0.5rem;
border-left: 4px solid var(--primary);
}
.badge-label {
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 12px;
font-size: 0.85rem;
font-weight: 500;
margin-top: 0.5rem;
}
.label-stable {
background: var(--secondary);
color: white;
}
.label-dev {
background: var(--warning);
color: white;
}
.install-steps {
background: white;
border-radius: 8px;
padding: 2rem;
box-shadow: var(--card-shadow);
}
.install-steps ol {
margin-left: 1.5rem;
}
.install-steps li {
margin-bottom: 0.75rem;
}
footer {
background: var(--primary-dark);
color: white;
padding: 2rem;
text-align: center;
margin-top: 3rem;
}
footer a {
color: var(--primary);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
@media (max-width: 640px) {
.hero h1 {
font-size: 1.8rem;
}
.card-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="hero">
<h1>🛠️ Sandbox</h1>
<p>Eclipse JDT Cleanups & Automated Code Modernization</p>
<div class="badges">
<a href="https://github.com/carstenartur/sandbox/actions/workflows/maven.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/maven.yml/badge.svg" alt="Maven CI">
</a>
<a href="https://github.com/carstenartur/sandbox/actions/workflows/codeql.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/codeql.yml/badge.svg" alt="CodeQL">
</a>
<a href="https://github.com/carstenartur/sandbox/actions/workflows/coverage.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/coverage.yml/badge.svg" alt="Coverage">
</a>
<a href="https://github.com/carstenartur/sandbox/actions/workflows/test-report.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/test-report.yml/badge.svg" alt="Tests">
</a>
<a href="https://github.com/carstenartur/sandbox/actions/workflows/benchmark.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/benchmark.yml/badge.svg" alt="Benchmarks">
</a>
<a href="https://github.com/carstenartur/sandbox/actions/workflows/deploy-snapshot.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/deploy-snapshot.yml/badge.svg" alt="Snapshot Deploy">
</a>
<a href="https://marketplace.eclipse.org/content/sandbox">
<img src="https://img.shields.io/badge/Eclipse%20Marketplace-Sandbox-blue" alt="Eclipse Marketplace">
</a>
</div>
</div>
<div class="container">
<section class="section">
<h2>📊 Quality & Reports</h2>
<div class="card-grid">
<div class="card">
<h3>🧪 Test Results</h3>
<p>JUnit test reports for all modules with detailed pass/fail statistics.</p>
<p style="margin: 10px 0;">
<a href="https://github.com/carstenartur/sandbox/actions/workflows/test-report.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/test-report.yml/badge.svg" alt="Test Report Status" style="height: 20px;">
</a>
</p>
<a href="tests/">View Test Reports →</a>
</div>
<div class="card">
<h3>📈 Code Coverage</h3>
<p>JaCoCo coverage reports showing test coverage across the entire codebase.</p>
<p style="margin: 10px 0;">
<a href="https://github.com/carstenartur/sandbox/actions/workflows/coverage.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/coverage.yml/badge.svg" alt="Coverage Status" style="height: 20px;">
</a>
</p>
<a href="coverage/">View Coverage Report →</a>
</div>
<div class="card">
<h3>⚡ Performance Benchmarks</h3>
<p>JMH benchmark results tracking performance over time.</p>
<p style="margin: 10px 0;">
<a href="https://github.com/carstenartur/sandbox/actions/workflows/benchmark.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/benchmark.yml/badge.svg" alt="Benchmark Status" style="height: 20px;">
</a>
</p>
<a href="dev/bench/">View Performance Charts →</a>
</div>
<div class="card">
<h3>🔍 Refactoring Mining</h3>
<p>LLM-powered commit analysis with DSL rule proposals</p>
<p style="margin: 10px 0;">
<a href="https://github.com/carstenartur/sandbox/actions/workflows/mining-core.yml">
<img src="https://github.com/carstenartur/sandbox/actions/workflows/mining-core.yml/badge.svg" alt="Mining Status" style="height: 20px;">
</a>
</p>
<a href="mining-report/">View Mining Results →</a>
</div>
</div>
</section>
<section class="section">
<h2>📦 Distribution</h2>
<div class="card-grid">
<div class="card">
<h3>Stable Release</h3>
<span class="badge-label label-stable">Recommended</span>
<p>Production-ready release with all features tested and validated.</p>
<div class="url-display">https://carstenartur.github.io/sandbox/releases/</div>
<p style="margin-top: 1rem;">
<a href="releases/">Browse Update Site →</a>
</p>
</div>
<div class="card">
<h3>Snapshot</h3>
<span class="badge-label label-dev">Development</span>
<p>Latest development snapshot, updated automatically on every commit.</p>
<div class="url-display">https://carstenartur.github.io/sandbox/snapshots/latest/</div>
<p style="margin-top: 1rem;">
<a href="snapshots/latest/">Browse Snapshot →</a>
</p>
</div>
</div>
</section>
<section class="section">
<h2>🚀 Quick Install</h2>
<div class="install-steps">
<ol>
<li>Open <strong>Eclipse IDE</strong></li>
<li>Go to <strong>Help → Install New Software...</strong></li>
<li>Click <strong>Add...</strong> to add a new update site</li>
<li>Enter a name (e.g., "Sandbox") and paste one of the update site URLs above</li>
<li>Select the cleanup features you want to install</li>
<li>Follow the installation wizard and accept the license</li>
<li>Restart Eclipse when prompted</li>
</ol>
</div>
</section>
<section class="section">
<h2>📚 Documentation & Links</h2>
<div class="card-grid">
<div class="card">
<h3>Source Code</h3>
<p>Browse the source code, open issues, and contribute to the project.</p>
<a href="https://github.com/carstenartur/sandbox">GitHub Repository →</a>
</div>
<div class="card">
<h3>Issues & Feedback</h3>
<p>Report bugs, request features, or ask questions.</p>
<a href="https://github.com/carstenartur/sandbox/issues">GitHub Issues →</a>
</div>
<!-- Placeholder for future feature
<div class="card">
<h3>API Documentation</h3>
<p>Javadoc documentation for all public APIs.</p>
<a href="javadoc/">View Javadoc →</a>
</div>
-->
</div>
</section>
</div>
<footer>
<p>
<strong>Sandbox Project</strong> |
Eclipse Public License 2.0 |
<a href="https://github.com/carstenartur/sandbox">Source Code</a> |
<a href="https://github.com/carstenartur/sandbox/issues">Report Issues</a>
</p>
<p style="margin-top: 1rem; font-size: 0.9rem; opacity: 0.8;">
© 2024–present Carsten Hammer and Contributors
</p>
</footer>
</body>
</html>
EOF
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./gh-pages-content
publish_branch: gh-pages
keep_files: true # Don't remove existing files (for releases)
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy snapshot update site'
- name: Report Deployed URLs
if: always()
run: |
echo "### 🔗 Deployed Resources" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📊 [View Dashboard](https://carstenartur.github.io/sandbox/)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📦 [Latest Snapshot Update Site](https://carstenartur.github.io/sandbox/snapshots/latest/)" >> $GITHUB_STEP_SUMMARY