Skip to content

greenify: Add version 0.5.0 #3

greenify: Add version 0.5.0

greenify: Add version 0.5.0 #3

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# Based on upstream's own CI:
# https://github.com/douban/greenify/blob/v0.5.0/.github/workflows/publish.yml
name: Build greenify wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/greenify.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-greenify.yml'
- 'docs/packages/greenify.yaml'
- 'patches/greenify/**'
push:
branches: [main]
paths:
- '.github/workflows/build-greenify.yml'
- 'docs/packages/greenify.yaml'
- 'patches/greenify/**'
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: greenify
version: ${{ inputs.version }}
# One cp39-abi3 wheel: upstream's own bdist_wheel --py-limited-api=cp39,
# reused across cp312/cp313/cp314. No cp314t: upstream never builds or
# tests a free-threaded interpreter either.
build_abi3:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build greenify ${{ matrix.version }} cp39-abi3-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 60
env:
GREENIFY_VERSION: ${{ matrix.version }}
steps:
- name: Checkout greenify v${{ env.GREENIFY_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: douban/greenify
ref: v${{ env.GREENIFY_VERSION }}
persist-credentials: false
- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false
- name: Apply patches
run: git apply -v python-wheels/patches/greenify/${{ env.GREENIFY_VERSION }}/*.patch
- name: Build and test wheel
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
env:
CIBW_ARCHS: riscv64
CIBW_BUILD: 'cp312-* cp313-* cp314-*'
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# setup_requires=["Cython"] can't be trusted to self-fetch inside
# an isolated build env (easy_install is gone from modern
# setuptools); install it up front and keep it visible instead.
# setuptools itself must also be installed explicitly: this image's
# interpreters don't ship it pre-installed, and --no-build-isolation
# means pip never fetches a build backend into an isolated env, so
# "import setuptools.build_meta" would otherwise fail outright.
CIBW_BEFORE_BUILD: pip install Cython setuptools
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
# bdist_wheel only tags abi3 when told the floor explicitly
# (gotcha 11); setup.py's own Py_LIMITED_API macro is already
# fixed at 3.9, matching upstream's own --py-limited-api=cp39.
CIBW_CONFIG_SETTINGS: --build-option=--py-limited-api=cp39
# mod_http_head/setup.py imports distutils.core; cp312+ dropped
# the stdlib module, so setuptools (which shims it) must be present.
CIBW_TEST_REQUIRES: gevent setuptools
# misc/test.sh does a relative `cd tests/http_head`, assuming the
# cwd is already the project root; cibuildwheel runs
# CIBW_TEST_COMMAND from a fresh temp directory instead, so the
# cd has to happen here, not inside the script.
CIBW_TEST_COMMAND: cd {project} && bash misc/test.sh
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: greenify-${{ env.GREENIFY_VERSION }}-cp39-abi3-manylinux_riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish greenify ${{ matrix.version }}
needs: [setup, build_abi3]
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: greenify-${{ matrix.version }}-*-manylinux_riscv64