Repository navigation
workflows: migrate canonical cibuildwheel builds #21
Workflow file for this run
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 | |
| --- | |
| # This workflow is based on upstream's own wheel builder: | |
| # https://github.com/sebastinas/cwcwidth/blob/v0.1.12/.github/workflows/publish-twine.yaml | |
| name: Build cwcwidth wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/cwcwidth.yaml not released yet' | |
| required: false | |
| default: '' | |
| cancel-in-progress: | |
| description: Cancel an in-progress run in the same concurrency group. | |
| required: false | |
| type: boolean | |
| default: true | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-cwcwidth.yml' | |
| - 'docs/packages/cwcwidth.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-cwcwidth.yml' | |
| - 'docs/packages/cwcwidth.yaml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ case(github.event_name == 'pull_request', true, github.event_name == 'workflow_dispatch', inputs['cancel-in-progress'], false) }} | |
| 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: cwcwidth | |
| version: ${{ inputs.version }} | |
| # setup.py hardcodes py_limited_api="cp311" whenever USE_LIMITED_API is set, so | |
| # the wheel is tagged cp311-abi3 regardless of which interpreter builds it. | |
| # Build on cp311 itself (CLAUDE.md gotcha 96) rather than our usual cp312 floor, | |
| # then reuse+test that wheel on cp312/cp313/cp314 (find_compatible_wheel). | |
| build_abi3: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Build cwcwidth ${{ matrix.version }} cp311-abi3-manylinux_riscv64 | |
| # Free-threaded wheel: setup.py's py_limited_api flag has no free-threaded ABI | |
| # to target, so this is an ordinary per-interpreter build. | |
| uses: $/.github/workflows/_build-cibuildwheel.yml | |
| with: | |
| package: "cwcwidth" | |
| version: "${{ matrix.version }}" | |
| repository: "sebastinas/cwcwidth" | |
| ref: "v${{ matrix.version }}" | |
| artifact-tag: "cp311-abi3-manylinux_riscv64" | |
| timeout-minutes: 90 | |
| cibw-build: "cp311-* cp312-* cp313-* cp314-*" | |
| cibw-environment-linux: "USE_LIMITED_API=1" | |
| # tests/ is a package (has __init__.py): pytest's prepend import mode | |
| # would otherwise put the checkout root on sys.path[0] and shadow the | |
| # installed wheel with the uncompiled cwcwidth/ source tree. | |
| cibw-test-sources: "tests" | |
| cibw-test-requires: "pytest" | |
| cibw-test-command: "pytest tests -v" | |
| cibw-test-environment: "LC_ALL=C.UTF-8 LANG=C.UTF-8" | |
| build_freethreaded: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Build cwcwidth ${{ matrix.version }} cp314t-manylinux_riscv64 | |
| uses: $/.github/workflows/_build-cibuildwheel.yml | |
| with: | |
| package: "cwcwidth" | |
| version: "${{ matrix.version }}" | |
| repository: "sebastinas/cwcwidth" | |
| ref: "v${{ matrix.version }}" | |
| artifact-tag: "cp314t-manylinux_riscv64" | |
| timeout-minutes: 90 | |
| cibw-build: "cp314t-*" | |
| cibw-test-sources: "tests" | |
| cibw-test-requires: "pytest" | |
| cibw-test-command: "pytest tests -v" | |
| cibw-test-environment: "LC_ALL=C.UTF-8 LANG=C.UTF-8" | |
| publish: | |
| name: Publish cwcwidth ${{ matrix.version }} | |
| needs: [setup, build_abi3, build_freethreaded] | |
| 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: | |
| matrix: ${{ needs.setup.outputs.matrix }} | |
| artifact-pattern: cwcwidth-${{ matrix.version }}-*-manylinux_riscv64 |