This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch fix_javadoc_yml_2
in repository https://gitbox.apache.org/repos/asf/datasketches-java.git
The following commit(s) were added to refs/heads/fix_javadoc_yml_2 by this push:
new 2602f2e33 update javadoc.yml and ManualJavadocsDeploy.sh
2602f2e33 is described below
commit 2602f2e334a21abcd9bffdb65e7f487dea195a8e
Author: Lee Rhodes <[email protected]>
AuthorDate: Tue Jan 6 14:12:27 2026 -0800
update javadoc.yml and ManualJavadocsDeploy.sh
---
.github/workflows/javadoc.yml | 28 ++++++++++++++++++----------
tools/ManualJavadocsDeploy.sh | 15 +++++++++++----
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml
index eb68e1619..e7c8d1ad4 100644
--- a/.github/workflows/javadoc.yml
+++ b/.github/workflows/javadoc.yml
@@ -34,12 +34,14 @@ jobs:
cache: 'maven'
- name: Build and Generate Javadoc # POM is configured to output to
target/site/apidocs
- run: mvn javadoc:javadoc
+ run: mvn clean javadoc:javadoc
- name: Deploy Javadoc via Worktree
env:
TAG_NAME: ${{ github.event.inputs.tag_ref }}
run: |
+ if [ -z "$TAG_NAME" ]; then echo "ERROR: No tag specified"; exit 1;
fi
+
# 1. Initialize error tracking
EXIT_CODE=0
@@ -48,37 +50,42 @@ jobs:
git config user.name "github-actions[bot]"
# 3. Ensure gh-pages exists and is fetched
- echo "git fetch origin gh-pages"
+ echo "ECHO: git fetch origin gh-pages"
git fetch origin gh-pages
# 4. Create worktree for the gh-pages branch in a separate folder
- echo "git worktree add ./gh-pages-dir origin/gh-pages"
- git worktree add ./gh-pages-dir origin/gh-pages
+ echo "ECHO: git worktree add -B gh-pages ./gh-pages-dir
origin/gh-pages"
+ git worktree add -B gh-pages ./gh-pages-dir origin/gh-pages
# 5. Deployment Logic in a subshell to capture exit code
(
set -e
TARGET_PATH="gh-pages-dir/docs/$TAG_NAME"
mkdir -p "$TARGET_PATH"
- echo "cp -a target/site/apidocs/. $TARGET_PATH/"
+
+ echo "ECHO: cp -a target/site/apidocs/. $TARGET_PATH/"
cp -a target/site/apidocs/. "$TARGET_PATH/"
cd gh-pages-dir
+
+ echo "ECHO: git pull origin gh-pages --rebase"
+ git pull origin gh-pages --rebase
+
echo "git add docs/$TAG_NAME"
git add "docs/$TAG_NAME"
if git diff --staged --quiet; then
echo "No changes detected for Javadoc $TAG_NAME."
else
- echo "Changes detected for Javadoc $TAG_NAME."
- echo "git commit ..."
+ echo "ECHO: Changes detected for Javadoc $TAG_NAME."
+ echo "ECHO: git commit ..."
git commit -m "Manual Javadoc deployment for tag $TAG_NAME"
- echo "git push origin gh-pages"
+ echo "ECHO: git push origin gh-pages"
git push origin gh-pages
fi
) || EXIT_CODE=$?
# 6. Cleanup (Always runs)
- echo "Cleaning up worktree..."
+ echo "ECHO: Cleaning up worktree..."
git worktree remove --force ./gh-pages-dir || true
# 7. Final exit based on subshell success
@@ -86,4 +93,5 @@ jobs:
- name: Confirm Deployment
if: success()
- run: echo "Javadoc for ${{ github.event.inputs.tag_ref }} is now live
on gh-pages."
+ run: echo "ECHO: Javadoc for ${{ github.event.inputs.tag_ref }} is now
live on gh-pages."
+
diff --git a/tools/ManualJavadocsDeploy.sh b/tools/ManualJavadocsDeploy.sh
index 844efb88c..78637ee02 100755
--- a/tools/ManualJavadocsDeploy.sh
+++ b/tools/ManualJavadocsDeploy.sh
@@ -19,8 +19,10 @@ EXIT_CODE=0
mkdir -p "$TARGET_PATH"
cp -a target/site/apidocs/. "$TARGET_PATH/"
cd gh-pages-dir
+
echo "ECHO: git pull origin gh-pages --rebase"
git pull origin gh-pages --rebase
+
echo "ECHO: git add docs/$TAG_NAME"
git add "docs/$TAG_NAME"
@@ -41,7 +43,12 @@ EXIT_CODE=0
echo "ECHO: Cleaning up worktree..."
git worktree remove --force ./gh-pages-dir || true
-# Final exit based on subshell success
-exit $EXIT_CODE
-if: success()
-run: echo "ECHO: Javadoc for $TAG_NAME is now live on gh-pages."
\ No newline at end of file
+# Check the exit code and report success or failure
+if [ $EXIT_CODE -eq 0 ]; then
+ echo "ECHO: Javadoc for $TAG_NAME is now live on gh-pages."
+else
+ echo "ECHO: Javadoc deployment failed for $TAG_NAME."
+fi
+
+# Final exit
+exit $EXIT_CODE
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]