Skip to content

workflows: migrate canonical cibuildwheel builds #17

workflows: migrate canonical cibuildwheel builds

workflows: migrate canonical cibuildwheel builds #17

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# Based on upstream's own deploy.yml build_wheels job, which is a thin wrapper
# around pyproject.toml's [tool.cibuildwheel] table; narrowed here to riscv64
# by overriding just the arch and image (before-build/test-command/
# test-requires are read from pyproject.toml as upstream already declares them).
name: Build pykvfinder wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/pykvfinder.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-pykvfinder.yml'
- 'docs/packages/pykvfinder.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-pykvfinder.yml'
- 'docs/packages/pykvfinder.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: pykvfinder
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build pykvfinder ${{ 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: "pykvfinder"
version: "${{ matrix.version }}"
repository: "LBC-LNBio/pyKVFinder"
ref: "v${{ matrix.version }}"
artifact-tag: "${{ matrix.python }}-${{ matrix.platform }}_riscv64"
cibw-build: "${{ matrix.python }}-${{ matrix.platform }}_riscv64"
cibw-environment-linux: "PIP_ONLY_BINARY=numpy,matplotlib,pillow,contourpy,kiwisolver"
gpl_sources:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Collect GPL sources (gcc) for pykvfinder ${{ matrix.version }}
runs-on: ubuntu-24.04-riscv
env:
PYKVFINDER_VERSION: ${{ matrix.version }}
steps:
- name: Collect gcc source RPM from manylinux_riscv64
uses: riseproject-dev/python-wheels/actions/collect-gpl-sources@main
with:
image: ${{ env.MANYLINUX_RISCV64_IMAGE }}
packages: gcc
output: gpl-sources.tar
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pykvfinder-${{ env.PYKVFINDER_VERSION }}-gpl-sources
path: gpl-sources.tar
if-no-files-found: error
publish:
name: Publish pykvfinder ${{ 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: pykvfinder-${{ matrix.version }}-*-manylinux_riscv64
gpl-sources-artifact: pykvfinder-${{ matrix.version }}-gpl-sources
gpl-sources-description: gcc