Skip to content

ci: open the nightly PRs as the riseproject-dev github app #23

ci: open the nightly PRs as the riseproject-dev github app

ci: open the nightly PRs as the riseproject-dev github app #23

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/piccolomo/plotext/blob/6.0.0/.github/workflows/wheels.yml
name: Build plotext wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/plotext.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-plotext.yml'
- 'docs/packages/plotext.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-plotext.yml'
- 'docs/packages/plotext.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: plotext
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build plotext ${{ matrix.version }} py3-none-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
env:
PLOTEXT_VERSION: ${{ matrix.version }}
steps:
- name: Checkout plotext ${{ env.PLOTEXT_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: piccolomo/plotext
ref: ${{ env.PLOTEXT_VERSION }}
persist-credentials: false
- name: Build wheel
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
# setup.py's wheel_of_this_system.get_tag() tags the wheel py3-none-<platform>: the
# C++ kernel it compiles is loaded by ctypes, not tied to any interpreter, so one
# build serves every Python.
only: cp312-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# Mirrors upstream's own windows.yml unit-test invocation (the Linux wheels.yml
# job only runs pyproject.toml's one-line import smoke test).
CIBW_TEST_COMMAND: >-
python -m unittest plotext._tests.primitives plotext._tests.plots
plotext._tests.dates plotext._tests.fixed_bugs plotext._tests.hashes
plotext.prettydoc._tests.docs plotext.prettydoc._tests.hashes -v
- name: Check the wheel carries a riscv64 kernel.so
run: |
whl=$(ls wheelhouse/*.whl)
python3 - "$whl" <<'EOF'
import sys, zipfile
whl = sys.argv[1]
target = "plotext/_kernel/cpp/kernel.so"
names = zipfile.ZipFile(whl).namelist()
if target not in names:
raise SystemExit(f"error: {target} missing from {whl}")
zipfile.ZipFile(whl).extract(target, "kernel_check")
EOF
file kernel_check/plotext/_kernel/cpp/kernel.so | tee /dev/stderr | grep -q 'RISC-V'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: plotext-${{ env.PLOTEXT_VERSION }}-py3-none-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish plotext ${{ 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: plotext-${{ matrix.version }}-*-manylinux_riscv64