Repository navigation
rtoml: Add version 0.14.0 #12
Workflow file for this run
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: https://github.com/samuelcolvin/rtoml/blob/v0.13/.github/workflows/ci.yml | |
| name: Build rtoml wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/rtoml.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-rtoml.yml' | |
| - 'docs/packages/rtoml.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-rtoml.yml' | |
| - 'docs/packages/rtoml.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: rtoml | |
| version: ${{ inputs.version }} | |
| python_sdist: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| runs-on: ubuntu-latest | |
| env: | |
| RTOML_VERSION: ${{ matrix.version }} | |
| steps: | |
| # Upstream tags two components (v0.13) but the wheel says 0.13.0. | |
| - id: tag | |
| run: echo "ref=v${RTOML_VERSION%.0}" >> "$GITHUB_OUTPUT" | |
| - name: Checkout rtoml ${{ steps.tag.outputs.ref }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: samuelcolvin/rtoml | |
| ref: ${{ steps.tag.outputs.ref }} | |
| persist-credentials: false | |
| - name: Install Python | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| python-version: '3.12' | |
| activate-environment: true | |
| enable-cache: false | |
| - name: Build sdist | |
| id: build_sdist | |
| run: | | |
| set -euo pipefail | |
| rm -rf dist | |
| uv pip install 'maturin>=1,<2' build | |
| python -m build --sdist --outdir dist | |
| - name: Upload sdist artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: rtoml-${{ env.RTOML_VERSION }}-sdist | |
| path: dist/*.tar.gz | |
| if-no-files-found: error | |
| build_wheels: | |
| needs: [setup, python_sdist] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build rtoml ${{ 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) }} | |
| # rtoml's pyo3 dependency carries no abi3 feature, so upstream ships | |
| # cp3x-cp3x wheels per interpreter (not abi3) - every version needs its | |
| # own build. cp314t dropped (gotcha 227): the extension isn't built | |
| # declaring free-threading support, `import rtoml` raises "GIL has | |
| # been enabled" under Py_GIL_DISABLED, and upstream ships no cp314t | |
| # wheel on any platform either. | |
| python: ["cp312", "cp313", "cp314"] | |
| env: | |
| RTOML_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Fetch sdist artifact | |
| id: fetch_sdist | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: rtoml-${{ env.RTOML_VERSION }}-sdist | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| python-version: '3.12' | |
| activate-environment: true | |
| enable-cache: false | |
| - name: Build and test wheel | |
| env: | |
| CIBW_ARCHS: riscv64 | |
| # Only manylinux: rustup.rs ships no riscv64 musl host toolchain, so | |
| # musllinux can't build (same reason build-sqloxide.yml skips it). | |
| CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| # rtoml ships no [tool.cibuildwheel], so the Rust toolchain its | |
| # maturin backend needs is installed in-container here and put on PATH. | |
| 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 upstream's own `test` job (ci.yml), minus toml_test.py (needs | |
| # a cloned BurntSushi/toml-test + a Go build) and test_benchmarks.py | |
| # (needs dirty-equals/pytest-speed, not part of the runtime deps). | |
| # Tests live inside the sdist dir passed to cibuildwheel, so reference | |
| # them via {package} (= /project/rtoml), NOT {project} - see gotcha 5. | |
| CIBW_TEST_REQUIRES: pytest | |
| CIBW_TEST_COMMAND: >- | |
| pytest -q {package}/tests/test_load.py {package}/tests/test_dump.py | |
| {package}/tests/test_misc.py {package}/tests/test_order.py -v | |
| run: | | |
| set -euo pipefail | |
| mkdir rtoml | |
| tar zxf "${{ steps.fetch_sdist.outputs.download-path }}"/*.tar.gz \ | |
| --strip-components=1 -C rtoml | |
| uv pip install --upgrade cibuildwheel | |
| python -m cibuildwheel --output-dir wheelhouse ./rtoml | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: rtoml-${{ matrix.version }}-${{ matrix.python }}-manylinux_riscv64 | |
| path: ./wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish rtoml ${{ matrix.version }} | |
| needs: [setup, python_sdist, 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: rtoml-${{ matrix.version }}-*-manylinux_riscv64 |