为aarch64架构termux平台自动构建 (#1369)

* Update pyproject.toml

添加quickjs作为斗鱼平台js解释器

* Update ci.yml

增加aarch64架构termux平台自动构建

* Update README.md
This commit is contained in:
Heporis authored and GitHub committed 2025-07-24 02:32:03 +00:00
1 parent f4b75bf698
commit fd776a8207
3 files changed
+59 -1

No files matched your search

+51 -1
View File
@@ -196,6 +196,56 @@ jobs:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
termux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Build frontend
run: |
npm install
npm run build
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
- name: Install dependencies and Android target
run: |
pip install maturin
rustup target add aarch64-linux-android
- name: Set up CPython interpreter for cross-compilation
run: |
BASE_URL="https://packages.termux.dev/apt/termux-main/pool/main/p/python"
FNAME=$(curl -s "$BASE_URL/" | grep -oE 'python_[0-9]+\.[0-9]+\.[0-9]+_aarch64\.deb' | { IFS= read -r line; echo "$line"; })
wget -nv "$BASE_URL/$FNAME"
mkdir python
dpkg-deb -x $FNAME python
sed -i 's/pyo3 = { version = "0.24.0", features = \[.*\] }/pyo3 = { version = "0.24.0" }/' crates/stream-gears/Cargo.toml
cp -a python/data/data/com.termux/files/usr/lib/libpython* $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/24
- name: Build wheel for aarch64 (Termux)
run: |
export NDK_BIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC_aarch64_linux_android=$NDK_BIN/aarch64-linux-android24-clang
export AR_aarch64_linux_android=$NDK_BIN/llvm-ar
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$NDK_BIN/aarch64-linux-android24-clang
export PYO3_CROSS_LIB_DIR=python/data/data/com.termux/files/usr/lib/
maturin build \
--release \
--strip \
--manylinux off \
--target aarch64-linux-android \
--out dist
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-termux-aarch64
path: dist
sdist:
runs-on: ubuntu-latest
steps:
@@ -222,7 +272,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, musllinux, windows, macos, sdist]
needs: [linux, musllinux, windows, macos, termux, sdist]
permissions:
# Use to sign the release artifacts
id-token: write