Skip to content

docs: Update projects #53

docs: Update projects

docs: Update projects #53

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# Based on the `build_wheels` job of
# https://github.com/kodonnell/qoi/blob/v0.7.2/.github/workflows/wheels.yml
name: Build qoi wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/qoi.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-qoi.yml'
- 'docs/packages/qoi.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-qoi.yml'
- 'docs/packages/qoi.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: qoi
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build qoi ${{ 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", "cp313", "cp314", "cp314t"]
env:
QOI_VERSION: ${{ matrix.version }}
steps:
- name: Checkout qoi v${{ env.QOI_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: kodonnell/qoi
ref: v${{ env.QOI_VERSION }}
persist-credentials: false
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
env:
CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# 0.8.0 rewrote the extension in Rust (PyO3 via maturin), replacing
# the setup.py+Cython build 0.7.2 still needs. maturin's own Rust
# auto-install (puccinialin) computes the wrong rustup target triple
# for riscv64 ("riscv64-unknown-linux-gnu" instead of
# "riscv64gc-unknown-linux-gnu") and fails, so a working toolchain
# has to be on PATH before it gets the chance to try, same as
# build-minijinja.yml.
CIBW_BEFORE_ALL_LINUX: ${{ matrix.version != '0.7.2' && 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y' || 'true' }}
# USE_CYTHON=1 matches upstream's own [tool.cibuildwheel] table for
# 0.7.2 (re-cythonize rather than build from the checked-in qoi.c).
# numpy is both a build-time header dependency (0.7.2's setup.py
# np.get_include(), 0.8.0's pyo3-numpy) and a runtime one
# (install_requires); only our registry has it for riscv64, and
# only-binary keeps a newer PyPI release from winning the
# resolution and compiling from sdist.
CIBW_ENVIRONMENT_LINUX: >-
${{ matrix.version == '0.7.2' && 'USE_CYTHON=1' || 'PATH="$PATH:$HOME/.cargo/bin"' }}
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
PIP_ONLY_BINARY=numpy,pillow
- name: Check wheel contents
run: |
python3 - wheelhouse/*.whl <<'EOF'
import sys, zipfile
for whl in sys.argv[1:]:
names = zipfile.ZipFile(whl).namelist()
exts = {n.split("/")[-1].split(".")[0] for n in names if n.endswith(".so")}
# 0.7.2's Cython extension is the top-level `qoi` module; 0.8.0's
# maturin/PyO3 build compiles the `_qoi` submodule (Cargo.toml's
# [lib] name, from pyproject.toml's module-name = "qoi._qoi").
assert exts == ({"qoi"} if "${{ matrix.version }}" == "0.7.2" else {"_qoi"}), exts
assert any(n.endswith("dist-info/licenses/LICENSE") for n in names), names
print(whl, "ok")
EOF
- name: Store wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: qoi-${{ env.QOI_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish qoi ${{ 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: qoi-${{ matrix.version }}-*-manylinux_riscv64