-
-
Notifications
You must be signed in to change notification settings - Fork 133
55 lines (53 loc) · 2.07 KB
/
publishJavaDocs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: JavaDocs Publisher
# Executed automatically when a new PR is merged to master, if the release number already exists this job will fail
# This pipeline will build from main, upload the artifacts, and create the GitHub release
on:
workflow_run:
workflows: [ "Maven Central Continuous Delivery" ]
types: [ requested ]
branches:
- 'main'
workflow_dispatch:
jobs:
generate_java_docs:
env:
gpg.keyname: ${{ secrets.GPG_KEYNAME }}
gpg.passphrase: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-22.04
permissions:
contents: write # if you have a protection rule on your repository, you'll need to give write permission to the workflow.
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
check-latest: true
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.5
# Captures the engine version from the pom.xml
- name: Set Release Version Number
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Publish updated JavaDocs
uses: MathieuSoysal/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 21
target-folder: javadoc # url will be https://<username>.github.io/<repo>/javadoc, This can be left as nothing to generate javadocs in the root folder.
project: maven