Skip to content

Commit

Permalink
docs: release JavaDocs using Maven
Browse files Browse the repository at this point in the history
  • Loading branch information
lentidas committed Oct 16, 2024
1 parent 031b29c commit 4cf6dec
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/publish-javadoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@ on:
- main

jobs:
publish-javadoc:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc documentation
uses: MathieuSoysal/Javadoc-publisher.yml@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 17
project: maven
javadoc-source-folder: .
custom-command: javadoc -d . -private -sourcepath src/main/java/ch/heigvd/dai -subpackages commands -subpackages exceptions -subpackages utilities
- name: "Check out the repository"
uses: actions/checkout@v4

- name: "Setup Java and Maven"
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: "Build JavaDoc using Maven"
run: mvn javadoc:javadoc

- name: "Upload JavaDoc as an artifact"
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: target/reports/apidocs

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: "Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v4
8 changes: 8 additions & 0 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
</java>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@
</executions>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
</configuration>
</plugin>

<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 4cf6dec

Please sign in to comment.