Skip to content

workflows: migrate canonical cibuildwheel builds #14

workflows: migrate canonical cibuildwheel builds

workflows: migrate canonical cibuildwheel builds #14

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/chemfiles/chemfiles.py/blob/0.10.4/.github/workflows/wheels.yml
name: Build chemfiles wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/chemfiles.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-chemfiles.yml'
- 'docs/packages/chemfiles.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-chemfiles.yml'
- 'docs/packages/chemfiles.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
env:
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: chemfiles
version: ${{ inputs.version }}
build_wheel:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build chemfiles ${{ matrix.version }} py2.py3-none-manylinux_riscv64
uses: $/.github/workflows/_build-cibuildwheel.yml
with:
package: "chemfiles"
version: "${{ matrix.version }}"
repository: "chemfiles/chemfiles.py"
ref: "${{ matrix.version }}"
artifact-tag: "py2.py3-none-manylinux_riscv64"
checkout-submodules: "true"
# setup.py's own bdist_wheel override forces the py2.py3-none tag, so one build serves every interpreter.
cibw-build: "cp312-manylinux_riscv64"
# Every build-system requirement (setuptools, wheel, cmake >= 4.1) has a riscv64-compatible
# wheel, so the default isolated build works. cmake 4 rejects chemfiles'
# cmake_minimum_required(VERSION 2.8.12) (gotcha 257), and setup.py's `cmake --build` has
# no -j of its own.
cibw-environment-linux: "PIP_ONLY_BINARY=numpy CMAKE_POLICY_VERSION_MINIMUM=3.5 CMAKE_BUILD_PARALLEL_LEVEL=\"$(nproc)\""
cibw-test-requires: "numpy"
cibw-test-command: "python -c \"import chemfiles; chemfiles.Frame()\""
publish:
name: Publish chemfiles ${{ matrix.version }}
needs: [setup, build_wheel]
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: chemfiles-${{ matrix.version }}-*-manylinux_riscv64