Improve MCP startup flow and repo automation
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
## What changed
|
||||
|
||||
- Describe the change briefly
|
||||
- Explain the user impact or motivation
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I tested the extension in a clean Cocos Creator 3.8+ project
|
||||
- [ ] I verified `Funplay > MCP Server` opens and the MCP server can start correctly
|
||||
- [ ] If I changed setup, one-click config, or port/config behavior, I verified the affected flow end-to-end
|
||||
- [ ] I ran `npm run check`
|
||||
- [ ] I updated docs for any user-facing behavior changes
|
||||
- [ ] I did not commit local junk such as `.DS_Store`, `temp/`, or `library/`
|
||||
- [ ] I updated `CHANGELOG.md` when the change affects users
|
||||
@@ -0,0 +1,74 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Validate repository metadata
|
||||
run: |
|
||||
python - <<'PY'
|
||||
import json
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
root = pathlib.Path('.')
|
||||
errors = []
|
||||
|
||||
package_path = root / 'package.json'
|
||||
try:
|
||||
package = json.loads(package_path.read_text(encoding='utf-8'))
|
||||
except Exception as exc:
|
||||
errors.append(f"package.json is not valid JSON: {exc}")
|
||||
else:
|
||||
for key in ('name', 'version', 'main', 'package_version'):
|
||||
if key not in package or package[key] in (None, ''):
|
||||
errors.append(f"package.json is missing required key: {key}")
|
||||
|
||||
required_docs = [
|
||||
'README.md',
|
||||
'README_CN.md',
|
||||
'LICENSE',
|
||||
'CHANGELOG.md',
|
||||
'CONTRIBUTING.md',
|
||||
]
|
||||
for relative in required_docs:
|
||||
if not (root / relative).exists():
|
||||
errors.append(f"Missing required repository file: {relative}")
|
||||
|
||||
forbidden_paths = []
|
||||
for path in root.rglob('*'):
|
||||
if '.git' in path.parts:
|
||||
continue
|
||||
if path.name == '.DS_Store' or '.idea' in path.parts or 'library' in path.parts or 'Library' in path.parts:
|
||||
forbidden_paths.append(str(path))
|
||||
|
||||
if forbidden_paths:
|
||||
errors.append('Repository contains local junk files:\n- ' + '\n- '.join(sorted(forbidden_paths)))
|
||||
|
||||
if errors:
|
||||
print('Validation failed:\n')
|
||||
for error in errors:
|
||||
print(f'- {error}')
|
||||
sys.exit(1)
|
||||
|
||||
print('Repository validation passed.')
|
||||
PY
|
||||
|
||||
- name: Run syntax checks
|
||||
run: npm run check
|
||||
Reference in New Issue
Block a user