diff --git a/.github/workflows/manylinux_basic.yml b/.github/workflows/manylinux_basic.yml index 593123e..760949d 100644 --- a/.github/workflows/manylinux_basic.yml +++ b/.github/workflows/manylinux_basic.yml @@ -9,13 +9,12 @@ on: jobs: build-wheels: timeout-minutes: 60 - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux2014_x86_64 + runs-on: ubuntu-20.04 + container: quay.io/pypa/manylinux_2_28_x86_64 steps: - uses: actions/checkout@v2 - - - name: Install bazel + - name: Build Wheels run: | yum -y install wget yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel @@ -24,16 +23,12 @@ jobs: ./bazel-5.1.0-installer-linux-x86_64.sh --user export PATH=$PATH:~/.bazel/bin export PYTHON_BIN_PATH='/opt/python/cp38-cp38/bin/python' - bazel build //pygloo:all - echo "Built successfully1." - - - name: Build wheels - run: | - # bazel build //pygloo:all - echo "Built successfully." + bash build_wheels.sh + echo "Built successfully." + echo `pwd` - # - name: Archive pygloo-wheel - # uses: actions/upload-artifact@v1 - # with: - # name: pygloo_python39_wheel_on_manylinux - # path: dist/ + - name: Archive pygloo-wheels + uses: actions/upload-artifact@v4 + with: + name: pygloo_python3X_wheels_on_manylinux + path: dist/* diff --git a/build_wheels.sh b/build_wheels.sh old mode 100644 new mode 100755 index f178995..e1d0b52 --- a/build_wheels.sh +++ b/build_wheels.sh @@ -2,20 +2,21 @@ # Assuming in docker "quay.io/pypa/manylinux2014_x86_64". -# Build py36 manylinux wheels -PYTHON_BIN_PATH='/opt/python/cp36-cp36m/bin/python' /opt/python/cp36-cp36m/bin/python setup.py bdist_wheel -auditwheel repair --plat manylinux2014_x86_64 dist/pygloo-0.2.0-cp36-cp36m-linux_x86_64.whl -bazel clean --expunge -/opt/python/cp36-cp36m/bin/python setup.py clean --all +PYGLOO_VERSION="0.2.1" +# 定义 Python 版本数组 +PYTHON_VERSIONS=("cp38-cp38" "cp39-cp39" "cp310-cp310" "cp311-cp311" "cp312-cp312") -# Build py37 manylinux wheels -PYTHON_BIN_PATH='/opt/python/cp37-cp37m/bin/python' /opt/python/cp37-cp37m/bin/python setup.py bdist_wheel -auditwheel repair --plat manylinux2014_x86_64 dist/pygloo-0.2.0-cp37-cp37m-linux_x86_64.whl -bazel clean --expunge -/opt/python/cp37-cp37m/bin/python setup.py clean --all - -# Build py38 manylinux wheels -PYTHON_BIN_PATH='/opt/python/cp38-cp38/bin/python' /opt/python/cp38-cp38/bin/python setup.py bdist_wheel -auditwheel repair --plat manylinux2014_x86_64 dist/pygloo-0.2.0-cp38-cp38-linux_x86_64.whl -bazel clean --expunge -/opt/python/cp38-cp38/bin/python setup.py clean --all +# 遍历每个版本 +for VERSION in "${PYTHON_VERSIONS[@]}"; do + # 设置 Python 路径 + PYTHON_BIN_PATH="/opt/python/${VERSION}/bin/python" + + export PYTHON_BIN_PATH=$PYTHON_BIN_PATH + # 执行构建和修复 + $PYTHON_BIN_PATH setup.py bdist_wheel + auditwheel repair --plat manylinux2014_x86_64 "dist/pygloo-${PYGLOO_VERSION}-${VERSION}-linux_x86_64.whl" + + # 清理构建环境 + bazel clean --expunge + $PYTHON_BIN_PATH setup.py clean --all +done \ No newline at end of file diff --git a/setup.py b/setup.py index 42c4070..91bc7bd 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ logger = logging.getLogger(__name__) -SUPPORTED_PYTHONS = [(3, 6), (3, 7), (3, 8), (3, 9), (3, 10)] +SUPPORTED_PYTHONS = [(3, 8), (3, 9), (3, 10), (3, 11), (3, 12)] SUPPORTED_BAZEL = (3, 2, 0) ROOT_DIR = os.path.dirname(__file__) @@ -93,7 +93,7 @@ def build(): bazel_targets = ["//pygloo:all"] return bazel_invoke( subprocess.check_call, - ["build", "--verbose_failures", "--"] + bazel_targets, + ["build", "--verbose_failures", "-j", "4", "--"] + bazel_targets, env=bazel_env) @@ -130,7 +130,7 @@ def finalize_options(self): setuptools.setup( name="pygloo", - version="0.2.0", + version="0.2.1", author="Ray Team", author_email="ray-dev@googlegroups.com", description=("A python binding for gloo"),