Skip to content

Commit

Permalink
fix: add javadoc publish script
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
  • Loading branch information
padamstx committed Jan 9, 2025
1 parent 21d15ff commit 90cc197
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions build/publishJavadoc-gha.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Required environment variables:
# GH_TOKEN
# GH_REPO_SLUG
# GH_TAG

printf "\n>>>>> Publishing javadoc for release build: repo=%s tag=%s\n" ${GH_REPO_SLUG} ${GH_TAG}

printf "\n>>>>> Cloning repository's gh-pages branch into directory 'gh-pages'\n"
rm -fr ./gh-pages
git config --global user.email "devxsdk@us.ibm.com"
git config --global user.name "ibm-devx-sdk"
git clone --branch=gh-pages https://${GH_TOKEN}@github.com/IBM/platform-services-java-sdk.git gh-pages

printf "\n>>>>> Finished cloning...\n"

pushd gh-pages

# Create a new directory for this branch/tag and copy the javadocs there.
printf "\n>>>>> Copying javadocs to new directory: docs/%s\n" ${GH_TAG}
rm -rf docs/${GH_TAG}
mkdir -p docs/${GH_TAG}
cp -rf ../target/site/apidocs/* docs/${GH_TAG}

printf "\n>>>>> Generating gh-pages index.html...\n"
../build/generateJavadocIndex.sh > index.html

printf "\n>>>>> Committing new javadoc...\n"
git add -f .
git commit -m "docs: latest javadoc for ${GH_TAG}"
git push -f origin gh-pages

popd

printf "\n>>>>> Published javadoc for release build: repo=%s tag=%s\n" ${GH_REPO_SLUG} ${GH_TAG}

0 comments on commit 90cc197

Please sign in to comment.