diff --git a/.github/workflows/build-ormar-utils.yml b/.github/workflows/build-ormar-utils.yml new file mode 100644 index 000000000000..463d1cf741f8 --- /dev/null +++ b/.github/workflows/build-ormar-utils.yml @@ -0,0 +1,119 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/ormar-orm/ormar-utils/blob/v0.2.1/.github/workflows/ci.yml +name: Build ormar-utils wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/ormar-utils.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-ormar-utils.yml' + - 'docs/packages/ormar-utils.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-ormar-utils.yml' + - 'docs/packages/ormar-utils.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 + MUSLLINUX_RISCV64_IMAGE: quay.io/pypa/musllinux_1_2_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: ormar-utils + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build ormar-utils ${{ matrix.version }} ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # pyo3 carries abi3-py310 unconditionally (Cargo.toml), so one cp312 + # build (our floor) serves every non-free-threaded CPython, cp314 + # included, via abi3 forward compatibility. + # + # cp314t is dropped (gotcha 322/326): v0.2.1's Cargo.lock pins pyo3 + # 0.23.5, whose pyo3-ffi build script hard-errors "The configured + # Python interpreter version (3.14) is newer than PyO3's maximum + # supported version (3.13)" for any free-threaded interpreter. Unlike + # a non-free-threaded cp314 build (where PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 + # would clear the same check), this specific check is unconditional + # for Py_GIL_DISABLED builds and cannot be suppressed by any env var + # (confirmed by reading pyo3-ffi 0.23.5's build.rs directly). It + # reproduces identically on every architecture, not just riscv64: + # upstream's own CI (ci.yml) never builds or tests a free-threaded + # interpreter for this package either. pyo3 0.30.1 raises the + # ceiling to 3.15 and would fix this, but bumping a pinned + # dependency without being able to empirically verify the resulting + # compile is a real source change, not a CI knob - so cp314t is + # dropped here to match upstream's own tested scope instead. + python: ["cp312"] + libc: [manylinux, musllinux] + + env: + ORMAR_UTILS_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout ormar-utils v${{ env.ORMAR_UTILS_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: ormar-orm/ormar-utils + ref: v${{ env.ORMAR_UTILS_VERSION }} + persist-credentials: false + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.libc }}_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_MUSLLINUX_RISCV64_IMAGE: ${{ env.MUSLLINUX_RISCV64_IMAGE }} + CIBW_BEFORE_ALL_LINUX: >- + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + CIBW_ENVIRONMENT_LINUX: 'PATH="$PATH:$HOME/.cargo/bin"' + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_COMMAND: pytest {project}/tests -v + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ormar-utils-${{ env.ORMAR_UTILS_VERSION }}-${{ matrix.python }}-${{ matrix.libc }}_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish ormar-utils ${{ 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: ormar-utils-${{ matrix.version }}-*riscv64 diff --git a/docs/packages/ormar-utils.yaml b/docs/packages/ormar-utils.yaml new file mode 100644 index 000000000000..dc33251ac6af --- /dev/null +++ b/docs/packages/ormar-utils.yaml @@ -0,0 +1,5 @@ +package-name: ormar-utils +source-code: https://github.com/ormar-orm/ormar-utils +license: MIT +versions: +- version: 0.2.1