Update Java API Docs #60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Java API Docs | |
| # Run when the Java API changes or every week so that the artifact does not expire. | |
| # Also runs on pull requests that touch relevant files so doc generation errors | |
| # are caught early. The artifact is only published on the main branch. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - java/** | |
| pull_request: | |
| paths: | |
| - java/** | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| concurrency: | |
| group: "apidocs-java-${{ github.ref }}" | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Generate Java docs | |
| runs-on: [ | |
| "self-hosted", | |
| "1ES.Pool=onnxruntime-github-Ubuntu2204-AMD-CPU", | |
| "JobId=apidocs-java-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" | |
| ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '11' | |
| distribution: 'adopt' | |
| - name: Build with Gradle | |
| uses: gradle/gradle-build-action@v3 | |
| with: | |
| build-root-directory: java | |
| gradle-executable: java/gradlew | |
| arguments: javadoc | |
| - name: Log source commit | |
| run: git rev-parse --short HEAD > java/build/docs/javadoc/source-version.txt | |
| - name: Move Java docs into site | |
| run: | | |
| rm -rf _site/docs/api/java | |
| mkdir -p _site/docs/api | |
| mv java/build/docs/javadoc _site/docs/api/java | |
| - name: Upload new site | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: onnxruntime-java-apidocs | |
| path: _site | |
| retention-days: 10 |