diff --git a/.github/workflows/build-transformations.yml b/.github/workflows/build-transformations.yml new file mode 100644 index 000000000000..a975a6cb9e04 --- /dev/null +++ b/.github/workflows/build-transformations.yml @@ -0,0 +1,109 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on upstream's own wheel workflow: +# https://github.com/cgohlke/transformations/blob/v2026.8.8/.github/workflows/wheel.yml +name: Build transformations wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/transformations.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-transformations.yml' + - 'docs/packages/transformations.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-transformations.yml' + - 'docs/packages/transformations.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: transformations + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build transformations ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp314t"] + # Upstream's CIBW_BUILD ("cp312-* cp314t-*"): one cp312-abi3 wheel, built on + # its floor and retested on cp313/cp314 like upstream's 3.14 abi3 test step, + # plus a non-abi3 free-threaded wheel. + include: + - python: cp312 + build: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 + - python: cp314t + build: cp314t-manylinux_riscv64 + + env: + TRANSFORMATIONS_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout transformations v${{ env.TRANSFORMATIONS_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: cgohlke/transformations + ref: v${{ env.TRANSFORMATIONS_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.build }} + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT: >- + CG_LIMITED_API=1 + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + CIBW_TEST_REQUIRES: numpy pytest + CIBW_TEST_COMMAND: python -m pytest --doctest-modules --pyargs transformations + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: transformations-${{ env.TRANSFORMATIONS_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish transformations ${{ 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: transformations-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/transformations.yaml b/docs/packages/transformations.yaml new file mode 100644 index 000000000000..6e247fa4fa46 --- /dev/null +++ b/docs/packages/transformations.yaml @@ -0,0 +1,5 @@ +package-name: transformations +source-code: https://github.com/cgohlke/transformations +license: BSD-3-Clause +versions: +- version: 2026.8.8