Repository navigation
workflows: migrate canonical cibuildwheel builds #90
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 | |
| --- | |
| # Based on the `build-wheels` job of | |
| # https://github.com/Locked-chess-official/private_attribute_cpp/blob/2.1.17/.github/workflows/python-publish.yml | |
| # and the test step of | |
| # https://github.com/Locked-chess-official/private_attribute_cpp/blob/2.1.17/.github/workflows/test.yml | |
| name: Build private-attribute-cpp wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/private-attribute-cpp.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-private-attribute-cpp.yml' | |
| - 'docs/packages/private-attribute-cpp.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-private-attribute-cpp.yml' | |
| - 'docs/packages/private-attribute-cpp.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 | |
| MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: private-attribute-cpp | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build private-attribute-cpp ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.platform }}_riscv64 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: ${{ fromJSON(needs.setup.outputs.matrix) }} | |
| uses: $/.github/workflows/_build-cibuildwheel.yml | |
| with: | |
| package: "private-attribute-cpp" | |
| version: "${{ matrix.version }}" | |
| repository: "Locked-chess-official/private_attribute_cpp" | |
| ref: "${{ matrix.version }}" | |
| artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" | |
| cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64" | |
| cibw-musllinux-riscv64-image: "quay.io/pypa/musllinux_1_2_riscv64" | |
| cibw-test-requires: "pytest" | |
| cibw-test-sources: "tests" | |
| cibw-test-command: "python -X faulthandler -m pytest tests -vvs -W error" | |
| gpl_sources: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Collect GPL sources | |
| runs-on: ubuntu-24.04-riscv | |
| env: | |
| PRIVATE_ATTRIBUTE_CPP_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # auditwheel vendors the GCC C++ runtime (libstdc++/libgcc_s) into the | |
| # musllinux wheels. | |
| - uses: ./actions/collect-gpl-sources | |
| with: | |
| image: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| packages: gcc | |
| output: gpl-sources.tar | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: private-attribute-cpp-${{ env.PRIVATE_ATTRIBUTE_CPP_VERSION }}-gpl-sources | |
| path: gpl-sources.tar | |
| publish: | |
| name: Publish private-attribute-cpp ${{ matrix.version }} | |
| needs: [setup, build_wheels, gpl_sources] | |
| 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: private-attribute-cpp-${{ matrix.version }}-*riscv64 | |
| gpl-sources-artifact: private-attribute-cpp-${{ matrix.version }}-gpl-sources | |
| gpl-sources-description: gcc |