From c216290731c97bf715a7a70a9a630d70565768b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=BA=91=E5=B8=86?= Date: Sat, 14 Mar 2026 04:50:56 +0800 Subject: [PATCH] chore: migrate publish workflow to reusable publish (TD-2026-004) --- .github/workflows/publish.yml | 49 +++++------------------------------ 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ce6cb5..a6368e0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,50 +2,15 @@ name: Publish to PyPI on: push: - tags: - - "v*" + tags: ["v*"] jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install dependencies - run: | - pip install -e ".[all]" - pip install pytest-asyncio - - - name: Lint - run: ruff check . - - - name: Test - run: pytest - publish: - needs: test - runs-on: ubuntu-latest + uses: liuxiaotong/knowlyr-workflows/.github/workflows/reusable-publish-pypi.yml@main + with: + build_tool: "setuptools" + run_tests: true + test_command: "pytest tests/" permissions: id-token: write - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install build tools - run: pip install build - - - name: Build package - run: python -m build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + contents: read