Merge pull request #2 from LiteSuggarDEV/fix-field #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main # 指定触发分支 | |
| paths: | |
| - '**' # 监控所有文件变更(可按需调整) | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install | |
| - name: Set environment | |
| run: | | |
| uv venv .venv | |
| uv sync | |
| - name: Install dependencies | |
| run: | | |
| pipx install nb-cli | |
| - name: Get Python path | |
| run: | | |
| PYTHON_BIN="$(uv run python -c 'import sys; print(sys.executable)')" | |
| echo "PYTHON_BIN=$PYTHON_BIN" >> $GITHUB_ENV | |
| - name: Run Pyright | |
| uses: jakebailey/pyright-action@v2 | |
| with: | |
| python-path: ${{ env.PYTHON_BIN }} | |
| pylance-version: latest-release | |
| - name: Build package | |
| run: uv build # 生成构建产物到dist目录 | |
| - name: Save build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package | |
| path: dist/* # 上传所有构建产物 |