From 29321f2b251c2055b284401ba9bc8fd87321866c Mon Sep 17 00:00:00 2001 From: CarmJos Date: Thu, 13 Jan 2022 16:28:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 69 ++++++++++++++++++++++++++- .github/workflows/javadoc.yml | 78 ------------------------------- .github/workflows/maven.yml | 2 +- easyplugin-all/pom.xml | 2 +- easyplugin-bom/pom.xml | 2 +- easyplugin-command/pom.xml | 2 +- easyplugin-common/pom.xml | 2 +- easyplugin-configuration/pom.xml | 2 +- easyplugin-database/pom.xml | 2 +- easyplugin-gui/pom.xml | 2 +- easyplugin-lp/pom.xml | 2 +- easyplugin-main/pom.xml | 2 +- easyplugin-placeholderapi/pom.xml | 2 +- easyplugin-vault/pom.xml | 2 +- pom.xml | 2 +- 15 files changed, 80 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/javadoc.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 506585f..680190f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Deploy +name: Project Deploy (With Javadoc) on: # 支持手动触发构建 @@ -30,4 +30,69 @@ jobs: run: mvn -B deploy --file pom.xml -DskipTests env: MAVEN_USERNAME: ${{ github.repository_owner }} - MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file + MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} + + javadoc-website: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Set up the Java JDK + uses: actions/setup-java@v2 + with: + cache: maven + java-version: '11' + distribution: 'adopt' + server-id: github + server-username: MAVEN_USERNAME + server-password: MAVEN_TOKEN + + - name: Generate docs + run: mvn javadoc:javadoc -DskipTests + env: + MAVEN_USERNAME: ${{ github.repository_owner }} + MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Copy to Location + run: | + bash .scripts/copy-javadoc.sh + + - name: Generate the sitemap + id: sitemap + uses: cicirello/generate-sitemap@v1 + with: + base-url-path: https://carmjos.github.io/EasyPlugin + path-to-root: docs + + - 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 }}" + ls -l docs + + - name: Configure Git + env: + DEPLOY_PRI: ${{secrets.DEPLOY_PRI}} + run: | + sudo timedatectl set-timezone "Asia/Shanghai" + mkdir -p ~/.ssh/ + echo "$DEPLOY_PRI" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan github.com >> ~/.ssh/known_hosts + git config --global user.name 'CarmJos' + git config --global user.email 'carm@carm.cc' + + - name: Commit documentation changes + run: | + cd docs + git init + git remote add origin git@github.com:CarmJos/EasyPlugin.git + git checkout -b gh-pages + git add -A + git commit -m "API Document generated." + - name: Push javadocs + run: | + cd docs + git push origin HEAD:gh-pages --force \ No newline at end of file diff --git a/.github/workflows/javadoc.yml b/.github/workflows/javadoc.yml deleted file mode 100644 index 36de88b..0000000 --- a/.github/workflows/javadoc.yml +++ /dev/null @@ -1,78 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Javadoc - -on: - # 支持手动触发构建 - workflow_dispatch: - release: - # 创建release的时候触发 - types: [ published ] - -jobs: - api-website: - runs-on: ubuntu-latest - steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - - name: Set up the Java JDK - uses: actions/setup-java@v2 - with: - cache: maven - java-version: '11' - distribution: 'adopt' - server-id: github - server-username: MAVEN_USERNAME - server-password: MAVEN_TOKEN - - - name: Generate docs - run: mvn javadoc:javadoc -DskipTests - env: - MAVEN_USERNAME: ${{ github.repository_owner }} - MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Copy to Location - run: | - bash .scripts/copy-javadoc.sh - - - name: Generate the sitemap - id: sitemap - uses: cicirello/generate-sitemap@v1 - with: - base-url-path: https://carmjos.github.io/EasyPlugin - path-to-root: docs - - - 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 }}" - ls -l docs - - - name: Configure Git - env: - DEPLOY_PRI: ${{secrets.DEPLOY_PRI}} - run: | - sudo timedatectl set-timezone "Asia/Shanghai" - mkdir -p ~/.ssh/ - echo "$DEPLOY_PRI" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan github.com >> ~/.ssh/known_hosts - git config --global user.name 'CarmJos' - git config --global user.email 'carm@carm.cc' - - - name: Commit documentation changes - run: | - cd docs - git init - git remote add origin git@github.com:CarmJos/EasyPlugin.git - git checkout -b gh-pages - git add -A - git commit -m "API Document generated." - - name: Push javadocs - run: | - cd docs - git push origin HEAD:gh-pages --force - diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fec482c..28da0b6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Build +name: Project Build on: # 支持手动触发构建 diff --git a/easyplugin-all/pom.xml b/easyplugin-all/pom.xml index a31275d..41fcc1b 100644 --- a/easyplugin-all/pom.xml +++ b/easyplugin-all/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-bom/pom.xml b/easyplugin-bom/pom.xml index e92f3b7..517c151 100644 --- a/easyplugin-bom/pom.xml +++ b/easyplugin-bom/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-command/pom.xml b/easyplugin-command/pom.xml index 1614699..8312944 100644 --- a/easyplugin-command/pom.xml +++ b/easyplugin-command/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-common/pom.xml b/easyplugin-common/pom.xml index 934dec8..b1fe301 100644 --- a/easyplugin-common/pom.xml +++ b/easyplugin-common/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-configuration/pom.xml b/easyplugin-configuration/pom.xml index 03f12c4..c917b54 100644 --- a/easyplugin-configuration/pom.xml +++ b/easyplugin-configuration/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-database/pom.xml b/easyplugin-database/pom.xml index bec55fd..9158bf3 100644 --- a/easyplugin-database/pom.xml +++ b/easyplugin-database/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-gui/pom.xml b/easyplugin-gui/pom.xml index 612d85e..df1557c 100644 --- a/easyplugin-gui/pom.xml +++ b/easyplugin-gui/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-lp/pom.xml b/easyplugin-lp/pom.xml index 9aea079..69cda16 100644 --- a/easyplugin-lp/pom.xml +++ b/easyplugin-lp/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-main/pom.xml b/easyplugin-main/pom.xml index 83a24dd..89fcd33 100644 --- a/easyplugin-main/pom.xml +++ b/easyplugin-main/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-placeholderapi/pom.xml b/easyplugin-placeholderapi/pom.xml index d558c3a..adae853 100644 --- a/easyplugin-placeholderapi/pom.xml +++ b/easyplugin-placeholderapi/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/easyplugin-vault/pom.xml b/easyplugin-vault/pom.xml index d50d15b..a417de4 100644 --- a/easyplugin-vault/pom.xml +++ b/easyplugin-vault/pom.xml @@ -5,7 +5,7 @@ easyplugin-parent cc.carm.lib - 1.3.2 + 1.3.2-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index a3c9af8..2648341 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ cc.carm.lib easyplugin-parent pom - 1.3.2 + 1.3.2-SNAPSHOT easyplugin-main