Skip to content

Commit

Permalink
action to build and publish javadoc to pages (langchain4j#504)
Browse files Browse the repository at this point in the history
Adds the following:

 * add maven plugin for generating javadoc 
 * action to build and publish javadoc to pages
 * update javadoc link in docusaurus
  • Loading branch information
LizeRaes authored Jan 12, 2024
1 parent aba5eeb commit 8815372
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/javadoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Javadoc
# in folder apidocs/

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check Out Source Code
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'

- name: Generate Javadoc
run: mvn javadoc:aggregate -DskipTests -pl '!langchain4j-opensearch,!code-execution-engines/langchain4j-code-execution-engine-graalvm-polyglot,!langchain4j-neo4j'

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload site folder
path: './target/site/.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const config = {
},
{to: '/docs/tutorials', label: 'Tutorials', position: 'left'},
{to: '/docs/category/integrations', label: 'Integrations', position: 'left'},
{to: 'https://langchain4j.dev/javadoc/', label: 'Javadoc', position: 'left'},
{to: 'https://lizeraes.github.io/langchain4j/apidocs/', label: 'Javadoc', position: 'left'},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/langchain4j/langchain4j',
Expand Down
51 changes: 51 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,55 @@

</modules>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<reportSets>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
<reportSet>
<id>default</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>


</project>

0 comments on commit 8815372

Please sign in to comment.