76
76
distribution : temurin
77
77
java-version : 21
78
78
79
+ - name : Set up Git Hub Pages
80
+ uses : actions/configure-pages@v5
81
+
79
82
- name : Cache Gradle packages
80
83
uses : actions/cache@v4
81
84
with :
@@ -91,16 +94,40 @@ jobs:
91
94
- name : Install PCRE
92
95
run : sudo apt-get install -y libpcre2-8-0
93
96
94
- - name : Build
97
+ - name : Build artifacts
95
98
run : ./gradlew build jacocoAggregatedTestReport -Dpcre2.library.path=/usr/lib/x86_64-linux-gnu
96
99
100
+ - name : Build docs
101
+ run : |
102
+ sudo apt-get install -y pandoc
103
+
104
+ mkdir -p build/gh-pages
105
+ pandoc -f gfm -t html5 -s --shift-heading-level-by=-1 --lua-filter=gh-pages/filter.lua \
106
+ -o build/gh-pages/index.html README.md
107
+ pandoc -f gfm -t html5 -s --shift-heading-level-by=-1 --lua-filter=gh-pages/filter.lua \
108
+ -o build/gh-pages/pcre2-api.html PCRE2_API.md
109
+
110
+ mkdir -p build/gh-pages/docs
111
+ pandoc -f markdown -t html5 -s --shift-heading-level-by=-1 --lua-filter=gh-pages/filter.lua \
112
+ -o build/gh-pages/docs/index.html gh-pages/docs/index.md
113
+ cp -a api/build/docs/. build/gh-pages/docs/api
114
+ cp -a lib/build/docs/. build/gh-pages/docs/lib
115
+ cp -a jna/build/docs/. build/gh-pages/docs/jna
116
+ cp -a ffm/build/docs/. build/gh-pages/docs/ffm
117
+ cp -a regex/build/docs/. build/gh-pages/docs/regex
118
+
97
119
- name : Codecov
98
120
uses : codecov/codecov-action@v4
99
121
with :
100
122
token : ${{ secrets.CODECOV_TOKEN }}
101
123
file : build/reports/jacoco/jacocoAggregatedTestReport/jacoco.xml
102
124
103
- - name : Publish
125
+ - name : Upload GitHub Pages artifact
126
+ uses : actions/upload-pages-artifact@v3
127
+ with :
128
+ path : build/gh-pages
129
+
130
+ - name : Publish artifacts
104
131
if : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
105
132
env :
106
133
GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
@@ -109,3 +136,28 @@ jobs:
109
136
OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
110
137
OSSRH_TOKEN : ${{ secrets.OSSRH_TOKEN }}
111
138
run : ./gradlew publish -Ppcre4j.version=${{ github.ref_name }}-SNAPSHOT
139
+
140
+ publish-github-pages :
141
+ if : ${{ github.event_name == 'push' && github.ref_name == 'main' }}
142
+
143
+ runs-on : ubuntu-latest
144
+
145
+ permissions :
146
+ contents : read
147
+ pages : write
148
+ id-token : write
149
+
150
+ needs :
151
+ - package
152
+
153
+ environment :
154
+ name : github-pages
155
+ url : ${{ steps.publish-github-pages.outputs.page_url }}
156
+
157
+ steps :
158
+ - name : Set up Git Hub Pages
159
+ uses : actions/configure-pages@v5
160
+
161
+ - name : Publish GitHub Pages
162
+ id : publish-github-pages
163
+ uses : actions/deploy-pages@v4
0 commit comments