本文覆盖:GitHub 发布、PyPI 上传、项目主页同步(GitHub Pages)和全量发布脚本。
python -m unittest discover -s tests
python -m compileall literature_agent
python -m build
python -m twine check dist/*版本信息应保持一致:
pyproject.tomlliterature_agent/__init__.pyliterature_agent/utils.py(User-Agent)literature_agent/workflow.py(manifest 标记)CHANGELOG.md
./publish_pypi.sh --dry-run --version <VERSION>或直接执行:
./scripts/release_everywhere.sh --dry-run# 先在 shell 中配置 PyPI token
export PYPI_TOKEN='pypi-...'
# 执行整条链路(预检、提版本、提交打tag、推仓库、建Release、上传PyPI)
./scripts/release_everywhere.sh --version <VERSION>./scripts/release_everywhere.sh --version <VERSION> --no-pypi./scripts/release_everywhere.sh --version <VERSION> --skip-push --no-pypi主页内容在 docs/。建议:
- 仓库 Settings → Pages
- Build and deployment → Source:
Deploy from a branch - Branch:
main - Folder:
/docs
也可走 workflow:推送 main 后会自动触发 .github/workflows/gh-pages.yml 部署。
- GitHub Release 页面包含该版本的 release notes(脚本默认从
CHANGELOG.md最新条目生成) - PyPI 页面版本号与发布版本一致
README与README.zh-CN.md中示例命令和版本号保持一致- 主页链接和徽章在发布版本后可访问