Repository navigation
61 lines (57 loc) · 1.9 KB
/
Copy pathpublish-java-apidocs.yml
File metadata and controls
61 lines (57 loc) · 1.9 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
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 }}"
]
timeout-minutes: 120
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up JDK 11
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Gradle
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: onnxruntime-java-apidocs
path: _site
retention-days: 10