From 2395133becd415f2243cf9f83c64cbaed0fc76ee Mon Sep 17 00:00:00 2001 From: ChengjieLi Date: Tue, 29 Oct 2024 11:13:59 +0800 Subject: [PATCH] fix --- .github/workflows/build-wheel.yaml | 59 ++++++++++++++++-------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-wheel.yaml b/.github/workflows/build-wheel.yaml index 5f093b7c..fc9bbbec 100644 --- a/.github/workflows/build-wheel.yaml +++ b/.github/workflows/build-wheel.yaml @@ -22,6 +22,9 @@ jobs: matrix: os: [ubuntu-latest, macos-13, windows-latest] arch: [auto] + # Cannot set like this: ">=3.9,<3.11" here, + # which will result in two packages running within a single runner, + # potentially causing conflicts in the Python environment. requires-python: [">=3.9,<3.10", ">=3.10,<3.11", ">=3.11,<3.12", ">=3.12,<3.13"] include: - os: ubuntu-latest @@ -111,31 +114,31 @@ jobs: with: path: ./python/dist/*.tar.gz -# upload_pypi: -# needs: [build_wheels, build_sdist] -# runs-on: ubuntu-latest -# # upload to PyPI on every tag starting with 'v' -# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') -# steps: -# - uses: actions/download-artifact@v3 -# with: -# # unpacks default artifact into dist/ -# # if `name: artifact` is omitted, the action will create extra parent dir -# name: artifact -# path: dist -# -# # if is xprobe repo, upload to pypi -# - uses: pypa/gh-action-pypi-publish@v1.5.0 -# if: github.repository == 'xorbitsai/xoscar' -# with: -# user: __token__ -# password: ${{ secrets.PYPI_PASSWORD }} -# -# # if is not xprobe repo, upload to test -# - uses: pypa/gh-action-pypi-publish@v1.5.0 -# if: github.repository != 'xorbitsai/xoscar' -# with: -# user: __token__ -# password: ${{ secrets.TEST_PYPI_PASSWORD }} -# verbose: true -# repository_url: https://test.pypi.org/legacy/ + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/download-artifact@v3 + with: + # unpacks default artifact into dist/ + # if `name: artifact` is omitted, the action will create extra parent dir + name: artifact + path: dist + + # if is xprobe repo, upload to pypi + - uses: pypa/gh-action-pypi-publish@v1.5.0 + if: github.repository == 'xorbitsai/xoscar' + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + + # if is not xprobe repo, upload to test + - uses: pypa/gh-action-pypi-publish@v1.5.0 + if: github.repository != 'xorbitsai/xoscar' + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_PASSWORD }} + verbose: true + repository_url: https://test.pypi.org/legacy/