chore: Update Android SDK installation process in build workflow #14
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" | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- test-apk | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set Up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Install Android SDK Command Line Tools | |
run: | | |
mkdir -p $HOME/android-sdk | |
cd $HOME/android-sdk | |
wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip | |
unzip commandlinetools-linux-8512546_latest.zip | |
mkdir cmdline-tools | |
mv cmdline-tools/* cmdline-tools | |
rm -rf commandlinetools-linux-8512546_latest.zip | |
- name: Install Android SDK Platform and Build Tools | |
run: | | |
yes | $HOME/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk --update | |
yes | $HOME/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platforms;android-35" "build-tools;35.0.0" | |
- name: Accept Android SDK Licenses | |
run: yes | $HOME/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk --licenses | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
- name: Flutter analyze | |
run: flutter analyze | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Build Android | |
run: flutter build apk --release |