Repository navigation
docs: update crcmod-plus (#2585) #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # Based on the `wheels` job of | |
| # https://github.com/ntamas/crcmod-plus/blob/2.3.1/.github/workflows/build.yml | |
| # and the tox `testenv` the `build` job runs. | |
| name: Build crcmod-plus wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/crcmod-plus.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-crcmod-plus.yml' | |
| - 'docs/packages/crcmod-plus.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-crcmod-plus.yml' | |
| - 'docs/packages/crcmod-plus.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: crcmod-plus | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build crcmod-plus ${{ matrix.version }} ${{ matrix.tag }}-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| include: | |
| # setup.py tags every non-free-threaded CPython wheel cp311-abi3, so | |
| # one build serves them all; the free-threaded build cannot use the | |
| # limited API. cp313t is dropped: the riscv64 manylinux image ships | |
| # none. | |
| - tag: cp311-abi3 | |
| # Built on cp311 -- the oldest interpreter the abi3 tag claims -- | |
| # and re-tested on the newer ones. The extension parses arguments | |
| # with "s#", so a wheel compiled against 3.13+ headers raises | |
| # SystemError on 3.11 and 3.12. | |
| build: >- | |
| cp311-manylinux_riscv64 cp312-manylinux_riscv64 | |
| cp313-manylinux_riscv64 cp314-manylinux_riscv64 | |
| - tag: cp314t | |
| build: cp314t-manylinux_riscv64 | |
| env: | |
| CRCMOD_PLUS_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout crcmod-plus ${{ env.CRCMOD_PLUS_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: ntamas/crcmod-plus | |
| ref: ${{ env.CRCMOD_PLUS_VERSION }} | |
| persist-credentials: false | |
| - name: Write a cibuildwheel config without upstream's `enable` groups | |
| # Upstream's only [tool.cibuildwheel] setting is | |
| # `enable = ["cpython-freethreading", "pypy"]`; cibuildwheel 4 removed | |
| # the free-threading group (it is always on) and refuses to parse it. | |
| run: printf '[tool.cibuildwheel]\n' > "$RUNNER_TEMP/cibuildwheel.toml" | |
| - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| with: | |
| config-file: ${{ runner.temp }}/cibuildwheel.toml | |
| env: | |
| CIBW_ARCHS: riscv64 | |
| CIBW_BUILD: ${{ matrix.build }} | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| CIBW_TEST_REQUIRES: pytest | |
| CIBW_TEST_SOURCES: tests | |
| CIBW_TEST_COMMAND: >- | |
| python -c "import crcmod._crcfunext as m; assert m.__file__.endswith('.so'), m.__file__" && | |
| python -m pytest tests | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: crcmod-plus-${{ env.CRCMOD_PLUS_VERSION }}-${{ matrix.tag }}-manylinux_riscv64 | |
| path: ./wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish crcmod-plus ${{ matrix.version }} | |
| needs: [setup, build_wheels] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: $/.github/workflows/_publish-wheel.yml | |
| secrets: | |
| app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} | |
| with: | |
| artifact-pattern: crcmod-plus-${{ matrix.version }}-*-manylinux_riscv64 |