diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml new file mode 100644 index 0000000000..b00a83f016 --- /dev/null +++ b/.github/workflows/build-android.yml @@ -0,0 +1,53 @@ +name: Build Android Wheels + +on: + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build_android_wheels: + name: Build Android wheels + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + + - uses: actions/setup-python@v5 + with: + python-version: '3.14' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y curl default-jdk patchelf + + - name: Set up Android SDK + run: | + mkdir -p $HOME/android-sdk/cmdline-tools + cd $HOME/android-sdk/cmdline-tools + curl -O https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip + unzip commandlinetools-linux-*.zip + mv cmdline-tools latest + echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV + echo "$HOME/android-sdk/cmdline-tools/latest/bin:$HOME/android-sdk/platform-tools" >> $GITHUB_PATH + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==3.1.4 + + - name: Build Android wheels + run: python -m cibuildwheel --platform android --output-dir wheelhouse + env: + CIBW_ENVIRONMENT_ANDROID: > + CMAKE_ARGS="-DLLAMA_NATIVE=OFF -DLLAMA_AVX=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF" + CMAKE_BUILD_TYPE="Release" + CIBW_TEST_SKIP: "*android*" + CIBW_BEFORE_BUILD: "pip install cmake ninja setuptools-scm" + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: android-wheels + path: ./wheelhouse/*.whl