ci: avoid interactive Android license prompt in Gitea Actions
Some checks failed
Android build / build (push) Failing after 10m41s
Some checks failed
Android build / build (push) Failing after 10m41s
This commit is contained in:
@@ -10,29 +10,50 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 45
|
timeout-minutes: 60
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Java 17
|
- name: Set up Java 17
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
|
||||||
- name: Set up Android SDK
|
- name: Install Android SDK command-line tools and packages
|
||||||
uses: android-actions/setup-android@v3
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
|
||||||
|
export ANDROID_HOME="$ANDROID_SDK_ROOT"
|
||||||
|
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||||
|
curl -fsSL -o /tmp/commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip
|
||||||
|
rm -rf "$ANDROID_SDK_ROOT/cmdline-tools/latest" "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools"
|
||||||
|
unzip -q /tmp/commandlinetools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||||
|
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
||||||
|
export PATH="$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools:$PATH"
|
||||||
|
yes | sdkmanager --licenses >/dev/null
|
||||||
|
sdkmanager \
|
||||||
|
"platform-tools" \
|
||||||
|
"platforms;android-35" \
|
||||||
|
"build-tools;35.0.0"
|
||||||
|
|
||||||
- name: Make Gradle wrapper executable
|
- name: Make Gradle wrapper executable
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
|
|
||||||
- name: Build debug APK
|
- name: Build debug APK
|
||||||
|
env:
|
||||||
|
ANDROID_SDK_ROOT: ${{ env.HOME }}/.android/sdk
|
||||||
|
ANDROID_HOME: ${{ env.HOME }}/.android/sdk
|
||||||
run: ./gradlew --no-daemon clean assembleDebug
|
run: ./gradlew --no-daemon clean assembleDebug
|
||||||
|
|
||||||
- name: Build release AAB
|
- name: Build release AAB
|
||||||
|
env:
|
||||||
|
ANDROID_SDK_ROOT: ${{ env.HOME }}/.android/sdk
|
||||||
|
ANDROID_HOME: ${{ env.HOME }}/.android/sdk
|
||||||
run: ./gradlew --no-daemon bundleRelease
|
run: ./gradlew --no-daemon bundleRelease
|
||||||
|
|
||||||
- name: Upload debug APK
|
- name: Upload debug APK
|
||||||
|
|||||||
Reference in New Issue
Block a user