ci: fix javadoc path, encoding and delegate docs to docs.yml
This commit is contained in:
+215
-24
@@ -40,14 +40,16 @@ jobs:
|
|||||||
java-version: 21
|
java-version: 21
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Build project (resolve deps + compile, skip tests)
|
- name: Build project (compile + resolve deps, skip tests)
|
||||||
run: mvn -B --settings .github/settings.xml clean verify -DskipTests
|
run: mvn -B --settings .github/settings.xml clean verify -DskipTests
|
||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
|
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
|
||||||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
||||||
|
|
||||||
# javadoc:aggregate gira sulla root del progetto.
|
# javadoc:aggregate runs on the reactor root.
|
||||||
# L'output viene scritto in target/site/apidocs/ (root), NON in flash/target/...
|
# With flash + flash-extensions both declared as modules in root pom.xml,
|
||||||
|
# this produces a single aggregated Javadoc covering all modules.
|
||||||
|
# Default output path: target/site/apidocs/ (no custom reportOutputDirectory set).
|
||||||
- name: Generate aggregated JavaDoc
|
- name: Generate aggregated JavaDoc
|
||||||
run: mvn -B --settings .github/settings.xml javadoc:aggregate -DskipTests
|
run: mvn -B --settings .github/settings.xml javadoc:aggregate -DskipTests
|
||||||
env:
|
env:
|
||||||
@@ -57,10 +59,13 @@ jobs:
|
|||||||
- name: Verify JavaDoc output exists
|
- name: Verify JavaDoc output exists
|
||||||
run: |
|
run: |
|
||||||
if [ ! -f "target/site/apidocs/index.html" ]; then
|
if [ ! -f "target/site/apidocs/index.html" ]; then
|
||||||
echo "ERROR: target/site/apidocs/index.html not found. JavaDoc generation failed."
|
echo "ERROR: target/site/apidocs/index.html not found."
|
||||||
|
echo "Contents of target/site (if any):"
|
||||||
|
find target/site -maxdepth 3 2>/dev/null || echo "(empty)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "JavaDoc OK — $(find target/site/apidocs -name '*.html' | wc -l) HTML files generated."
|
COUNT=$(find target/site/apidocs -name '*.html' | wc -l)
|
||||||
|
echo "JavaDoc OK — $COUNT HTML files at target/site/apidocs/"
|
||||||
|
|
||||||
- name: Checkout gh-pages
|
- name: Checkout gh-pages
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -72,10 +77,8 @@ jobs:
|
|||||||
- name: Copy JavaDoc to versioned folder and latest
|
- name: Copy JavaDoc to versioned folder and latest
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ inputs.version }}
|
VERSION=${{ inputs.version }}
|
||||||
# Versioned snapshot
|
|
||||||
mkdir -p gh-pages-out/javadoc/$VERSION
|
mkdir -p gh-pages-out/javadoc/$VERSION
|
||||||
cp -r target/site/apidocs/. gh-pages-out/javadoc/$VERSION/
|
cp -r target/site/apidocs/. gh-pages-out/javadoc/$VERSION/
|
||||||
# Always-current alias
|
|
||||||
rm -rf gh-pages-out/latest
|
rm -rf gh-pages-out/latest
|
||||||
mkdir -p gh-pages-out/latest
|
mkdir -p gh-pages-out/latest
|
||||||
cp -r target/site/apidocs/. gh-pages-out/latest/
|
cp -r target/site/apidocs/. gh-pages-out/latest/
|
||||||
@@ -96,38 +99,226 @@ jobs:
|
|||||||
reverse=True
|
reverse=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
latest = versions[0] if versions else None
|
||||||
|
|
||||||
rows = "\n".join(
|
rows = "\n".join(
|
||||||
f' <li><a href="javadoc/{v}/index.html">{v}</a></li>'
|
f'''
|
||||||
|
<div class="release">
|
||||||
|
<div class="release-info">
|
||||||
|
<span class="version">{v}</span>
|
||||||
|
{"<span class=\\"badge\\">latest</span>" if v == latest else ""}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a href="javadoc/{v}/index.html">Open</a>
|
||||||
|
</div>
|
||||||
|
'''
|
||||||
for v in versions
|
for v in versions
|
||||||
)
|
)
|
||||||
|
|
||||||
html = f"""<!DOCTYPE html>
|
html = """<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Flash JavaDoc</title>
|
<title>Flash — JavaDoc</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {{ font-family: Inter, Arial, sans-serif; max-width: 720px; margin: 5rem auto; padding: 0 1.5rem; color: #1f2937; background: #fff; }}
|
:root {
|
||||||
h1 {{ font-size: 2rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }}
|
--bg: #ffffff;
|
||||||
p {{ color: #6b7280; line-height: 1.6; }}
|
--surface: #fafafa;
|
||||||
ul {{ list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid #e5e7eb; }}
|
--border: #e5e7eb;
|
||||||
li {{ border-bottom: 1px solid #e5e7eb; }}
|
|
||||||
a {{ display: block; padding: 1rem 0; color: #111827; text-decoration: none; font-weight: 600; }}
|
--text: #111827;
|
||||||
a:hover {{ text-decoration: underline; }}
|
--muted: #6b7280;
|
||||||
|
|
||||||
|
--accent: #111827;
|
||||||
|
--accent-hover: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family:
|
||||||
|
Inter,
|
||||||
|
ui-sans-serif,
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
sans-serif;
|
||||||
|
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 64px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 760px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: -0.04em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header p {
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.latest {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
margin-top: 20px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
|
||||||
|
color: var(--accent);
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
|
||||||
|
transition:
|
||||||
|
border-color 0.15s ease,
|
||||||
|
color 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.latest:hover {
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.release {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
gap: 16px;
|
||||||
|
|
||||||
|
padding: 18px 0;
|
||||||
|
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.release-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
font-size: 0.96rem;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
font-size: 0.72rem;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
color: var(--muted);
|
||||||
|
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
padding: 2px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.release a {
|
||||||
|
color: var(--accent);
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 0.92rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.release a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
padding: 32px 0;
|
||||||
|
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
body {
|
||||||
|
padding: 40px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-size: 1.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.release {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Flash — JavaDoc</h1>
|
<div class="container">
|
||||||
<p>Browse the published API documentation for each release.</p>
|
|
||||||
<ul>
|
<header class="header">
|
||||||
{rows}
|
<h1>Flash JavaDoc</h1>
|
||||||
</ul>
|
|
||||||
|
<p>
|
||||||
|
API documentation for all published Flash releases.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
""" + (
|
||||||
|
f'''
|
||||||
|
<a class="latest" href="latest/index.html">
|
||||||
|
Latest release — {latest}
|
||||||
|
</a>
|
||||||
|
'''
|
||||||
|
if latest else ""
|
||||||
|
) + """
|
||||||
|
</header>
|
||||||
|
|
||||||
|
""" + (
|
||||||
|
f'''
|
||||||
|
<div class="list">
|
||||||
|
{rows}
|
||||||
|
</div>
|
||||||
|
'''
|
||||||
|
if rows else
|
||||||
|
'''
|
||||||
|
<div class="empty">
|
||||||
|
No versions published yet.
|
||||||
|
</div>
|
||||||
|
'''
|
||||||
|
) + """
|
||||||
|
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
|
|
||||||
with open("index.html", "w", encoding="utf-8") as f:
|
with open("index.html", "w", encoding="utf-8") as f:
|
||||||
f.write(html)
|
f.write(html)
|
||||||
|
|
||||||
print(f"index.html generated — {len(versions)} version(s): {versions}")
|
print(f"index.html generated — {len(versions)} version(s): {versions}")
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -55,10 +58,7 @@ jobs:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
outputs:
|
# ── 2. Publish JavaDoc (single source of truth: docs.yml) ─────────────────
|
||||||
version: ${{ steps.version.outputs.VERSION }}
|
|
||||||
|
|
||||||
# ── 2. Publish JavaDoc (delegated to docs.yml — single source of truth) ───
|
|
||||||
docs:
|
docs:
|
||||||
name: Publish JavaDoc
|
name: Publish JavaDoc
|
||||||
needs: release
|
needs: release
|
||||||
|
|||||||
Reference in New Issue
Block a user