Skip to content

Build dumb-init wheels (riscv64) #3

Build dumb-init wheels (riscv64)

Build dumb-init wheels (riscv64) #3

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/Yelp/dumb-init/blob/v1.2.5/Makefile python-dists-% target
name: Build dumb-init wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'dumb-init version to build (PyPI version, e.g. 1.2.5.post1)'
required: true
default: '1.2.5.post1'
pull_request:
paths:
- '.github/workflows/build-dumb-init.yml'
- 'patches/dumb-init/**'
concurrency:
group: ${{ github.workflow }}-${{ inputs.version || '1.2.5.post1' }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
# `inputs.version` is empty on pull_request events; default to 1.2.5.post1 there.
DUMB_INIT_VERSION: ${{ inputs.version || '1.2.5.post1' }}
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
setup:
uses: $/.github/workflows/_setup.yml
build_wheel:
needs: [setup]
name: Build dumb-init ${{ inputs.version || '1.2.5.post1' }} py2.py3-none-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 30
steps:
# The v1.2.5 tag's setup.py has no .post1 suffix; 0002-*.patch adds it to
# match the sdist Yelp actually uploaded to PyPI as 1.2.5.post1.
- name: Determine upstream git tag
run: echo "DUMB_INIT_TAG=v${DUMB_INIT_VERSION%.post*}" >> "$GITHUB_ENV"
- name: Checkout dumb-init ${{ env.DUMB_INIT_TAG }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: Yelp/dumb-init
ref: ${{ env.DUMB_INIT_TAG }}
persist-credentials: false
- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false
- name: Patch dumb-init source
run: git apply python-wheels/patches/dumb-init/${{ env.DUMB_INIT_VERSION }}/*.patch
- name: Build wheel
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
# setup.py's own bdist_wheel override forces the py2.py3-none tag, so one build serves every interpreter.
only: cp312-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# pytest-timeout<2.0.0 (upstream's own pin) imports distutils.version.LooseVersion,
# which cp312+ dropped entirely (PEP 632); a modern pytest-timeout has no such
# dependency, so let pip pick the latest instead of upstream's stale Python-2-era cap.
CIBW_TEST_REQUIRES: pytest pytest-timeout
CIBW_TEST_SOURCES: tests testing VERSION pytest.ini
CIBW_TEST_COMMAND: python -m pytest tests -vv
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dumb-init-${{ env.DUMB_INIT_VERSION }}-py2.py3-none-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish dumb-init ${{ inputs.version || '1.2.5.post1' }}
needs: [setup, build_wheel]
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
with:
artifact-pattern: dumb-init-${{ inputs.version || '1.2.5.post1' }}-*-manylinux_riscv64