diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3b65e54..a97722f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -40,14 +40,16 @@ jobs: java-version: 21 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 env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - # javadoc:aggregate gira sulla root del progetto. - # L'output viene scritto in target/site/apidocs/ (root), NON in flash/target/... + # javadoc:aggregate runs on the reactor root. + # 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 run: mvn -B --settings .github/settings.xml javadoc:aggregate -DskipTests env: @@ -57,10 +59,13 @@ jobs: - name: Verify JavaDoc output exists run: | 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 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 uses: actions/checkout@v4 @@ -72,10 +77,8 @@ jobs: - name: Copy JavaDoc to versioned folder and latest run: | VERSION=${{ inputs.version }} - # Versioned snapshot mkdir -p gh-pages-out/javadoc/$VERSION cp -r target/site/apidocs/. gh-pages-out/javadoc/$VERSION/ - # Always-current alias rm -rf gh-pages-out/latest mkdir -p gh-pages-out/latest cp -r target/site/apidocs/. gh-pages-out/latest/ @@ -96,38 +99,226 @@ jobs: reverse=True ) + latest = versions[0] if versions else None + rows = "\n".join( - f'
  • {v}
  • ' + f''' +
    +
    + {v} + {"latest" if v == latest else ""} +
    + + Open +
    + ''' for v in versions ) - html = f""" + html = """ - - - Flash JavaDoc + + + Flash — JavaDoc + + -

    Flash — JavaDoc

    -

    Browse the published API documentation for each release.

    - +
    + +
    +

    Flash JavaDoc

    + +

    + API documentation for all published Flash releases. +

    + + """ + ( + f''' + + Latest release — {latest} + + ''' + if latest else "" + ) + """ +
    + + """ + ( + f''' +
    + {rows} +
    + ''' + if rows else + ''' +
    + No versions published yet. +
    + ''' + ) + """ + +
    """ with open("index.html", "w", encoding="utf-8") as f: f.write(html) + print(f"index.html generated — {len(versions)} version(s): {versions}") EOF diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b31bd7..bf98511 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,9 @@ jobs: permissions: contents: write + outputs: + version: ${{ steps.version.outputs.VERSION }} + steps: - name: Checkout uses: actions/checkout@v4 @@ -55,10 +58,7 @@ jobs: draft: false prerelease: false - outputs: - version: ${{ steps.version.outputs.VERSION }} - - # ── 2. Publish JavaDoc (delegated to docs.yml — single source of truth) ─── + # ── 2. Publish JavaDoc (single source of truth: docs.yml) ───────────────── docs: name: Publish JavaDoc needs: release