From 7153661f8677230591ad285da73766a6d4d4a8c6 Mon Sep 17 00:00:00 2001 From: CarmJos Date: Fri, 14 Jan 2022 12:57:59 +0800 Subject: [PATCH] =?UTF-8?q?[v1.2.4]=20=E6=95=B4=E5=90=88Javadoc=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E4=B8=8EMaven=E4=B8=80=E5=90=8C=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/deploy.yml | 53 ++++++++++++++++-- .github/workflows/javadoc.yml | 77 --------------------------- .github/workflows/maven.yml | 2 +- 4 files changed, 52 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/javadoc.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5b79227..46d6202 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,7 +9,7 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: "CodeQL Analysis" on: push: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 506585f..f5f085b 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 on: # 支持手动触发构建 @@ -26,8 +26,55 @@ jobs: server-id: github server-username: MAVEN_USERNAME server-password: MAVEN_TOKEN - - name: "Deploy" + + - name: "Maven Deploy With Javadoc" 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}} + + - name: "Copy Javadoc to Location" + run: | + rm -rf docs + mkdir -vp docs + cp -vrf target/apidocs/* docs/ + cp -vrf .documentation/JAVADOC-README.md docs/README.md + + - name: "Generate the Javadoc sitemap" + id: sitemap + uses: cicirello/generate-sitemap@v1 + with: + base-url-path: https://carmjos.github.io/EasySQL + 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 }}" + + - 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 documentations" + run: | + cd docs + git init + git remote add origin git@github.com:CarmJos/UltraDepository.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/javadoc.yml b/.github/workflows/javadoc.yml deleted file mode 100644 index 59b9df8..0000000 --- a/.github/workflows/javadoc.yml +++ /dev/null @@ -1,77 +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: - java-version: '11' - distribution: 'adopt' - cache: maven - server-id: github - server-username: MAVEN_USERNAME - server-password: MAVEN_TOKEN - - - name: Generate docs - run: mvn clean package -DskipTests - - - name: Copy to Location - run: | - rm -rf docs - mkdir -vp docs - cp -vrf target/apidocs/* docs/ - cp -vrf .documentation/JAVADOC-README.md docs/README.md - - - name: Generate the sitemap - id: sitemap - uses: cicirello/generate-sitemap@v1 - with: - base-url-path: https://carmjos.github.io/UltraDepository - 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 }}" - - - 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/UltraDepository.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 4fa8f07..6b0d1d2 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 & Tests on: # 支持手动触发构建