|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# This workflow is based on: https://github.com/nomonosound/numpy-minmax/blob/0.6.0/.github/workflows/build.yml |
| 5 | +name: Build numpy-minmax wheels (riscv64) |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + version: |
| 11 | + description: 'numpy-minmax version to build (git tag, e.g. 0.6.0)' |
| 12 | + required: true |
| 13 | + default: '0.6.0' |
| 14 | + pull_request: |
| 15 | + paths: |
| 16 | + - '.github/workflows/build-numpy-minmax.yml' |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ inputs.version || '0.6.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 | + NUMPY_MINMAX_VERSION: ${{ inputs.version || '0.6.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 numpy-minmax ${{ inputs.version || '0.6.0' }} ${{ matrix.python }}-manylinux_riscv64 |
| 36 | + runs-on: ubuntu-24.04-riscv |
| 37 | + timeout-minutes: 60 |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + # Per-interpreter (not abi3): the cffi extension links the version-specific ABI. |
| 42 | + python: |
| 43 | + - "cp312" |
| 44 | + - "cp313" |
| 45 | + - "cp314" |
| 46 | + - "cp314t" |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Checkout numpy-minmax ${{ env.NUMPY_MINMAX_VERSION }} |
| 50 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 51 | + with: |
| 52 | + repository: nomonosound/numpy-minmax |
| 53 | + ref: ${{ env.NUMPY_MINMAX_VERSION }} |
| 54 | + fetch-depth: 0 # setuptools_scm derives the version from git tags |
| 55 | + persist-credentials: false |
| 56 | + |
| 57 | + - name: Build wheels |
| 58 | + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 |
| 59 | + with: |
| 60 | + output-dir: wheelhouse/ |
| 61 | + only: ${{ matrix.python }}-manylinux_riscv64 |
| 62 | + env: |
| 63 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 64 | + # numpy is both a build (test) and runtime requirement, and only our registry |
| 65 | + # has it for riscv64; only-binary keeps a newer PyPI release from winning the |
| 66 | + # resolution and then compiling from sdist. |
| 67 | + CIBW_ENVIRONMENT: >- |
| 68 | + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ |
| 69 | + PIP_ONLY_BINARY=numpy |
| 70 | +
|
| 71 | + - name: Store wheels |
| 72 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 73 | + with: |
| 74 | + name: numpy-minmax-${{ env.NUMPY_MINMAX_VERSION }}-${{ matrix.python }}-manylinux_riscv64 |
| 75 | + path: ./wheelhouse/*.whl |
| 76 | + if-no-files-found: error |
| 77 | + |
| 78 | + publish: |
| 79 | + name: Publish numpy-minmax ${{ inputs.version || '0.6.0' }} |
| 80 | + needs: [setup, build_wheels] |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + pull-requests: write |
| 84 | + uses: $/.github/workflows/_publish-wheel.yml |
| 85 | + with: |
| 86 | + artifact-pattern: numpy-minmax-${{ inputs.version || '0.6.0' }}-*-manylinux_riscv64 |
0 commit comments