chore: tidy up repo settings (#246)

Signed-off-by: tison <wander4096@gmail.com>
This commit is contained in:
tison 2025-03-02 19:33:08 +08:00 committed by GitHub
parent e55dc9e7f8
commit e90e6b53ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 23 additions and 101 deletions

View File

@ -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
insert_final_newline = true

View File

View File

View File

View File

@ -1,12 +0,0 @@
<!-- 请确保你已经阅读并理解了贡献指南 -->
### . 描述这个 PR 做了什么
### Ⅱ. 这个 pull request 是否修复了一个问题?
<!-- 如果是请在下一行添加“fix #xxx”,例如 fix #97。-->
### Ⅲ. 为什么不需要添加测试用例(单元测试/集成测试)?
### Ⅳ. 描述如何验证它
### . 评审的特别说明

View File

@ -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

View File

@ -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 }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

View File

@ -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对应的用于创建仓库的tokenhttps://gitee.com/profile/personal_access_tokens
dst_token: ${{ secrets.GITEE_TOKEN }}
# 如果是组织,指定组织即可,默认为用户 user
account_type: org
# 需要同步的仓库里面的项目
static_list: "fastexcel"