-
Notifications
You must be signed in to change notification settings - Fork 9
103 lines (87 loc) · 3.24 KB
/
javadoc.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: javadoc
on:
push:
branches: [ dev ]
paths: [ '**.java', '.github/workflows/javadoc.yml' ]
release:
types: [created]
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: run javadoc_messageprops.py
run: python3 scripts/javadoc_messageprops.py messages/src/main/java/com/jwoglom/pumpx2/pump/messages/
- name: run javadoc_messageparse.py
run: python3 scripts/javadoc_messageparse.py messages/src/main/java/com/jwoglom/pumpx2/pump/messages/
- name: run javadoc_messagecargo.py
run: python3 scripts/javadoc_messagecargo.py messages/src/main/java/com/jwoglom/pumpx2/pump/messages/
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build docs with Maven
run: ./gradlew javadoc
- name: Checkout the gh-pages branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: gh-pages
path: gh-pages
- name: Copy to Documentation Website Location
run: |
mkdir -p gh-pages/javadoc/messages
rm -rf gh-pages/javadoc/messages
cp -rf messages/build/docs/javadoc/. gh-pages/javadoc/messages/
- name: Tidy up the javadocs
id: tidy
uses: cicirello/javadoc-cleanup@v1
with:
base-url-path: https://jwoglom.github.io/pumpx2/javadoc/
path-to-root: gh-pages/javadoc/messages
user-defined-block: |
<meta name="referrer" content="strict-origin-when-cross-origin">
- name: Log javadoc-cleanup output
run: |
echo "modified-count = ${{ steps.tidy.outputs.modified-count }}"
- name: Commit documentation changes without pushing yet
run: |
cd gh-pages
if [[ `git status --porcelain` ]]; then
git config --global user.name 'github-actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m "Javadoc update $(date)"
fi
cd ..
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://jwoglom.github.io/pumpx2/javadoc/
path-to-root: gh-pages
- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
- name: Commit documentation website sitemap and push all commits
run: |
cd gh-pages
if [[ `git status --porcelain` ]]; then
git config --global user.name 'github-actions'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add -A
git commit -m "Sitemap update $(date)"
fi
git push
cd ..