|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# This workflow is based on the `wheels` job of |
| 5 | +# https://github.com/tmontaigu/laszip-python/blob/0.3.0/.github/workflows/build.yml |
| 6 | +name: Build laszip wheels (riscv64) |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + version: |
| 12 | + description: 'laszip version to build (git tag, e.g. 0.3.0)' |
| 13 | + required: true |
| 14 | + default: '0.3.0' |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - '.github/workflows/build-laszip.yml' |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ inputs.version || '0.3.0' }}-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read # to fetch code (actions/checkout) |
| 25 | + |
| 26 | +env: |
| 27 | + # `inputs.version` is empty on pull_request events; default to 0.3.0 there. |
| 28 | + LASZIP_VERSION: ${{ inputs.version || '0.3.0' }} |
| 29 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 30 | + |
| 31 | +jobs: |
| 32 | + setup: |
| 33 | + uses: $/.github/workflows/_setup.yml |
| 34 | + |
| 35 | + build_wheels: |
| 36 | + needs: [setup] |
| 37 | + name: Build laszip ${{ inputs.version || '0.3.0' }} ${{ matrix.python }}-manylinux_riscv64 |
| 38 | + runs-on: ubuntu-24.04-riscv |
| 39 | + timeout-minutes: 60 |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + python: ["cp312", "cp313", "cp314", "cp314t"] |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Checkout laszip-python ${{ env.LASZIP_VERSION }} |
| 47 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 48 | + with: |
| 49 | + repository: tmontaigu/laszip-python |
| 50 | + ref: ${{ env.LASZIP_VERSION }} |
| 51 | + persist-credentials: false |
| 52 | + |
| 53 | + # The vendored LASzip (Apache-2.0) sources live under src/vendor/ rather than |
| 54 | + # at the project root, so scikit-build-core's default LICEN[CS]E* glob misses |
| 55 | + # it; stage a copy at the root for the glob to pick up (gotcha 32/44). |
| 56 | + - name: Stage the vendored LASzip licence |
| 57 | + run: cp src/vendor/LASzip-*/COPYING.txt LICENSE.laszip-core |
| 58 | + |
| 59 | + - name: Build wheels |
| 60 | + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 |
| 61 | + with: |
| 62 | + output-dir: wheelhouse/ |
| 63 | + only: ${{ matrix.python }}-manylinux_riscv64 |
| 64 | + env: |
| 65 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 66 | + # scikit-build-core fetches cmake/ninja from PyPI when missing on PATH, |
| 67 | + # and pybind11's headers need pip to resolve. |
| 68 | + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ |
| 69 | + # laszip/__init__.py is a pure-Python `from .laszip_core import *` shim; |
| 70 | + # probe the compiled extension module directly (gotcha 56). |
| 71 | + CIBW_TEST_COMMAND: >- |
| 72 | + python -c "import laszip.laszip_core as m; assert m.__file__.endswith('.so'), m.__file__; import laszip; laszip.LasZipHeader(); laszip.LasZipDll()" |
| 73 | +
|
| 74 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 75 | + with: |
| 76 | + name: laszip-${{ env.LASZIP_VERSION }}-${{ matrix.python }}-manylinux_riscv64 |
| 77 | + path: wheelhouse/*.whl |
| 78 | + if-no-files-found: error |
| 79 | + |
| 80 | + publish: |
| 81 | + name: Publish laszip ${{ inputs.version || '0.3.0' }} |
| 82 | + needs: [setup, build_wheels] |
| 83 | + permissions: |
| 84 | + contents: write |
| 85 | + pull-requests: write |
| 86 | + uses: $/.github/workflows/_publish-wheel.yml |
| 87 | + with: |
| 88 | + artifact-pattern: laszip-${{ inputs.version || '0.3.0' }}-*-manylinux_riscv64 |
0 commit comments