docs: Update projects (#2118) #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # This workflow is based on the `python-wheels` job of | |
| # https://github.com/xberg-io/html-to-markdown/blob/v3.12.0/.github/workflows/publish.yaml | |
| name: Build html-to-markdown wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/html-to-markdown.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-html-to-markdown.yml' | |
| - 'docs/packages/html-to-markdown.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-html-to-markdown.yml' | |
| - 'docs/packages/html-to-markdown.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: html-to-markdown | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| name: Build html-to-markdown ${{ matrix.version }} cp310-abi3-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 180 | |
| env: | |
| HTML_TO_MARKDOWN_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout html-to-markdown v${{ env.HTML_TO_MARKDOWN_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: xberg-io/html-to-markdown | |
| ref: v${{ env.HTML_TO_MARKDOWN_VERSION }} | |
| persist-credentials: false | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| with: | |
| package-dir: packages/python | |
| output-dir: wheelhouse/ | |
| env: | |
| # abi3-py310 is baked unconditionally into packages/python/pyproject.toml's | |
| # [tool.maturin] features, so one wheel serves every interpreter below; | |
| # there is no free-threaded build (pyo3 abi3 can't target Py_GIL_DISABLED, | |
| # and upstream itself ships no cp314t wheel). | |
| CIBW_BUILD: >- | |
| cp310-manylinux_riscv64 cp311-manylinux_riscv64 | |
| cp312-manylinux_riscv64 cp313-manylinux_riscv64 | |
| cp314-manylinux_riscv64 | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| # html-to-markdown ships no [tool.cibuildwheel]; the Rust toolchain its | |
| # maturin backend needs is installed in-container here, same as upstream's | |
| # own cibw-before-build-linux (publish.yaml's python-wheels job). | |
| CIBW_BEFORE_ALL_LINUX: >- | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| CIBW_ENVIRONMENT_LINUX: >- | |
| PATH="$PATH:$HOME/.cargo/bin" | |
| # Mirrors scripts/prepare_wheel.py, which upstream's own before-build also | |
| # runs: it cargo-builds the standalone CLI binary and bundles it into | |
| # html_to_markdown/bin and the wheel's .data/scripts before maturin builds | |
| # the extension module. | |
| CIBW_BEFORE_BUILD_LINUX: >- | |
| pip install maturin uv && | |
| python scripts/prepare_wheel.py | |
| CIBW_TEST_REQUIRES: pytest pytest-asyncio pytest-timeout | |
| CIBW_TEST_SOURCES: >- | |
| e2e/python/conftest.py e2e/python/pyproject.toml e2e/python/tests | |
| # test_options_preprocessing_{aggressive,minimal} raise | |
| # NameError: name 'PreprocessingPreset' is not defined at v3.12.0: the | |
| # test module's import line omits PreprocessingPreset even though it's | |
| # used later in the file and is exported by html_to_markdown.__init__; | |
| # upstream's main branch already carries the fixed import, just not yet | |
| # in a tagged release. Fails identically on every architecture. | |
| CIBW_TEST_COMMAND: >- | |
| python -c "import html_to_markdown._html_to_markdown as m; | |
| assert m.__file__.endswith('.so'), m.__file__" && | |
| python -m pytest -v e2e/python/tests | |
| -k "not test_options_preprocessing_aggressive and not test_options_preprocessing_minimal" | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: html-to-markdown-${{ env.HTML_TO_MARKDOWN_VERSION }}-cp310-abi3-manylinux_riscv64 | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish html-to-markdown ${{ 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: html-to-markdown-${{ matrix.version }}-*-manylinux_riscv64 |