Update android_build.yml #7
Workflow file for this run
This file contains 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 APK | |
on: | |
push: | |
branches: [ testing ] | |
pull_request: | |
branches: [ testing ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9.20' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install buildozer cython | |
pip install kivy==2.3.0 aiohttp==3.9.3 requests==2.31.0 beautifulsoup4==4.12.3 Unidecode==1.3.8 pywebview pillow platformdirs plyer proxy_tools bottle typing_extensions cryptography brotli | |
sudo apt-get update | |
sudo apt-get install -y \ | |
python3-pip \ | |
build-essential \ | |
git \ | |
python3 \ | |
python3-dev \ | |
ffmpeg \ | |
libsdl2-dev \ | |
libsdl2-image-dev \ | |
libsdl2-mixer-dev \ | |
libsdl2-ttf-dev \ | |
libportmidi-dev \ | |
libswscale-dev \ | |
libavformat-dev \ | |
libavcodec-dev \ | |
zlib1g-dev | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Accept Android SDK licenses | |
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses | |
- name: Install Android SDK Build-Tools | |
run: | | |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;33.0.0" | |
echo "ANDROID_BUILD_TOOLS_PATH=$ANDROID_HOME/build-tools/33.0.0" >> $GITHUB_ENV | |
- name: Set up Buildozer | |
run: | | |
buildozer init | |
sed -i 's/^android.accept_sdk_license =.*/android.accept_sdk_license = True/' buildozer.spec | |
sed -i 's/^android.sdk_path =.*/android.sdk_path = \/usr\/local\/lib\/android\/sdk/' buildozer.spec | |
sed -i 's/^android.ndk_path =.*/android.ndk_path = \/usr\/local\/lib\/android\/ndk/' buildozer.spec | |
sed -i 's/^android.build_tools =.*/android.build_tools = 33.0.0/' buildozer.spec | |
- name: Build APK | |
env: | |
ANDROID_HOME: ${{ env.ANDROID_SDK_ROOT }} | |
ANDROID_BUILD_TOOLS_PATH: ${{ env.ANDROID_BUILD_TOOLS_PATH }} | |
run: | | |
cd projects/android | |
buildozer android debug | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-debug | |
path: projects/android/bin/*.apk |