From 6b601950a3b478a2b0a78170fa504d6d6556f4fd Mon Sep 17 00:00:00 2001 From: CarmJos Date: Sun, 16 Jan 2022 08:02:06 +0800 Subject: [PATCH] =?UTF-8?q?[v2.3.2]=20[R]=20=E6=95=B4=E5=90=88=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E3=80=81=E9=83=A8=E7=BD=B2(Javadoc)=E4=B8=8E=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=91=E5=B8=83=E3=80=82?= 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 | 63 +++++++++++++++++++++-- .github/workflows/javadoc.yml | 73 --------------------------- .github/workflows/maven.yml | 5 +- .gitignore | 1 + pom.xml | 6 ++- 6 files changed, 69 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/javadoc.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5dbff04..dde4701 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..12c2754 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: Deploy & Upload on: # 支持手动触发构建 @@ -26,8 +26,65 @@ jobs: server-id: github server-username: MAVEN_USERNAME server-password: MAVEN_TOKEN - - name: "Deploy" + + - name: "Maven Deploy" 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: "Release Asset Upload" + id: upload-release-asset + uses: shogo82148/actions-upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: asset/*.jar + asset_content_type: application/java-archive + + - name: "Javadoc Deploy Staging" + 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://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} + path-to-root: docs + + - name: "Output Javadoc 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 Javadocs" + run: | + cd docs + git init + git remote add origin git@github.com:${{ github.repository }}.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 77a9518..0000000 --- a/.github/workflows/javadoc.yml +++ /dev/null @@ -1,73 +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' - - - name: Generate docs - run: mvn 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/userprefix - 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/UserPrefix.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 b7ae340..2bbf0e0 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: Build & Tests on: # 支持手动触发构建 @@ -29,7 +29,8 @@ jobs: env: MAVEN_USERNAME: ${{ github.repository_owner }} MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: "Target Stage" + + - name: "Target Staging" run: mkdir staging && cp target/*.jar staging - name: "Upload artifact" uses: actions/upload-artifact@v2 diff --git a/.gitignore b/.gitignore index 445f9d3..5a4ce4a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /target/ ./*.iml *.iml +asset/ \ No newline at end of file diff --git a/pom.xml b/pom.xml index 77d9b5c..9bc0f3e 100644 --- a/pom.xml +++ b/pom.xml @@ -10,10 +10,10 @@ UTF-8 UTF-8 - + cc.carm.plugin userprefix - 2.3.1 + v2.3.2 UserPrefix 轻便、高效、实时的用户前缀系统。 @@ -201,6 +201,8 @@ shade + ${project.name}-${project.version} + ${project.basedir}/asset/ false