docs: Update projects #77
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 `linux` job of | |
| # https://github.com/Atero-ai/fastokens/blob/v0.3.1/.github/workflows/build-maturin.yml | |
| name: Build fastokens wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/fastokens.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-fastokens.yml' | |
| - 'docs/packages/fastokens.yaml' | |
| - 'patches/fastokens/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-fastokens.yml' | |
| - 'docs/packages/fastokens.yaml' | |
| - 'patches/fastokens/**' | |
| 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: fastokens | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build fastokens ${{ matrix.version }} cp39-abi3-manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 360 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| env: | |
| FASTOKENS_VERSION: ${{ matrix.version }} | |
| steps: | |
| - name: Checkout fastokens v${{ env.FASTOKENS_VERSION }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: Atero-ai/fastokens | |
| ref: v${{ env.FASTOKENS_VERSION }} | |
| persist-credentials: false | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: python-wheels | |
| persist-credentials: false | |
| - name: Patch fastokens source | |
| run: git apply python-wheels/patches/fastokens/${{ env.FASTOKENS_VERSION }}/*.patch | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 | |
| with: | |
| output-dir: wheelhouse/ | |
| env: | |
| # pyo3's abi3-py39 feature is on unconditionally (python/Cargo.toml), so one | |
| # cp39-abi3 wheel serves every GIL-ful interpreter; upstream ships no | |
| # free-threaded wheel because abi3 and Py_GIL_DISABLED only meet on 3.14+. | |
| # cibuildwheel compiles once on cp39 -- the oldest interpreter the tag claims | |
| # -- and re-tests that wheel on the newer ones. musllinux is dropped: | |
| # rustup.rs ships no riscv64 musl toolchain. | |
| CIBW_BUILD: >- | |
| cp39-manylinux_riscv64 cp310-manylinux_riscv64 | |
| cp311-manylinux_riscv64 cp312-manylinux_riscv64 | |
| cp313-manylinux_riscv64 cp314-manylinux_riscv64 | |
| CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} | |
| # fastokens ships no [tool.cibuildwheel], so the Rust toolchain its maturin | |
| # backend needs is installed in-container here. | |
| 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" | |
| CIBW_TEST_REQUIRES: pytest | |
| CIBW_TEST_SOURCES: python/tests | |
| # test_thread_safety.py downloads Qwen/Qwen3-0.6B from the Hugging Face Hub. | |
| CIBW_TEST_COMMAND: >- | |
| python -m pytest -v python/tests | |
| --ignore=python/tests/test_thread_safety.py | |
| - name: Check the extension made it into the wheel | |
| run: | | |
| python3 - wheelhouse/*.whl <<'EOF' | |
| import sys, zipfile | |
| for whl in sys.argv[1:]: | |
| names = zipfile.ZipFile(whl).namelist() | |
| assert "fastokens/_native.abi3.so" in names, names | |
| assert any(n.endswith(".dist-info/licenses/LICENSE") for n in names), names | |
| assert any(n.endswith(".dist-info/licenses/NOTICES.txt") for n in names), names | |
| print(whl, "ok") | |
| EOF | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: fastokens-${{ env.FASTOKENS_VERSION }}-cp39-abi3-manylinux_riscv64 | |
| path: wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish: | |
| name: Publish fastokens ${{ 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: fastokens-${{ matrix.version }}-*-manylinux_riscv64 |