feat: add multi-architecture APK support for all Android platforms
This commit is contained in:
39
.github/workflows/android-release.yml
vendored
39
.github/workflows/android-release.yml
vendored
@@ -13,6 +13,9 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
abi: ["arm64-v8a", "armeabi-v7a", "x86", "x86_64"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -40,18 +43,48 @@ jobs:
|
|||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
|
|
||||||
- name: Build Release APK
|
- name: Modify build.gradle for specific ABI
|
||||||
|
run: |
|
||||||
|
sed -i 's/abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")/abiFilters += listOf("${{ matrix.abi }}")/g' app/build.gradle.kts
|
||||||
|
|
||||||
|
- name: Build Release APK for ${{ matrix.abi }}
|
||||||
run: ./gradlew assembleRelease
|
run: ./gradlew assembleRelease
|
||||||
env:
|
env:
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Rename APK with ABI suffix
|
||||||
|
run: |
|
||||||
|
cd app/build/outputs/apk/release
|
||||||
|
for file in *.apk; do
|
||||||
|
mv "$file" "${file%.apk}-${{ matrix.abi }}.apk"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Upload APK artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: apk-${{ matrix.abi }}
|
||||||
|
path: app/build/outputs/apk/release/*-${{ matrix.abi }}.apk
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download all APK artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: apks
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: app/build/outputs/apk/release/*.apk
|
files: |
|
||||||
|
apks/**/*.apk
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
name: ${{ github.ref_name }}
|
||||||
|
body: ""
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ captures
|
|||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
local.properties
|
local.properties
|
||||||
|
*.ps1
|
||||||
6
.idea/appInsightsSettings.xml
generated
Normal file
6
.idea/appInsightsSettings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AppInsightsSettings">
|
||||||
|
<option name="selectedTabId" value="Android Vitals" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -16,17 +16,31 @@ android {
|
|||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
proguardFiles(
|
proguardFiles(
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
splits {
|
||||||
|
abi {
|
||||||
|
isEnable = true
|
||||||
|
reset()
|
||||||
|
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
|
||||||
|
isUniversalApk = true
|
||||||
|
}
|
||||||
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
|||||||
31
app/proguard-rules.pro
vendored
31
app/proguard-rules.pro
vendored
@@ -1,21 +1,16 @@
|
|||||||
# Add project specific ProGuard rules here.
|
-keepattributes SourceFile,LineNumberTable
|
||||||
# You can control the set of applied configuration files using the
|
-renamesourcefileattribute SourceFile
|
||||||
# proguardFiles setting in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
-keep class org.json.** { *; }
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
-keep class org.osmdroid.** { *; }
|
||||||
# class:
|
-keep class org.mapsforge.** { *; }
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
-keepclassmembers class * {
|
||||||
# debugging stack traces.
|
@androidx.compose.runtime.Composable <methods>;
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
}
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
-keep class androidx.compose.** { *; }
|
||||||
# hide the original source file name.
|
-keep class kotlin.** { *; }
|
||||||
#-renamesourcefileattribute SourceFile
|
|
||||||
|
-dontwarn org.osmdroid.**
|
||||||
|
-dontwarn org.mapsforge.**
|
||||||
Reference in New Issue
Block a user