From 356dd9bc2bae79f8fd2051b42eb63f048d2e5445 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 1 May 2025 20:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20cd:=20upload=20to=20pypi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto_release.yml | 33 +++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index 4c6c3161e..2398ae065 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -7,7 +7,7 @@ on: name: Auto Release jobs: - build: + build-and-publish-to-github-release: runs-on: ubuntu-latest permissions: contents: write @@ -28,8 +28,35 @@ jobs: run: | echo "changelog=changelogs/${{github.ref_name}}.md" >> "$GITHUB_ENV" - - name: Create Release + - name: Create GitHub Release uses: ncipollo/release-action@v1 with: bodyFile: ${{ env.changelog }} - artifacts: "dashboard/dist.zip" \ No newline at end of file + artifacts: "dashboard/dist.zip" + + build-and-publish-to-pypi: + # 构建并发布到 PyPI + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install uv + run: | + python -m pip install uv + + - name: Build package + run: | + uv build + + - name: Publish to PyPI + env: + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: | + uv publish \ No newline at end of file