Skip to content

docs: Update projects #60

docs: Update projects

docs: Update projects #60

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/googleapis/google-cloud-python/blob/google-crc32c-v1.9.0/packages/google-crc32c/scripts/manylinux/build_on_centos.sh
name: Build google-crc32c wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/google-crc32c.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-google-crc32c.yml'
- 'docs/packages/google-crc32c.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-google-crc32c.yml'
- 'docs/packages/google-crc32c.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: google-crc32c
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build google-crc32c ${{ 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:
GOOGLE_CRC32C_VERSION: ${{ matrix.version }}
steps:
# googleapis/python-crc32c was archived after 1.8.0; the package now
# lives in the google-cloud-python monorepo under per-package tags.
- name: Checkout google-cloud-python google-crc32c-v${{ env.GOOGLE_CRC32C_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: googleapis/google-cloud-python
ref: google-crc32c-v${{ env.GOOGLE_CRC32C_VERSION }}
sparse-checkout: packages/google-crc32c
submodules: recursive
persist-credentials: false
- uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
package-dir: packages/google-crc32c
env:
CIBW_ARCHS: riscv64
CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# Build libcrc32c into the default prefix so setup.py's -lcrc32c resolves.
# POLICY_VERSION_MINIMUM: the pinned crc32c still declares cmake_minimum 3.1.
CIBW_BEFORE_ALL_LINUX: >-
cmake -S {project}/packages/google-crc32c/google_crc32c -B /tmp/crc32c-build
-DCMAKE_BUILD_TYPE=Release
-DCRC32C_BUILD_TESTS=no
-DCRC32C_BUILD_BENCHMARKS=no
-DBUILD_SHARED_LIBS=yes
-DCMAKE_POLICY_VERSION_MINIMUM=3.12
&&
cmake --build /tmp/crc32c-build --target install -j4
&&
ldconfig
# Force the C extension; without this setup.py silently ships a pure-Python
# wheel on any compile/link failure (gotcha 20).
CIBW_ENVIRONMENT: CRC32C_PURE_PYTHON=0
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >-
python -c "import google_crc32c; assert google_crc32c.implementation == 'c', google_crc32c.implementation" &&
pytest -v {package}/tests
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: google-crc32c-${{ env.GOOGLE_CRC32C_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: ./wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish google-crc32c ${{ 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: google-crc32c-${{ matrix.version }}-*-manylinux_riscv64