diff --git a/.github/workflows/accelerate-manylinux.yml b/.github/workflows/accelerate-manylinux.yml index 1b029cce..4aa3eff0 100644 --- a/.github/workflows/accelerate-manylinux.yml +++ b/.github/workflows/accelerate-manylinux.yml @@ -1,10 +1,13 @@ -name: Build PyOpenGL-accelerate wheels with manylinux +name: Build PyOpenGL-accelerate wheels on different architectures on: push: branches: - "master" +env: + CIBW_SKIP: cp36-* cp37-* cp38-* pp* + jobs: tarballs: name: Build source tarballs and root wheels @@ -49,15 +52,258 @@ jobs: name: accel path: accelerate/dist/* - wheels: - name: Build architecture-specific wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} + wheels_windows: + name: Wheels on windows ${{matrix.arch}} + runs-on: windows-latest + strategy: + matrix: + arch: [AMD64, x86, ARM64] + env: + CIBW_ARCHS: ${{matrix.arch}} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Build wheels (develop) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/master' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Save wheels + uses: actions/upload-artifact@v4 + with: + name: accel-binary-windows-${{ matrix.arch }} + path: accelerate/dist/*.whl + + wheels_mac: + name: Wheels on MacOS ${{ matrix.arch }} + runs-on: macos-latest + strategy: + matrix: + arch: [x86_64, arm64] + + env: + CIBW_ARCHS: ${{ matrix.arch }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Build wheels (develop) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/master' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Save wheels + uses: actions/upload-artifact@v4 + with: + name: accel-binary-macos-${{ matrix.arch }} + path: accelerate/dist/*.whl + + wheels_manylinux_x86: + name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + runs-on: ubuntu-latest + strategy: + matrix: + distro: [manylinux2014, manylinux_2_28] + arch: [x86_64] + include: + - distro: manylinux2014 + arch: i686 + + env: + CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.distro }} + CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.distro }} + CIBW_BUILD: cp3*-manylinux* + CIBW_ARCHS: ${{matrix.arch}} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Build wheels (develop) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/master' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Save wheels + uses: actions/upload-artifact@v4 + with: + name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} + path: accelerate/dist/*.whl + + wheels_manylinux_arm: + name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + + runs-on: ubuntu-24.04-arm + strategy: + matrix: + distro: [manylinux2014, manylinux_2_28] + arch: [aarch64] + include: + - distro: manylinux_2_31 + arch: armv7l + + + env: + CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.distro }} + CIBW_MANYLINUX_ARMV7L_IMAGE: ${{ matrix.distro }} + CIBW_BUILD: cp3*-manylinux* + CIBW_ARCHS: ${{matrix.arch}} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + # - name: Set up QEMU + # if: ${{ matrix.arch != 'x86_64' && matrix.arch != 'i686' }} + # uses: docker/setup-qemu-action@v3 + + - name: Build wheels (develop) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/master' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Save wheels + uses: actions/upload-artifact@v4 + with: + name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} + path: accelerate/dist/*.whl + + # Broken because NumPy does not have wheels for these architectures: + + # wheels_manylinux_arm_ex: + # name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + + # runs-on: ubuntu-latest + # strategy: + # matrix: + # distro: [manylinux2014, manylinux_2_28] + # arch: [ppc64le, s390x] + + # env: + # CIBW_MANYLINUX_S390X_IMAGE: ${{ matrix.distro }} + # CIBW_MANYLINUX_PPC64LE_IMAGE: ${{ matrix.distro }} + # CIBW_BUILD: cp3*-manylinux* + # CIBW_ARCHS: ${{matrix.arch}} + + # steps: + # - name: Check out repository + # uses: actions/checkout@v4 + # - name: Install Python + # uses: actions/setup-python@v5 + # with: + # python-version: 3.x + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Build wheels (develop) + # uses: pypa/cibuildwheel@v2.22.0 + # if: ${{ github.ref == 'refs/heads/develop' }} + # with: + # package-dir: "./accelerate" + # output-dir: "./accelerate/dist" + # env: + # BUILD_EXTENSION: yes + + # - name: Build wheels (master) + # uses: pypa/cibuildwheel@v2.22.0 + # if: ${{ github.ref == 'refs/heads/master' }} + # with: + # package-dir: "./accelerate" + # output-dir: "./accelerate/dist" + # env: + # BUILD_EXTENSION: yes + + # - name: Save wheels + # uses: actions/upload-artifact@v4 + # with: + # name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} + # path: accelerate/dist/*.whl + + wheels_musllinux_x86: + name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest + distro: [musllinux_1_2] + arch: [x86_64, i686] + + env: + CIBW_MUSLLINUX_X86_64_IMAGE: ${{ matrix.distro }} + CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.distro }} + CIBW_BUILD: cp3*-musllinux* + CIBW_ARCHS: ${{matrix.arch}} + steps: - name: Check out repository uses: actions/checkout@v4 @@ -65,11 +311,52 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.x - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v2 + + - name: Build wheels (develop) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/develop' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Build wheels (master) + uses: pypa/cibuildwheel@v2.22.0 + if: ${{ github.ref == 'refs/heads/master' }} + with: + package-dir: "./accelerate" + output-dir: "./accelerate/dist" + env: + BUILD_EXTENSION: yes + + - name: Save wheels + uses: actions/upload-artifact@v4 with: - platforms: all + name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} + path: accelerate/dist/*.whl + + wheels_musllinux_arm: + name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + runs-on: ubuntu-24.04-arm + strategy: + matrix: + distro: [musllinux_1_2] + arch: [aarch64, armv7l] + + env: + CIBW_MUSLLINUX_AARCH64_IMAGE: ${{ matrix.distro }} + CIBW_MUSLLINUX_ARMV7L_IMAGE: ${{ matrix.distro }} + CIBW_BUILD: cp3*-musllinux* + CIBW_ARCHS: ${{matrix.arch}} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.x - name: Build wheels (develop) uses: pypa/cibuildwheel@v2.22.0 @@ -79,7 +366,6 @@ jobs: output-dir: "./accelerate/dist" env: BUILD_EXTENSION: yes - CIBW_SKIP: "pp*" - name: Build wheels (master) uses: pypa/cibuildwheel@v2.22.0 @@ -89,20 +375,76 @@ jobs: output-dir: "./accelerate/dist" env: BUILD_EXTENSION: yes - CIBW_SKIP: "pp*" - name: Save wheels uses: actions/upload-artifact@v4 with: - name: accel-binary-${{ matrix.os }} + name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} path: accelerate/dist/*.whl + # Broken because NumPy does not have wheels for these architectures: + + # wheels_musllinux_arm_ex: + # name: Wheels on ${{ matrix.distro }} ${{ matrix.arch }} + # runs-on: ubuntu-latest + # strategy: + # matrix: + # distro: [musllinux_1_2] + # arch: [s390x, ppc64le] + # env: + # CIBW_MUSLLINUX_S390X_IMAGE: ${{ matrix.distro }} + # CIBW_MUSLLINUX_PPC64LE_IMAGE: ${{ matrix.distro }} + # CIBW_BUILD: cp3*-musllinux* + # CIBW_ARCHS: ${{matrix.arch}} + + # steps: + # - name: Check out repository + # uses: actions/checkout@v4 + # - name: Install Python + # uses: actions/setup-python@v5 + # with: + # python-version: 3.x + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Build wheels (develop) + # uses: pypa/cibuildwheel@v2.22.0 + # if: ${{ github.ref == 'refs/heads/develop' }} + # with: + # package-dir: "./accelerate" + # output-dir: "./accelerate/dist" + # env: + # BUILD_EXTENSION: yes + + # - name: Build wheels (master) + # uses: pypa/cibuildwheel@v2.22.0 + # if: ${{ github.ref == 'refs/heads/master' }} + # with: + # package-dir: "./accelerate" + # output-dir: "./accelerate/dist" + # env: + # BUILD_EXTENSION: yes + + # - name: Save wheels + # uses: actions/upload-artifact@v4 + # with: + # name: accel-binary-${{ matrix.distro }}-${{ matrix.arch }} + # path: accelerate/dist/*.whl + pypi-publish-accel: name: Upload Accelerate ${{matrix.repo}} runs-on: ubuntu-latest if: ${{ github.ref == 'refs/heads/master' }} needs: - - wheels + - wheels_windows + - wheels_mac + - wheels_manylinux_x86 + - wheels_manylinux_arm + # - wheels_manylinux_arm_ex + - wheels_musllinux_x86 + - wheels_musllinux_arm + # - wheels_musllinux_arm_ex - tarballs # TODO: should be choosing the repo URL based on master/develop permissions: @@ -115,23 +457,12 @@ jobs: with: name: accel path: dist - - name: Download Accelerate Binary Windows - uses: actions/download-artifact@v4.1.7 - id: download-accelerate-bin-windows - with: - name: accel-binary-windows-latest - path: dist - - name: Download Accelerate Binary Ubuntu - uses: actions/download-artifact@v4.1.7 - id: download-accelerate-bin-ubuntu - with: - name: accel-binary-ubuntu-latest - path: dist - - name: Download Accelerate Binary MacOS - uses: actions/download-artifact@v4.1.7 - id: download-accelerate-bin-macOS + - name: Download Accelerate Binary + uses: actions/download-artifact@v4 + id: download-accelerate-bin with: - name: accel-binary-macOS-latest + pattern: accel-binary-* + merge-multiple: true path: dist # retrieve your distributions here @@ -148,7 +479,14 @@ jobs: runs-on: ubuntu-latest if: ${{ github.ref == 'refs/heads/master' }} needs: - - wheels + - wheels_windows + - wheels_mac + - wheels_manylinux_x86 + - wheels_manylinux_arm + # - wheels_manylinux_arm_ex + - wheels_musllinux_x86 + - wheels_musllinux_arm + # - wheels_musllinux_arm_ex - tarballs # TODO: should be choosing the repo URL based on master/develop permissions: