Skip to content

Commit b1cb114

Browse files
committed
scikit-network: add build-scikit-network.yml for riscv64 wheels
1 parent b9f489d commit b1cb114

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# SPDX-FileCopyrightText: 2026 The RISE Project
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# Based on the Linux job of
5+
# https://github.com/sknetwork-team/scikit-network/blob/v0.33.5/.github/workflows/release.yml
6+
name: Build scikit-network wheels (riscv64)
7+
8+
on:
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'scikit-network version to build (git tag without leading v, e.g. 0.33.5)'
13+
required: true
14+
default: '0.33.5'
15+
pull_request:
16+
paths:
17+
- '.github/workflows/build-scikit-network.yml'
18+
- 'patches/scikit-network/**'
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ inputs.version || '0.33.5' }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read # to fetch code (actions/checkout)
26+
27+
env:
28+
SCIKIT_NETWORK_VERSION: ${{ inputs.version || '0.33.5' }}
29+
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
30+
31+
jobs:
32+
setup:
33+
uses: $/.github/workflows/_setup.yml
34+
35+
build_wheels:
36+
needs: [setup]
37+
name: Build scikit-network ${{ inputs.version || '0.33.5' }} ${{ matrix.python }}-manylinux_riscv64
38+
runs-on: ubuntu-24.04-riscv
39+
timeout-minutes: 90
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
# No cp314t: upstream's own release.yml/wheels_build.yml CIBW_BUILD lists
44+
# only cp310-cp314, and pyproject.toml pins cython <= 3.0.12 (3.1 breaks
45+
# the C++ build), a series with no declared free-threading support.
46+
python: ["cp312", "cp313", "cp314"]
47+
48+
steps:
49+
- name: Checkout scikit-network v${{ env.SCIKIT_NETWORK_VERSION }}
50+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
51+
with:
52+
repository: sknetwork-team/scikit-network
53+
ref: v${{ env.SCIKIT_NETWORK_VERSION }}
54+
persist-credentials: false
55+
56+
- name: Build wheels
57+
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
58+
with:
59+
output-dir: wheelhouse/
60+
only: ${{ matrix.python }}-manylinux_riscv64
61+
env:
62+
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
63+
CIBW_ENVIRONMENT: >-
64+
PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
65+
PIP_ONLY_BINARY=numpy,scipy
66+
CIBW_TEST_REQUIRES: pytest
67+
CIBW_TEST_COMMAND: python -m pytest --pyargs sknetwork -q
68+
69+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
70+
with:
71+
name: scikit-network-${{ env.SCIKIT_NETWORK_VERSION }}-${{ matrix.python }}-manylinux_riscv64
72+
path: ./wheelhouse/*.whl
73+
if-no-files-found: error
74+
75+
gpl_sources:
76+
needs: [setup]
77+
name: Collect GPL sources (gcc) for scikit-network ${{ inputs.version || '0.33.5' }}
78+
runs-on: ubuntu-24.04-riscv
79+
80+
steps:
81+
- name: Checkout python-wheels
82+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
83+
with:
84+
persist-credentials: false
85+
86+
# The extensions build with -fopenmp, so auditwheel vendors the image's libgomp.
87+
- uses: ./actions/collect-gpl-sources
88+
with:
89+
image: ${{ env.MANYLINUX_RISCV64_IMAGE }}
90+
packages: gcc
91+
output: gpl-sources.tar
92+
93+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
94+
with:
95+
name: scikit-network-${{ env.SCIKIT_NETWORK_VERSION }}-gpl-sources
96+
path: gpl-sources.tar
97+
if-no-files-found: error
98+
99+
publish:
100+
name: Publish scikit-network ${{ inputs.version || '0.33.5' }}
101+
needs: [setup, build_wheels, gpl_sources]
102+
permissions:
103+
contents: write
104+
pull-requests: write
105+
uses: $/.github/workflows/_publish-wheel.yml
106+
with:
107+
artifact-pattern: scikit-network-${{ inputs.version || '0.33.5' }}-*-manylinux_riscv64
108+
gpl-sources-artifact: scikit-network-${{ inputs.version || '0.33.5' }}-gpl-sources
109+
gpl-sources-description: gcc

0 commit comments

Comments
 (0)