Skip to content

docs: Update projects #6

docs: Update projects

docs: Update projects #6

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the Linux-aarch64 job of
# https://github.com/alibaba/pemja/blob/release-0.6.2/.github/workflows/build_wheels.yml
# and on https://github.com/alibaba/pemja/blob/release-0.6.2/.github/workflows/java_tests.yml.
name: Build pemja wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/pemja.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-pemja.yml'
- 'docs/packages/pemja.yaml'
- 'patches/pemja/**'
push:
branches: [main]
paths:
- '.github/workflows/build-pemja.yml'
- 'docs/packages/pemja.yaml'
- 'patches/pemja/**'
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: pemja
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build pemja ${{ 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:
PEMJA_VERSION: ${{ matrix.version }}
steps:
- name: Checkout pemja release-${{ env.PEMJA_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: alibaba/pemja
ref: release-${{ env.PEMJA_VERSION }}
persist-credentials: false
- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false
- name: Patch pemja source
run: git apply python-wheels/patches/pemja/${{ env.PEMJA_VERSION }}/00*.patch
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# Upstream builds against JDK 8; Rocky 10 only packages JDK 21.
CIBW_BEFORE_ALL_LINUX: dnf -y install java-21-openjdk-devel
CIBW_ENVIRONMENT_LINUX: JAVA_HOME=/usr/lib/jvm/java-21-openjdk
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pemja-${{ env.PEMJA_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
test_wheels:
needs: [setup, build_wheels]
if: needs.setup.outputs.versions != '[]'
name: Test pemja ${{ matrix.version }} on Python ${{ matrix.python-version }}
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
python-version: ['3.12', '3.13', '3.14', '3.14t']
env:
PEMJA_VERSION: ${{ matrix.version }}
# The JVM side loads the shared libpython, which manylinux's CPython lacks and uv's ships.
UV_PYTHON_PREFERENCE: only-managed
steps:
- name: Checkout pemja release-${{ env.PEMJA_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: alibaba/pemja
ref: release-${{ env.PEMJA_VERSION }}
persist-credentials: false
- name: Download wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: pemja-${{ env.PEMJA_VERSION }}-*-manylinux_riscv64
path: dist
merge-multiple: true
- name: Install Python
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: false
# Temurin publishes no riscv64 JDK 11, upstream's test JDK.
- uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: '21'
architecture: riscv64
- name: Install Maven
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends maven
- name: Install the wheel
run: uv pip install --only-binary pemja --find-links dist "pemja==${PEMJA_VERSION}"
# Upstream's Java tests load the extension from the source tree (`build_ext --inplace`).
- name: Stage the wheel's extension modules in the source tree
run: |
site_pemja=$(python -c 'import importlib.util; print(importlib.util.find_spec("pemja").submodule_search_locations[0])')
cp -v "${site_pemja}"/pemja_*.so src/main/python/pemja/
# google-java-format 1.7, which spotless runs first, does not work on JDK 21.
- name: Run upstream's Java tests
run: mvn -B test -Dspotless.skip=true
publish:
name: Publish pemja ${{ matrix.version }}
needs: [setup, build_wheels, test_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: pemja-${{ matrix.version }}-*-manylinux_riscv64