Skip to content

Commit c40c194

Browse files
authored
Merge pull request #696 from apache/fix_javadoc-yml
Fix javadoc yml in release branch 9.0.X
2 parents f3b334b + 8942b6c commit c40c194

File tree

1 file changed

+46
-47
lines changed

1 file changed

+46
-47
lines changed

.github/workflows/javadoc.yml

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,51 @@ jobs:
1616
build-and-deploy-javadoc:
1717
runs-on: ubuntu-latest
1818
permissions:
19-
contents: write
20-
pages: write
21-
id-token: write
19+
contents: write # Sufficient for checkout and pushing to gh-pages
2220

23-
steps:
24-
- name: Checkout Code at Specified Tag
25-
uses: actions/checkout@v5
26-
with:
27-
ref: ${{ github.event.inputs.tag_ref }} # from manual trigger input
28-
fetch-depth: 0
21+
steps:
22+
- name: Checkout Code at Specified Tag
23+
uses: actions/checkout@v5
24+
with:
25+
ref: ${{ github.event.inputs.tag_ref }} # from manual trigger input
26+
fetch-depth: 0
2927

30-
- name: Set up JDK
31-
uses: actions/setup-java@v4
32-
with:
33-
java-version: '25'
34-
distribution: 'temurin'
35-
cache: 'maven'
36-
37-
- name: Build and Generate Javadoc
38-
run: mvn javadoc:javadoc
39-
40-
- name: Deploy Javadoc to gh-pages/docs/${TAG}
41-
env:
42-
GH_PAGES_EMAIL: [email protected]
43-
GH_PAGES_NAME: github-actions[bot]
44-
GIT_TAG_NAME: ${{ github.event.inputs.tag_ref }}
45-
TARGET_DIR: docs/${{ github.event.inputs.tag_ref }}
46-
run: |
47-
# 1. Configure Git user
48-
git config user.email "${GH_PAGES_EMAIL}"
49-
git config user.name "${GH_PAGES_NAME}"
50-
51-
# 2. Fetch and checkout the existing gh-pages branch
52-
git fetch origin gh-pages:gh-pages
53-
git checkout gh-pages
54-
55-
# 3. Clean up any previous documentation for this tag (optional, but safer)
56-
rm -rf $TARGET_DIR
57-
58-
# 4. Create the versioned directory structure
59-
mkdir -p $TARGET_DIR
60-
61-
# 5. Copy the generated Javadoc files into the versioned directory
62-
cp -r target/reports/apidocs/* $TARGET_DIR/
63-
64-
# 6. Add the new directory and files, commit, and push
65-
git add $TARGET_DIR
66-
git commit -m "Manual Javadoc deployment for tag ${GIT_TAG_NAME} into $TARGET_DIR"
67-
git push origin gh-pages
28+
- name: Set up JDK
29+
uses: actions/setup-java@v4
30+
with:
31+
java-version: '25'
32+
distribution: 'temurin'
33+
cache: 'maven'
34+
35+
- name: Build and Generate Javadoc
36+
run: mvn javadoc:javadoc
37+
38+
- name: Deploy Javadoc to gh-pages/docs/${TAG}
39+
env:
40+
GH_PAGES_EMAIL: [email protected]
41+
GH_PAGES_NAME: github-actions[bot]
42+
GIT_TAG_NAME: ${{ github.event.inputs.tag_ref }}
43+
TARGET_DIR: docs/${{ github.event.inputs.tag_ref }}
44+
45+
run: |
46+
# 1. Configure Git user
47+
git config user.email "${GH_PAGES_EMAIL}"
48+
git config user.name "${GH_PAGES_NAME}"
49+
50+
# 2. Fetch and checkout the existing gh-pages branch (or create it if it doesn't exist)
51+
git fetch origin gh-pages:gh-pages
52+
git checkout gh-pages
53+
54+
# 3. Clean up any previous documentation for this tag (optional, but safer)
55+
rm -rf $TARGET_DIR
56+
57+
# 4. Create the versioned directory structure
58+
mkdir -p $TARGET_DIR
59+
60+
# 5. Copy the generated Javadoc files into the versioned directory
61+
cp -r target/reports/apidocs/* $TARGET_DIR/
62+
63+
# 6. Add the new directory and files, commit, and push
64+
git add $TARGET_DIR
65+
git commit -m "Manual Javadoc deployment for tag ${GIT_TAG_NAME} into $TARGET_DIR"
66+
git push origin gh-pages

0 commit comments

Comments
 (0)