From e90e6b53aca8d259aef337836eb4bf340a416cb9 Mon Sep 17 00:00:00 2001 From: tison Date: Sun, 2 Mar 2025 19:33:08 +0800 Subject: [PATCH] chore: tidy up repo settings (#246) Signed-off-by: tison --- .editorconfig | 10 +---- .gitee/ISSUE_TEMPLATE.zh-CN.md | 0 .github/ISSUE_TEMPLATE/bug.md | 0 .github/ISSUE_TEMPLATE/question.md | 0 .github/ISSUE_TEMPLATE/suggest.md | 0 .../pull_request_template.md | 12 ------ .github/workflows/ci.yml | 35 +++++----------- .github/workflows/release.yml | 40 +++++-------------- .github/workflows/sync2gitee.yml | 27 ------------- 9 files changed, 23 insertions(+), 101 deletions(-) delete mode 100644 .gitee/ISSUE_TEMPLATE.zh-CN.md delete mode 100644 .github/ISSUE_TEMPLATE/bug.md delete mode 100644 .github/ISSUE_TEMPLATE/question.md delete mode 100644 .github/ISSUE_TEMPLATE/suggest.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md delete mode 100644 .github/workflows/sync2gitee.yml diff --git a/.editorconfig b/.editorconfig index 17b8aab..9328faa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,9 @@ root = true -[*.{groovy, java, kt, xml}] -#缩进风格:空格 +[*.{groovy,java,kt,xml}] indent_style = space -#缩进大小 indent_size = 4 -#换行符lf end_of_line = lf -#字符集utf-8 charset = utf-8 -#是否删除行尾的空格 trim_trailing_whitespace = true -#是否在文件的最后插入一个空行 -insert_final_newline = true \ No newline at end of file +insert_final_newline = true diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md deleted file mode 100644 index e69de29..0000000 diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index e69de29..0000000 diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index e69de29..0000000 diff --git a/.github/ISSUE_TEMPLATE/suggest.md b/.github/ISSUE_TEMPLATE/suggest.md deleted file mode 100644 index e69de29..0000000 diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index bf3d413..0000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,12 +0,0 @@ - - -### Ⅰ. 描述这个 PR 做了什么 - -### Ⅱ. 这个 pull request 是否修复了一个问题? - - -### Ⅲ. 为什么不需要添加测试用例(单元测试/集成测试)? - -### Ⅳ. 描述如何验证它 - -### Ⅴ. 评审的特别说明 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 305532b..e0f2039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,57 +1,42 @@ -# -# Copyright 2009-2021 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: Java CI -on: [push, pull_request] +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: java: [ 8, 11, 17, 21] distribution: [ 'adopt' ] fail-fast: false max-parallel: 4 - name: Test JDK ${{ matrix.java }} + name: Test JDK ${{ matrix.java }} steps: - - uses: actions/checkout@main + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@main + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: ${{ matrix.distribution }} - name: Cache local Maven repository - uses: actions/cache@main + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-m2 - - name: Chmod - run: chmod +x mvnw - name: Test with Maven if: ${{ matrix.java == '8' }} run: ./mvnw test -B -Dmaven.test.skip=false - name: Test with Maven if: ${{ matrix.java != '8' }} run: ./mvnw test -B -Dmaven.test.skip=false -DargLine="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED" - - name: Maven Build run: ./mvnw install -B -V - name: Java Doc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6bba39..e97b543 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,17 @@ -# -# Copyright 2009-2021 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - name: Publish package to the Maven Central Repository - - on: release: types: [created] jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Check out Git repository - uses: actions/checkout@main + uses: actions/checkout@v4 - name: Install Java and Maven - uses: actions/setup-java@main + uses: actions/setup-java@v4 with: java-version: 8 distribution: 'adopt' @@ -37,19 +19,19 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Cache local Maven repository - uses: actions/cache@main + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-m2 - - id: install-secret-key - name: Install GPG secret key - run: | - cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import + - name: Install GPG secret key + run: cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import - name: Publish package - run: | - mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} clean deploy -Dmaven.test.skip=true -Dmaven.javadoc.skip=false -Dgpg.skip=false + run: > + ./mvnw --batch-mode clean deploy + -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} + -Dmaven.test.skip=true -Dmaven.javadoc.skip=false -Dgpg.skip=false env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/.github/workflows/sync2gitee.yml b/.github/workflows/sync2gitee.yml deleted file mode 100644 index 42c88bb..0000000 --- a/.github/workflows/sync2gitee.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 通过 Github action, 在仓库的每一次 commit 后自动同步到 Gitee 上 -# 临时修改为手动触发,等待同步完成后再修改为自动触发 -name: Mirror the Github organization repos to Gitee -on: workflow_dispatch - -jobs: - repo-sync: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@main - with: - persist-credentials: false - - name: Mirror the Github organization repos to Gitee. - uses: Yikun/hub-mirror-action@master - with: - # 必选,需要同步的 Github 这里记住选择的是仓库 或者账号 而不是具体的项目 - src: github/CodePhiliaX - # 必选,需要同步到的 Gitee 这里记住选择的是仓库 或者账号 而不是具体的项目 - dst: gitee/fastexcel - # 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys - dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} - # 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens - dst_token: ${{ secrets.GITEE_TOKEN }} - # 如果是组织,指定组织即可,默认为用户 user - account_type: org - # 需要同步的仓库里面的项目 - static_list: "fastexcel" \ No newline at end of file