|
| 1 | +--- |
| 2 | +name: Build grpcio wheels (riscv64) |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + version: |
| 8 | + description: 'grpcio version to build (git tag without leading v, e.g. 1.78.0)' |
| 9 | + required: true |
| 10 | + default: '1.78.0' |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - '.github/workflows/build-grpcio.yml' |
| 14 | + - 'patches/grpcio/**' |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ inputs.version || '1.78.0' }}-${{ github.head_ref || github.run_id }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + |
| 23 | +env: |
| 24 | + GRPCIO_VERSION: ${{ inputs.version || '1.78.0' }} |
| 25 | + UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ |
| 26 | + UV_INDEX_STRATEGY: unsafe-best-match |
| 27 | + UV_ONLY_BINARY: ':all:' |
| 28 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 29 | + |
| 30 | +jobs: |
| 31 | + build_wheels: |
| 32 | + name: Build grpcio ${{ inputs.version || '1.78.0' }} ${{ matrix.python }}-manylinux_riscv64 |
| 33 | + runs-on: ubuntu-24.04-riscv |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + # grpcio doesn't advertise free-threaded support yet |
| 38 | + # (src/python/grpcio/python_version.py lists only 3.10-3.14), so |
| 39 | + # 3.14t is dropped from the usual default matrix. |
| 40 | + # See also: https://github.com/grpc/grpc/issues/38762 |
| 41 | + python: ["cp312", "cp313", "cp314"] |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Checkout grpc v${{ env.GRPCIO_VERSION }} |
| 45 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 46 | + with: |
| 47 | + repository: grpc/grpc |
| 48 | + ref: v${{ env.GRPCIO_VERSION }} |
| 49 | + submodules: true |
| 50 | + persist-credentials: false |
| 51 | + |
| 52 | + - name: Checkout python-wheels |
| 53 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 54 | + with: |
| 55 | + path: python-wheels |
| 56 | + persist-credentials: false |
| 57 | + |
| 58 | + # install_all_python_modules.sh (run below via CIBW_TEST_COMMAND) would |
| 59 | + # otherwise reinstall grpcio from source before testing, rather than |
| 60 | + # testing the wheel this job just built. |
| 61 | + - name: Patch grpc source |
| 62 | + run: git apply python-wheels/patches/grpcio/${{ env.GRPCIO_VERSION }}/00*.patch |
| 63 | + |
| 64 | + - name: Build wheels |
| 65 | + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 |
| 66 | + env: |
| 67 | + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 |
| 68 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 69 | + # Enables grpc's optional systemd socket-activation feature (see |
| 70 | + # src/python/grpcio/README.rst); needs libsystemd-devel present. |
| 71 | + CIBW_ENVIRONMENT: GRPC_PYTHON_BUILD_WITH_SYSTEMD=1 |
| 72 | + CIBW_BEFORE_ALL: dnf install -y systemd-devel |
| 73 | + CIBW_BEFORE_BUILD: pip install -r requirements.txt |
| 74 | + CIBW_REPAIR_WHEEL_COMMAND: auditwheel repair --strip -w {dest_dir} {wheel} |
| 75 | + CIBW_TEST_REQUIRES: setuptools |
| 76 | + CIBW_TEST_COMMAND: >- |
| 77 | + cd {project}/tools/distrib && |
| 78 | + PIP_NO_BUILD_ISOLATION=0 ./install_all_python_modules.sh && |
| 79 | + cd {project}/src && python python/grpcio_tests/setup.py test_lite |
| 80 | +
|
| 81 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 82 | + with: |
| 83 | + name: grpcio-${{ env.GRPCIO_VERSION }}-${{ matrix.python }}-manylinux_riscv64 |
| 84 | + path: ./wheelhouse/*.whl |
| 85 | + if-no-files-found: error |
| 86 | + |
| 87 | + publish: |
| 88 | + name: Publish grpcio ${{ inputs.version || '1.78.0' }} to GitLab |
| 89 | + needs: [build_wheels] |
| 90 | + runs-on: ubuntu-latest |
| 91 | + permissions: |
| 92 | + contents: write |
| 93 | + pull-requests: write |
| 94 | + |
| 95 | + steps: |
| 96 | + - name: Publish wheels and open docs PR |
| 97 | + uses: riseproject-dev/python-wheels/actions/publish-wheels@main |
| 98 | + with: |
| 99 | + artifact-pattern: grpcio-${{ env.GRPCIO_VERSION }}-*-manylinux_riscv64 |
| 100 | + gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }} |
| 101 | + gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }} |
| 102 | + gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }} |
| 103 | + gh-token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments