Skip to content

Commit

Permalink
优化action自动化流程
Browse files Browse the repository at this point in the history
  • Loading branch information
NIANIANKNIA committed Apr 8, 2024
1 parent b243313 commit d9532c6
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 48 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/pre-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Pre Build

on:
push:
branches: [dev]
workflow_dispatch:

jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the exe file
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT.exe
path: ./NIAHttpBOT/Debug/NIAHttpBOT.exe

build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the executable file
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT
path: ./NIAHttpBOT/NIAHttpBOT

zip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Archive Release1
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
directory: 'development_behavior_packs/NIA_V4.0_BP'
path: '.'
filename: NiaServer-Core-BP-PRE.zip
- name: Upload the zip file1
uses: actions/upload-artifact@v4
with:
name: NiaServer-Core-BP-PRE.zip
path: ./development_behavior_packs/NIA_V4.0_BP/NiaServer-Core-BP-PRE.zip
- name: Archive Release2
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
directory: 'development_resource_packs/NIA_V4.0_RP'
path: '.'
filename: NiaServer-Core-RP-PRE.zip
- name: Upload the zip file2
uses: actions/upload-artifact@v4
with:
name: NiaServer-Core-RP-PRE.zip
path: ./development_resource_packs/NIA_V4.0_RP/NiaServer-Core-RP-PRE.zip
45 changes: 25 additions & 20 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.2.0
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the exe file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT.exe
path: ./NIAhttpBOT/Debug/NIAHttpBOT.exe
Expand All @@ -29,35 +29,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.2.0
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the executable file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT
path: ./NIAhttpBOT/Debug/NIAHttpBOT
path: ./NIAhttpBOT/NIAHttpBOT

zip:
needs: build-linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Archive Release1
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
directory: 'development_behavior_packs/NIA_V4.0_BP'
path: '.'
filename: NiaServer-Core-BP-${{ github.ref_name }}.zip
- name: Upload the zip file1
uses: actions/upload-artifact@v2
- name: Upload the behavior_pack
uses: actions/upload-artifact@v4
with:
name: NiaServer-Core-BP-${{ github.ref_name }}.zip
path: ./development_behavior_packs/NIA_V4.0_BP/NiaServer-Core-BP-${{ github.ref_name }}.zip
Expand All @@ -68,35 +67,41 @@ jobs:
directory: 'development_resource_packs/NIA_V4.0_RP'
path: '.'
filename: NiaServer-Core-RP-${{ github.ref_name }}.zip
- name: Upload the zip file2
uses: actions/upload-artifact@v2
- name: Upload the resource_pack
uses: actions/upload-artifact@v4
with:
name: NiaServer-Core-RP-${{ github.ref_name }}.zip
path: ./development_resource_packs/NIA_V4.0_RP/NiaServer-Core-RP-${{ github.ref_name }}.zip

release:
needs: zip
needs: [build-windows, build-linux, zip]
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Download the exe file
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NIAHttpBOT.exe
- name: Remove existing directory
run: rm -rf ./NIAHttpBOT
- name: Download the Linux executable file
uses: actions/download-artifact@v4
with:
name: NIAHttpBOT
- name: Download the behavior_pack
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NiaServer-Core-BP-${{ github.ref_name }}.zip
- name: Download the resource_pack
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NiaServer-Core-RP-${{ github.ref_name }}.zip
- name: Create and upload release
uses: ncipollo/release-action@v1.12.0
with:
prerelease: true
artifacts: "NiaServer-Core-BP-${{ github.ref_name }}.zip,NiaServer-Core-RP-${{ github.ref_name }}.zip,NIAHttpBOT.exe,NIAHttpBOT,world_behavior_packs.json,world_resource_packs.json" # 指定要上传的exe文件的路径
artifacts: "NiaServer-Core-BP-${{ github.ref_name }}.zip,NiaServer-Core-RP-${{ github.ref_name }}.zip,NIAHttpBOT.exe,NIAHttpBOT,world_behavior_packs.json,world_resource_packs.json"
bodyFile: "CHANGELOG-PRE.md"
generateReleaseNotes: false
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
56 changes: 41 additions & 15 deletions .github/workflows/main.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,49 @@ on:
- 'v*.*.*'

jobs:
build:
build-windows:
runs-on: windows-latest
if: ${{ !contains(github.ref, 'pre') }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.2.0
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the exe file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT.exe
path: ./NIAhttpBOT/Debug/NIAHttpBOT.exe

build-linux:
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'pre') }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Configure the project
uses: threeal/cmake-action@v1.3.0
with:
run-build: true
source-dir: NIAHttpBOT
build-dir: NIAHttpBOT
- name: Upload the executable file
uses: actions/upload-artifact@v4
with:
name: NIAHttpBOT
path: ./NIAhttpBOT/NIAHttpBOT

zip:
needs: build
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'pre') }}
steps:
- uses: actions/checkout@v3
- name: Archive Release1
Expand All @@ -39,7 +59,7 @@ jobs:
path: '.'
filename: NiaServer-Core-BP-${{ github.ref_name }}.zip
- name: Upload the zip file1
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: NiaServer-Core-BP-${{ github.ref_name }}.zip
path: ./development_behavior_packs/NIA_V4.0_BP/NiaServer-Core-BP-${{ github.ref_name }}.zip
Expand All @@ -57,27 +77,33 @@ jobs:
path: ./development_resource_packs/NIA_V4.0_RP/NiaServer-Core-RP-${{ github.ref_name }}.zip

release:
needs: zip
needs: [build-windows, build-linux, zip]
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Download the exe file
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NIAHttpBOT.exe
- name: Remove existing directory
run: rm -rf ./NIAHttpBOT
- name: Download the Linux executable file
uses: actions/download-artifact@v4
with:
name: NIAHttpBOT
- name: Download the behavior_pack
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NiaServer-Core-BP-${{ github.ref_name }}.zip
- name: Download the resource_pack
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: NiaServer-Core-RP-${{ github.ref_name }}.zip
- name: Create and upload release # 步骤:创建和上传release
uses: ncipollo/release-action@v1.12.0 # 使用ncipollo/release-action@v1.12.0
- name: Create and upload release
uses: ncipollo/release-action@v1.12.0
with:
artifacts: "NiaServer-Core-BP-${{ github.ref_name }}.zip,NiaServer-Core-RP-${{ github.ref_name }}.zip,NIAHttpBOT.exe,world_behavior_packs.json,world_resource_packs.json" # 指定要上传的exe文件的路径
artifacts: "NiaServer-Core-BP-${{ github.ref_name }}.zip,NiaServer-Core-RP-${{ github.ref_name }}.zip,NIAHttpBOT.exe,NIAHttpBOT,world_behavior_packs.json,world_resource_packs.json"
bodyFile: "CHANGELOG.md"
generateReleaseNotes: false
token: ${{ secrets.GITHUB_TOKEN }} # 指定GitHub令牌环境变量
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*

!/.github/

!/development_resource_packs
!/development_behavior_packs
/development_behavior_packs/NIA_V4.0_BP/node_modules
Expand Down
22 changes: 9 additions & 13 deletions CHANGELOG-PRE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# v1.5.0-pre-1 更新日志
# v1.5.0-pre-2 更新日志

[![BDS VERSION](https://img.shields.io/badge/BDS-1.20.51.01-green?style=for-the-badge&logo=appveyor)](https://www.minecraft.net/en-us/download/server/bedrock)
[![BDS VERSION](https://img.shields.io/badge/BDS-1.20.61.01-green?style=for-the-badge&logo=appveyor)](https://www.minecraft.net/en-us/download/server/bedrock)


> **预发布版本提醒**:这是一个**预览版本**,可能存在一些bug,仅供测试,请勿在正式生产环境使用本版本!
Expand All @@ -10,23 +10,19 @@

## 新增

1.圈地系统新增传送点增加功能
1.基于[LLoneBOT](https://github.com/LLOneBot/LLOneBot)使用[onebot-11](https://github.com/botuniverse/onebot-11/)为NIAHttpBOT&&Nia-Server-Core新增部分QQ机器人功能

2.服务器部分物品&&方块
2.NIAHttpBOT增加QQ机器人相关配置文件

3.圈地系统新增配置项`MAX_LAND_NUM``MONEY_SCOREBOARD_DISPLAY_NAME`
3.NIAHttpBOT增加主人QQ相关功能

4.基于[LLoneBOT](https://github.com/LLOneBot/LLOneBot)使用[onebot-11](https://github.com/botuniverse/onebot-11/)为NIAHttpBOT&&Nia-Server-Core新增部分QQ机器人功能

## 优化

1.为了规避UTF-8编码问题,控制台输出所有的信息现在全部都是英文

2.圈地系统LandUUID生成逻辑&&领地转移逻辑
4.NIAHttpBOT增加QQ权限检测

## 修复

圈地系统管理在使用快捷传送时,部分情况下无法传送到指定领地的问题
1.NIAHttpBOT收到私聊消息时崩溃

2.在QQ客户端没有开启的情况下,开始NiaHttp-BOT导致的报错



Expand Down

0 comments on commit d9532c6

Please sign in to comment.