Update main.yml #5
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: '0 0 1,15 * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
# Install dependencies | |
- name: Set up Build Environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3 python3-pip openjdk-11-jdk | |
pip install --upgrade buildozer | |
- name: Install Android SDK | |
run: | | |
mkdir -p $HOME/android-sdk | |
curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip | |
unzip -q sdk-tools.zip -d $HOME/android-sdk | |
rm sdk-tools.zip | |
export ANDROID_HOME=$HOME/android-sdk | |
export PATH=$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH | |
# Install the required Android SDK packages, including build-tools and platform | |
yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses | |
$ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "build-tools;33.0.2" "platforms;android-33" | |
$ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME "build-tools;36.0.0-rc1" # Ensure the specific build tools version | |
- name: Verify Aidl installation | |
run: | | |
echo "Verifying Aidl Installation..." | |
$ANDROID_HOME/build-tools/36.0.0-rc1/aidl --version | |
continue-on-error: true # Don't fail the build if aidl is not found. | |
- name: Build with Buildozer | |
uses: ArtemSBulgakov/buildozer-action@v1 | |
with: | |
command: buildozer android debug | |
buildozer_version: master | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: AndroidBuild | |
path: bin/*.apk |