Skip to content

Commit cb5b3ec

Browse files
committed
kdoc CI
1 parent 8b25f10 commit cb5b3ec

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/publish-kdoc.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish KDoc
2+
on:
3+
workflow_dispatch:
4+
5+
6+
env:
7+
JAVA_VERSION: 21
8+
JAVA_DISTRIBUTION: zulu
9+
GRADLE_VERSION: 8.5
10+
IS_CI: true
11+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
12+
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
13+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
14+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
15+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
16+
GRADLE_OPTS: "-XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8"
17+
18+
jobs:
19+
deploy-doc:
20+
name: Deploy-doc
21+
runs-on: ubuntu-latest
22+
steps:
23+
# 检出仓库代码
24+
- name: Check out repo
25+
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
28+
fetch-depth: 0
29+
# setup Java
30+
- name: Setup java
31+
uses: actions/setup-java@v4
32+
with:
33+
distribution: ${{ env.JAVA_DISTRIBUTION }}
34+
java-version: ${{ env.JAVA_VERSION }}
35+
cache: 'gradle'
36+
37+
# setup Gradle
38+
- name: Gradle generate documentation
39+
uses: gradle/actions/setup-gradle@v3
40+
with:
41+
gradle-version: ${{ env.GRADLE_VERSION }}
42+
arguments: |
43+
dokkaHtmlMultiModule
44+
--info
45+
--warning-mode all
46+
-x test
47+
--build-cache
48+
-Porg.gradle.jvmargs="-Xmx8g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8"
49+
-Porg.gradle.daemon=false
50+
51+
- name: Push to doc repository
52+
uses: peaceiris/actions-gh-pages@v3
53+
with:
54+
personal_token: ${{ secrets.PUSH_TOKEN }}
55+
external_repository: simple-robot-library/simbot3-api-docs
56+
publish_branch: kdoc-deploy/component-telegram
57+
publish_dir: ./build/dokka/html
58+
# deploy to sub dir
59+
destination_dir: components/telegram

0 commit comments

Comments
 (0)