diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml deleted file mode 100644 index 8af5cfa..0000000 --- a/.github/workflows/dispatch.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: dispatch -on: - workflow_dispatch: - inputs: - run_type: - description: '运行方式' - required: true - default: '构建快照' - type: choice - options: - - 构建快照 - - 批准PR - - 发布预览版 - PR_ID: - description: 需要批准的PR ID - required: false -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: 获取信息 - id: get_info - run: | - echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT - echo 本次运行方式: ${{ inputs.run_type }} - if [ "${{ inputs.run_type }}" == "构建快照" ]; then - echo "run_type_en=SNAPSHOT" >> $GITHUB_OUTPUT - elif [ "${{ inputs.run_type }}" == "批准PR" ]; then - echo "run_type_en=PR Approve" >> $GITHUB_OUTPUT - else - echo "run_type_en=Preview" >> $GITHUB_OUTPUT - fi - - name: 拉取代码 - uses: actions/checkout@v4.1.1 - # 必须先执行一次checkout才能执行这个 - - name: 拉取代码(批准PR专用) - if: inputs.run_type == '批准PR' - run: | - ls -la - gh pr checkout ${{ inputs.PR_ID }} - ls -la - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: 安装java8 - uses: actions/setup-java@v4.2.1 - with: - java-version: '8' - distribution: 'temurin' - cache: maven - - name: 构建 - run: | - mvn -B package --file pom.xml - mkdir staging && cp target/*.jar staging - - name: 批准PR - if: inputs.run_type == '批准PR' - uses: hmarr/auto-approve-action@v4.0.0 - with: - pull-request-number: ${{ inputs.PR_ID }} - review-message: | - 编译已通过,批准通过 - 如果有新的提交则取消本次批准 - - name: 收集构建文件 - uses: actions/upload-artifact@v1 - with: - name: ${{ steps.get_info.outputs.repository_name }}-${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} - path: staging - - name: 发布预览版 - if: inputs.run_type == '发布预览版' - uses: ncipollo/release-action@v1.14.0 - with: - tag: ${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} - name: ${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} - token: ${{ secrets.GITHUB_TOKEN }} - prerelease: true - commit: ${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} - body: | - 此版本为预览版 - 相关更新关系日志请等待正式版发布后方可查看 - 你也可以查看commit记录来获取更新日志 - artifacts: ./staging/*.jar diff --git a/.github/workflows/pr-approve.yml b/.github/workflows/pr-approve.yml new file mode 100644 index 0000000..f0f3c9a --- /dev/null +++ b/.github/workflows/pr-approve.yml @@ -0,0 +1,48 @@ +name: PR Approve +on: + workflow_dispatch: + inputs: + PR_ID: + description: 需要批准的PR ID + required: true +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 获取信息 + id: get_info + run: | + echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT + - name: 拉取代码 + uses: actions/checkout@v4.1.6 + # 必须先执行一次checkout才能执行这个 + - name: 拉取代码(批准PR专用) + run: | + ls -la + gh pr checkout ${{ inputs.PR_ID }} + ls -la + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: 安装java8 + uses: actions/setup-java@v4.2.1 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + - name: 构建 + run: | + mvn -B package --file pom.xml + mkdir staging && cp target/*.jar staging + - name: 批准PR + if: inputs.run_type == '批准PR' + uses: hmarr/auto-approve-action@v4.0.0 + with: + pull-request-number: ${{ inputs.PR_ID }} + review-message: | + 编译已通过,批准通过 + 如果有新的提交则取消本次批准 + - name: 收集构建文件 + uses: actions/upload-artifactv@v4.3.3 + with: + name: ${{ steps.get_info.outputs.repository_name }}-${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} + path: staging \ No newline at end of file diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 63fd128..7445e58 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,4 +1,4 @@ -name: pr-check +name: pr check on: pull_request: jobs: @@ -9,9 +9,9 @@ jobs: id: get_info run: echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT - name: 拉取代码 - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.6 - name: 安装java8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4.2.1 with: java-version: '8' distribution: 'temurin' @@ -21,7 +21,7 @@ jobs: mvn -B package --file pom.xml mkdir staging && cp target/*.jar staging - name: 收集构建文件 - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.get_info.outputs.repository_name }}-PR_${{ github.event.pull_request.number }}-Build_${{ github.run_number}} path: staging \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..f5ca955 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,28 @@ +name: push snapshot +on: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 获取信息 + id: get_info + run: | + echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT + - name: 拉取代码 + uses: actions/checkout@v4.1.1 + - name: 安装java8 + uses: actions/setup-java@v4.2.1 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + - name: 构建 + run: | + mvn -B package --file pom.xml + mkdir staging && cp target/*.jar staging + - name: 收集构建文件 + uses: actions/upload-artifact@v4.3.3 + with: + name: ${{ steps.get_info.outputs.repository_name }}-${{ steps.get_info.outputs.run_type_en }}-Build-${{ github.run_number}} + path: staging diff --git a/.github/workflows/tagpush.yml b/.github/workflows/tagpush.yml index 6e6f639..f58fcd9 100644 --- a/.github/workflows/tagpush.yml +++ b/.github/workflows/tagpush.yml @@ -1,4 +1,4 @@ -name: tagpush +name: tag push on: push: tags: @@ -13,9 +13,9 @@ jobs: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT echo "repository_name=${GITHUB_REPOSITORY/${{ github.repository_owner }}\//}" >> $GITHUB_OUTPUT - name: 拉取代码 - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.6 - name: 安装java8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4.2.1 with: java-version: '8' distribution: 'temurin' @@ -25,11 +25,11 @@ jobs: mvn -B package --file pom.xml mkdir staging && cp target/*.jar staging - name: 收集构建文件 - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4.3.3 with: name: ${{ steps.get_info.outputs.repository_name }}-Release-${{ steps.get_info.outputs.VERSION }} path: staging - - name: 创建上传新版本 + - name: 发布新版本 uses: ncipollo/release-action@v1.14.0 with: tag: ${{ steps.get_info.outputs.VERSION }} diff --git a/README.md b/README.md index a2801a4..2630dba 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,24 @@ |:-:|:-:|:-:|:-:| |/newtipsariables|newtipsariables.admin|主命令|OP| |/newtipsariables reload|newtipsariables.admin.reload|重载配置文件|OP| -### **变量介绍** -**[文字相关变量][i2] [玩家相关变量][i3] [服务器相关变量][i4] [支持的插件][i1]** +### **变量介绍文档** +- **[文字相关变量][i2]** +- **[玩家相关变量][i3]** +- **[服务器相关变量][i4]** +- **[支持的插件][i1]** ### **[配置文件使用说明][i5]** +### **配置文件版本号** +|名称|config.yml|player.yml|server.yml| +|:-:|:-:|:-:|:-:| +|版本号|1|1|1| ## **使用方法** 1. **将插件放进`plugins`文件夹** 2. **需确保安装[Tips](https://motci.cn/job/Tips/)插件后重启服务器** 3. **在`./plugins/NewTipsVariables`文件夹中的`.txt`文件获取相关变量介绍,也可在本页面获取相关的变量介绍** +## **注意事项及建议** +1. **不建议开启配置文件的自动更新,如果开启后配置文件有更新会覆盖式更新就会导致原有的配置丢失** +2. **预计发布beta10之后如果没有问题发布正式版该版本,有问题或者需求请及时提出[issue](https://github.com/stevei5mc/NewTipsVariables/issues)** +3. **建议备份好已经配置好的配置文件以备不时之需** [i1]: ./docs/SupportPluginsVariables.md "点击查看变量文档" [i2]: ./docs/text-variables.md "点击查看变量文档" diff --git a/docs/changelogs/1.0.0-beta9.md b/docs/changelogs/1.0.0-beta9.md new file mode 100644 index 0000000..e63949e --- /dev/null +++ b/docs/changelogs/1.0.0-beta9.md @@ -0,0 +1,54 @@ +# **1.0.0-beta9** +--- +## **注意事项** +- **不建议开启配置文件的自动更新,如果开启后配置文件有更新会覆盖式更新就会导致原有的配置丢失** +- **预计发布beta10之后如果没有问题发布正式版该版本,有问题或者需求请及时提出[issue](https://github.com/stevei5mc/NewTipsVariables/issues)** +--- +## **更新建议** +- **建议备份好已经配置好的配置文件以备不时之需** +--- +## **更新内容** +### [de8334c](https://github.com/stevei5mc/NewTipsVariables/commit/de8334cc3de163dcca5241dd7b032fa7b59d7a97) +1. 修改缩进(修复代码中错误的缩进) +### [3ea2a73](https://github.com/stevei5mc/NewTipsVariables/commit/3ea2a73d101731eb781564be74e9f5b8a48c1442) +1. 删除变量文档中的空行 +2. 添加变量{Player-Health}的if判断 +3. 调整了一个class的位置 +### [194b6c1](https://github.com/stevei5mc/NewTipsVariables/commit/194b6c1489bbf2e31edf90e700309eb3dce044b5) +1. 将若水的插件合并到一个class +### [401d170](https://github.com/stevei5mc/NewTipsVariables/commit/401d170c5f9eef6ec7dc8ca857165c8eee0d08bd) +1. 对配置文件的版本检查进行修改 +2. debug功能不在为隐藏的配置项 +3. 对配置文件的doc文档进行修改 +### [884c4c3](https://github.com/stevei5mc/NewTipsVariables/commit/884c4c35b26d5418b29a8eac2a807fd45cf0a886) +1. 合并部分代码 +2. 对配置文件的doc文件进行修改 +### [f5e53ea](https://github.com/stevei5mc/NewTipsVariables/commit/f5e53ea5f93004f270f8c63364aaac624a768abe) +1. 修改部分提示内容 +2. 删除一些空格 +### [ff5fd4a](https://github.com/stevei5mc/NewTipsVariables/commit/ff5fd4a177f472aac91654eca03971c51a0f3509) +1. 添加对LuckPerms的支持(虽然只支持获取prefix和suffix,变量名请看变量文档) +### [c6d9055](https://github.com/stevei5mc/NewTipsVariables/commit/c6d905544cc61cb7fd40dd0d00a240c4a5bea57c) +1. 删除遗留无用的imoort +2. 对一些if判断进行调整 +### [588f29e](https://github.com/stevei5mc/NewTipsVariables/commit/588f29ee44078c4c277990927667655b3f33c31e) +1. 修复一个错误的拼写 +2. 优化配置文件的版本检查功能的代码可读性 +### [cf6fe57](https://github.com/stevei5mc/NewTipsVariables/commit/cf6fe5799005ca117dd3ff140fdb90a635dca92f) +1. 修复一处注释中的错误 +2. 调整debug功能的开启时机 +3. 增加debug消息 +### [9493ec3](https://github.com/stevei5mc/NewTipsVariables/commit/9493ec335528e768e496e876ce2ff078c8395af7) +1. 对代码进行调整 +2. 修改代码注释信息 +### [7b427a7](https://github.com/stevei5mc/NewTipsVariables/commit/7b427a7710968a7cd4f40640c77b918c2855586b) +1. 对代码进行调整 +2. 修复debug相关功能的问题 +### [388288e](https://github.com/stevei5mc/NewTipsVariables/commit/388288e6c36e627eaf754c4ac32af7606ad344ce) +1. 添加变量 {LuckPerms-group} +### [f706901](https://github.com/stevei5mc/NewTipsVariables/commit/f70690106572e9dc02694794735786144fd511e1) +1. 添加无法获取到配置文件版本时的默认版本号 +### [22ada27](https://github.com/stevei5mc/NewTipsVariables/commit/22ada273d4a91e3959f7a883f33e60c19102ff7f) +1. 支持配置文件的自动更新 +### [9417b26](https://github.com/stevei5mc/NewTipsVariables/commit/9417b264dda02c0eea36c578f6157e92b23951fb) +1. 调整配置文件版本检查仅在onLoad阶段 \ No newline at end of file