Skip to content

Commit bf42e75

Browse files
committed
refactor: 重构项目结构和配置
- 移除 .env.example 文件,改为使用 config.yaml - 更新 README.md 中的配置说明和快速开始指南 - 删除未使用的 remake.json 文件 - 清理 .gitignore 中的无用条目
1 parent f1d8fd5 commit bf42e75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2990
-2040
lines changed

.env.example

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github/ export-ignore
2+
docs/ export-ignore
3+
tests/ export-ignore
4+
5+
.gitignore export-ignore
6+
.gitattributes export-ignore
7+
README.md export-ignore

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 构建发布
2+
3+
on:
4+
push:
5+
branches: [Dev-AxTBot-v2.1] # 在当前分支推送时触发
6+
7+
jobs:
8+
Build-And-Release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
# 1. 检出代码
12+
- name: 签出代码
13+
uses: actions/checkout@v4
14+
15+
# 2. 设置 Python 环境
16+
- name: 设置Python环境
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
# 3. 安装依赖
22+
- name: 安装依赖
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tomli # 安装tomli用于版本检查
26+
27+
# 4. 从 pyproject.toml 提取版本号
28+
- name: 获取版本号
29+
id: version
30+
run: |
31+
VERSION=$(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
34+
# 5. 检查版本是否已存在
35+
- name: 检查版本是否已发布
36+
id: check-release
37+
run: |
38+
# 获取已存在的标签列表
39+
git fetch --tags
40+
# 检查当前版本标签是否存在
41+
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
42+
echo "版本 ${{ steps.version.outputs.version }} 已存在,跳过发布"
43+
echo "skip_release=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "新版本 ${{ steps.version.outputs.version }},继续发布"
46+
echo "skip_release=false" >> $GITHUB_OUTPUT
47+
fi
48+
49+
# 6. 创建 Git 标签
50+
- name: 创建Git tag
51+
if: ${{ steps.check-release.outputs.skip_release == 'false' }}
52+
uses: actions/github-script@v7
53+
with:
54+
script: |
55+
const version = '${{ steps.version.outputs.version }}'
56+
await github.rest.git.createRef({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
ref: `refs/tags/v${version}`,
60+
sha: context.sha
61+
})
62+
63+
# 7. 发布到 GitHub Release
64+
- name: 上传至GitHub Release
65+
if: ${{ steps.check-release.outputs.skip_release == 'false' }}
66+
uses: softprops/action-gh-release@v1
67+
with:
68+
tag_name: v${{ steps.version.outputs.version }}
69+
files: dist/*
70+
generate_release_notes: true
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# 运行时缓存文件
22
__pycache__
3-
Core/__pycache__
4-
plugins/__pycache__
5-
utils/__pycache__
3+
src/app/__pycache__
4+
src/Utils/__pycache__
65

76
# 数据文件
87
data/*.pem
98
data/*.db
9+
data/*.db-wal
10+
data/*.db-shm
1011

1112
# 运行时日志文件
1213
logs
1314

1415
# 运行时目录
1516
.venv
17+
18+
# 操作记录
19+
.vscode

Core/Auth.py

Lines changed: 0 additions & 120 deletions
This file was deleted.

Core/Config.py

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)