Optimize building workflow

Signed-off-by: GarfieldHan <2652609017@qq.com>
This commit is contained in:
GarfieldHan
2024-07-17 19:05:31 +08:00
parent 31724e1592
commit a9f3c6f372
2 changed files with 11 additions and 12 deletions

View File

@@ -9,9 +9,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -19,23 +17,24 @@ jobs:
submodules: "recursive" submodules: "recursive"
fetch-depth: 0 fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle - name: Setup Gradle
uses: gradle/gradle-build-action@v3 uses: gradle/actions/setup-gradle@v3
with: with:
gradle-home-cache-cleanup: true gradle-home-cache-cleanup: true
- name: Set up JDK 17 - name: Setup Android SDK
uses: actions/setup-java@v4 uses: android-actions/setup-android@v3
with: with:
distribution: 'temurin' packages: ''
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle - name: Build with Gradle
run: | run: |
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null
./gradlew zipRelease ./gradlew zipRelease
./gradlew zipDebug ./gradlew zipDebug

View File

@@ -33,7 +33,7 @@ val androidMinSdkVersion by extra(31)
val androidTargetSdkVersion by extra(34) val androidTargetSdkVersion by extra(34)
val androidCompileSdkVersion by extra(34) val androidCompileSdkVersion by extra(34)
val androidBuildToolsVersion by extra("34.0.0") val androidBuildToolsVersion by extra("34.0.0")
val androidCompileNdkVersion by extra("27.0.11902837") val androidCompileNdkVersion by extra("27.0.12077973")
val androidSourceCompatibility by extra(JavaVersion.VERSION_17) val androidSourceCompatibility by extra(JavaVersion.VERSION_17)
val androidTargetCompatibility by extra(JavaVersion.VERSION_17) val androidTargetCompatibility by extra(JavaVersion.VERSION_17)