Skip to content

docs: Update projects #5

docs: Update projects

docs: Update projects #5

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on: https://github.com/dahlia/iterfzf/blob/1.9.0.67.0/.github/workflows/release.yaml
# and https://github.com/dahlia/iterfzf/blob/1.9.0.67.0/.github/workflows/test.yaml
name: Build iterfzf wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/iterfzf.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-iterfzf.yml'
- 'docs/packages/iterfzf.yaml'
- 'patches/iterfzf/**'
push:
branches: [main]
paths:
- '.github/workflows/build-iterfzf.yml'
- 'docs/packages/iterfzf.yaml'
- 'patches/iterfzf/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: iterfzf
version: ${{ inputs.version }}
build_wheel:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build iterfzf ${{ matrix.version }} py3-none-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 30
env:
ITERFZF_VERSION: ${{ matrix.version }}
steps:
- name: Checkout iterfzf ${{ matrix.version }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: dahlia/iterfzf
ref: ${{ env.ITERFZF_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/iterfzf/${{ env.ITERFZF_VERSION }}/*.patch
- name: Install Python
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: '3.12'
activate-environment: true
enable-cache: false
- name: Install build
run: uv pip install build
# GITHUB_TOKEN lifts the anonymous rate limit on the release lookup
# build_dist.py makes to resolve the fzf asset, as upstream's own jobs do.
- name: Build wheel
env:
GITHUB_TOKEN: ${{ github.token }}
run: GOOS=linux GOARCH=riscv64 python -m build --wheel .
- name: Verify the wheel ships the riscv64 fzf binary
run: |
python - dist/*.whl <<'EOF'
import sys, zipfile
with zipfile.ZipFile(sys.argv[1]) as zf:
names = zf.namelist()
print("\n".join(names))
assert sys.argv[1].endswith("-py3-none-manylinux_2_39_riscv64.whl"), sys.argv[1]
assert "iterfzf/fzf" in names, names
assert "iterfzf/fzf.exe" not in names, names
licenses = sorted(n.rsplit("/", 1)[-1] for n in names if ".dist-info/licenses/" in n)
assert licenses == ["LICENSE"], licenses
header = zf.read("iterfzf/fzf")[:20]
assert header[:4] == b"\x7fELF", header
assert header[18] == 0xF3, header
EOF
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: iterfzf-${{ env.ITERFZF_VERSION }}-py3-none-manylinux_riscv64
path: dist/*.whl
if-no-files-found: error
test_wheel:
name: Test iterfzf ${{ matrix.version }} on Python ${{ matrix.python-version }}
needs: [setup, build_wheel]
if: needs.setup.outputs.versions != '[]'
runs-on: ubuntu-24.04-riscv
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
python-version: ['3.12', '3.13', '3.14', '3.14t']
env:
ITERFZF_VERSION: ${{ matrix.version }}
steps:
- name: Download wheel
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: iterfzf-${{ env.ITERFZF_VERSION }}-py3-none-manylinux_riscv64
- name: Install Python
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: false
- name: Install the wheel
run: |
uv pip install --reinstall --no-index --find-links . iterfzf
uv pip install pytest
# tox.ini's first two commands; the other two assert that iterfzf([])
# returns None, which raises AttributeError at this tag on every platform.
- name: Run upstream's wheel checks
run: |
python -c "import sys; sys.path.remove(''); from iterfzf import BUNDLED_EXECUTABLE as e; assert e"
python -c "import sys; sys.path.remove(''); from iterfzf import BUNDLED_EXECUTABLE as e; import os; assert os.execl(e, e, '--version') == 0"
# The suite resolves fzf from PATH, so it runs the wheel's own binary.
# The three deselected cases open the full-screen picker and need an
# interactive terminal, which is why upstream's CI runs tox and not this.
- name: Run upstream's tests
run: |
PATH="$(python -c 'import iterfzf, os; print(os.path.dirname(iterfzf.__file__))'):$PATH" \
python -m pytest --pyargs iterfzf.test_iterfzf -v \
-k 'not test_no_query and not test_supports_color_kwarg and not test_select_one_ambiguous'
publish:
name: Publish iterfzf ${{ matrix.version }}
needs: [setup, build_wheel, test_wheel]
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: iterfzf-${{ matrix.version }}-py3-none-manylinux_riscv64