|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# This workflow is based on: https://github.com/ada-url/ada-python/blob/v4.0.0/.github/workflows/build.yml |
| 5 | +name: Build ada-url wheels (riscv64) |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + version: |
| 11 | + description: 'ada-url version to build (git tag without the v prefix, e.g. 4.0.0)' |
| 12 | + required: true |
| 13 | + default: '4.0.0' |
| 14 | + pull_request: |
| 15 | + paths: |
| 16 | + - '.github/workflows/build-ada-url.yml' |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ inputs.version || '4.0.0' }}-${{ github.head_ref || github.run_id }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read # to fetch code (actions/checkout) |
| 24 | + |
| 25 | +env: |
| 26 | + ADA_URL_VERSION: ${{ inputs.version || '4.0.0' }} |
| 27 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 28 | + |
| 29 | +jobs: |
| 30 | + setup: |
| 31 | + uses: $/.github/workflows/_setup.yml |
| 32 | + |
| 33 | + build_wheels: |
| 34 | + needs: [setup] |
| 35 | + name: Build ada-url ${{ inputs.version || '4.0.0' }} ${{ matrix.python }}-manylinux_riscv64 |
| 36 | + runs-on: ubuntu-24.04-riscv |
| 37 | + timeout-minutes: 90 |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + python: ["cp312", "cp313", "cp314"] |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Checkout ada-url ${{ env.ADA_URL_VERSION }} |
| 45 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 46 | + with: |
| 47 | + repository: ada-url/ada-python |
| 48 | + ref: v${{ env.ADA_URL_VERSION }} |
| 49 | + persist-credentials: false |
| 50 | + |
| 51 | + - name: Build wheels |
| 52 | + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 |
| 53 | + with: |
| 54 | + output-dir: wheelhouse/ |
| 55 | + only: ${{ matrix.python }}-manylinux_riscv64 |
| 56 | + env: |
| 57 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 58 | + # cffi is a build requirement and has no riscv64 wheel on public PyPI. |
| 59 | + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ |
| 60 | + CIBW_TEST_SOURCES: tests |
| 61 | + CIBW_TEST_COMMAND: python -m unittest discover -s tests -v |
| 62 | + |
| 63 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 64 | + with: |
| 65 | + name: ada-url-${{ env.ADA_URL_VERSION }}-${{ matrix.python }}-manylinux_riscv64 |
| 66 | + path: ./wheelhouse/*.whl |
| 67 | + if-no-files-found: error |
| 68 | + |
| 69 | + publish: |
| 70 | + name: Publish ada-url ${{ inputs.version || '4.0.0' }} |
| 71 | + needs: [setup, build_wheels] |
| 72 | + permissions: |
| 73 | + contents: write |
| 74 | + pull-requests: write |
| 75 | + uses: $/.github/workflows/_publish-wheel.yml |
| 76 | + with: |
| 77 | + artifact-pattern: ada-url-${{ inputs.version || '4.0.0' }}-*-manylinux_riscv64 |
0 commit comments