From ddc443a72c6e78e63a0de2d2d332856cea662add Mon Sep 17 00:00:00 2001 From: timeance <30307526+timeance@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:16:46 +0800 Subject: [PATCH] chore: establish project documentation and CI framework --- .gitattributes | 9 ++ .github/pull_request_template.md | 7 ++ .github/workflows/ci.yml | 51 +++++++++ .gitignore | 9 ++ README.md | 92 ++++++++++++++++ __init__.py | 1 + assets/readme-logo.png | Bin 0 -> 1201992 bytes docs/API_NOTES.md | 181 +++++++++++++++++++++++++++++++ docs/THIRD_PARTY.md | 18 +++ docs/VALIDATION.md | 111 +++++++++++++++++++ logo.png | Bin 0 -> 1271239 bytes metadata.yaml | 6 + pytest.ini | 4 + requirements-dev.txt | 5 + requirements.txt | 4 + 15 files changed, 498 insertions(+) create mode 100644 .gitattributes create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 __init__.py create mode 100644 assets/readme-logo.png create mode 100644 docs/API_NOTES.md create mode 100644 docs/THIRD_PARTY.md create mode 100644 docs/VALIDATION.md create mode 100644 logo.png create mode 100644 metadata.yaml create mode 100644 pytest.ini create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..31318e2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +* text=auto +*.py text eol=lf +*.md text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.json text eol=lf +*.html text eol=lf +*.txt text eol=lf +*.png binary diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..b6f5eb7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,7 @@ +## 改动 + +说明解决的问题和改动后的行为。 + +## 验证 + +列出已执行的检查及结果;涉及真实 API 或 AstrBot 收发时注明验证环境。 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6a04a0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + checks: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python-version: ['3.11', '3.12'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install development dependencies + run: python -m pip install -r requirements-dev.txt + - name: Check dependency compatibility + run: python -m pip check + - name: Check plugin metadata + run: | + python - <<'PY' + from pathlib import Path + import yaml + + metadata = yaml.safe_load(Path('metadata.yaml').read_text(encoding='utf-8')) + for key in ('name', 'display_name', 'desc', 'version', 'author', 'repo'): + assert isinstance(metadata[key], str) and metadata[key].strip(), key + assert Path('README.md').is_file() + assert Path('logo.png').is_file() + assert Path('assets/readme-logo.png').is_file() + PY + - name: Check Python syntax + run: python -m compileall -q . diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b0b63c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +__pycache__/ +.pytest_cache/ +*.py[cod] +.venv/ +*.sqlite* +*.db +.env +previews/ +dist/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..35f03b3 --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +

09`?)&KOFV>w`1cn|1-hG7i^XX
z7uhY~GC;*R1z+#{1$%NYjT!|IB)*%#_g{+2{}KEZ9{u=8SJR#$$4qa3p|>PuzjW-m
zROv@Ab8h4HqF=vySP}8%Ga)~{yw@s;=?vSX$$hG2@cp|T&Jf#fM|o@Dt`~l7e!RnL
z{1@4$XYIXYUbeOS_a*y2WdE3bwIe)m>Cjf=((;`0eV;zq__fbjRm^MAi`>88_REZ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