ci: build Android ARM64 wheels (rpds-py) via GitHub Actions #1
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
| name: Build Android ARM64 Wheels | |
| # 手动触发 或 push workflow 文件本身 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - '.github/workflows/build-android-wheels.yml' | |
| jobs: | |
| build-rpds-py: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| # rpds-py: Rust→Python 绑定, mcp SDK 的唯一编译依赖 | |
| # 其他包 (mcp/fastmcp-slim/cyclopts) 都是纯 Python, PyPI 直接下 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-linux-android | |
| - name: Install LLVM linker (lld) | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq lld | |
| echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=ld.lld" >> $GITHUB_ENV | |
| - name: Install maturin (pre-built x86_64) | |
| run: pip install maturin | |
| - name: Build rpds-py for Android ARM64 | |
| run: | | |
| git clone --depth 1 https://github.com/crate-py/rpds.git | |
| cd rpds | |
| # Cross-compile to aarch64-linux-android, platform tag for Termux | |
| maturin build \ | |
| --release \ | |
| --target aarch64-linux-android \ | |
| --interpreter python3.${{ matrix.python-version }} \ | |
| --out dist | |
| ls -lh dist/ | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rpds-py-aarch64-android-py${{ matrix.python-version }} | |
| path: rpds/dist/*.whl | |
| retention-days: 90 | |
| verify: | |
| needs: build-rpds-py | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: wheels | |
| - name: Show artifacts | |
| run: | | |
| echo "=== Built wheels ===" | |
| find wheels -name "*.whl" -exec ls -lh {} \; | |
| echo "" | |
| echo "=== Install on Termux ===" | |
| echo "1. Download artifact from Actions tab" | |
| echo "2. pip install rpds_py-*.whl" | |
| echo "3. pip install cyclopts mcp fastmcp-slim[server]" | |
| echo "" | |
| echo "=== One-liner (after downloading wheel) ===" | |
| echo "pip install ./rpds_py-*.whl && pip install cyclopts mcp 'fastmcp-slim[server]'" |