Skip to content

Commit ec82b0e

Browse files
author
liangyz
committed
chore: enhance CI workflow and update entry point documentation
- Add a new build job in the CI workflow to automate package building and verification. - Update entry point in main.py from 'feishu-agent' to 'lark-agent' to reflect recent naming changes. - Include steps for testing the installation of the built package and verifying command availability.
1 parent 9c7fb11 commit ec82b0e

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,71 @@ jobs:
3737
- name: Run tests
3838
run: uv run pytest
3939

40+
build:
41+
needs: test
42+
if: |
43+
github.event_name == 'push' &&
44+
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Install uv
53+
uses: astral-sh/setup-uv@v5
54+
with:
55+
enable-cache: true
56+
python-version: "3.11"
57+
58+
- name: Install dependencies
59+
run: uv sync
60+
61+
- name: Build package
62+
run: |
63+
# 清理旧的构建文件
64+
rm -rf dist/ build/ *.egg-info
65+
# 构建 wheel 和 sdist
66+
uv build
67+
68+
- name: Verify build artifacts
69+
run: |
70+
echo "Build artifacts:"
71+
ls -lh dist/
72+
echo ""
73+
echo "Verifying wheel package..."
74+
python -m zipfile -l dist/*.whl | head -10
75+
echo ""
76+
echo "Verifying entry points..."
77+
unzip -p dist/*.whl */dist-info/entry_points.txt || true
78+
79+
- name: Test installation
80+
run: |
81+
# 测试 wheel 包是否可以正常安装
82+
uv tool install dist/*.whl --force
83+
# 验证命令是否可用
84+
which lark-agent || echo "lark-agent command not found in PATH"
85+
# 验证模块是否可以导入
86+
python -c "from src.mcp_server import main, mcp; print('✓ Module import successful')"
87+
88+
- name: Upload build artifacts
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: dist-packages
92+
path: dist/*
93+
retention-days: 30
94+
95+
- name: Upload to GitHub Releases
96+
if: startsWith(github.ref, 'refs/tags/')
97+
uses: softprops/action-gh-release@v1
98+
with:
99+
files: dist/*
100+
draft: false
101+
prerelease: false
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
40105
opencode:
41106
if: |
42107
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') &&

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
44
支持两种运行方式:
55
1. 直接运行: python main.py
6-
2. 通过 uv tool install 安装后: feishu-agent
6+
2. 通过 uv tool install 安装后: lark-agent
77
"""
88

9-
from src.mcp_server import main
9+
from src.mcp_server import main, mcp
1010

1111
if __name__ == "__main__":
1212
main()

0 commit comments

Comments
 (0)