Skip to content

Build connectorx wheels (riscv64) #3

Build connectorx wheels (riscv64)

Build connectorx wheels (riscv64) #3

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
#
# This workflow is based on: https://github.com/sfu-db/connector-x/blob/main/.github/workflows/release.yml
name: Build connectorx wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'connectorx version to build (git tag without leading v, e.g. 0.4.5)'
required: true
default: '0.4.5'
pull_request:
paths:
- '.github/workflows/build-connectorx.yml'
concurrency:
group: ${{ github.workflow }}-${{ inputs.version || '0.4.5' }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
CONNECTORX_VERSION: ${{ inputs.version || '0.4.5' }}
CARGO_BUILD_JOBS: '2'
jobs:
setup:
uses: $/.github/workflows/_setup.yml
build_wheels:
needs: [setup]
name: Build connectorx ${{ inputs.version || '0.4.5' }} ${{ matrix.python-version }}-riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 1440
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14']
steps:
- name: Checkout connector-x v${{ env.CONNECTORX_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: sfu-db/connector-x
ref: v${{ env.CONNECTORX_VERSION }}
persist-credentials: false
- name: Install Python
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: false
- name: Build wheel
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
command: build
target: riscv64gc-unknown-linux-gnu
args: >-
--manifest-path connectorx-python/Cargo.toml
-i ${{ matrix.python-version }}
--release
--features integrated-auth-gssapi
--out dist
manylinux: '2_39'
before-script-linux: |
# gotcha 46: Rocky 10 is missing FindBin/Time::Piece even with
# perl-core, so openssl-sys's vendored Configure needs full perl.
# libgssapi-sys's build.rs needs gssapi.h, which krb5-libs (runtime
# only) doesn't ship -- krb5-devel has the headers.
dnf -y install perl krb5-libs krb5-devel clang-devel libffi-devel
git config --global --add safe.directory "*"
env:
SQLITE3_STATIC: '1'
- name: Test wheel
run: |
uv pip install --force-reinstall dist/*.whl
python -c "import connectorx"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: connectorx-${{ env.CONNECTORX_VERSION }}-${{ matrix.python-version }}-riscv64
path: dist/*.whl
if-no-files-found: error
publish:
name: Publish connectorx ${{ inputs.version || '0.4.5' }}
needs: [setup, build_wheels]
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
with:
artifact-pattern: connectorx-${{ inputs.version || '0.4.5' }}-*-riscv64