Skip to content

Commit

Permalink
Generate split APKs for foss product flavor
Browse files Browse the repository at this point in the history
Signed-off-by: DrDisagree <[email protected]>
  • Loading branch information
Mahmud0808 committed Feb 16, 2025
1 parent 9c5573f commit 02ef5cf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,39 @@ jobs:
- name: Build with Gradle
run: |
./gradlew assembleFossDebug
./gradlew assembleFossDebug -PsplitApks
./gradlew assembleStandardDebug
- name: Upload FOSS Build Artifact
- name: Upload Standard Build Artifact
uses: actions/upload-artifact@v4
with:
name: "Iconify (FOSS) v${{ env.VERSION_NAME }} Dev (#${{github.run_number}})"
path: app/build/outputs/apk/foss/debug/*.apk
name: "Iconify Standard v${{ env.VERSION_NAME }} Dev (#${{github.run_number}})"
path: app/build/outputs/apk/standard/debug/*.apk
if-no-files-found: error

- name: Upload Standard Build Artifact
- name: Upload FOSS Build Artifacts
uses: actions/upload-artifact@v4
with:
name: "Iconify v${{ env.VERSION_NAME }} Dev (#${{github.run_number}})"
path: app/build/outputs/apk/standard/debug/*.apk
name: "Iconify (FOSS) v${{ env.VERSION_NAME }} Dev (#${{github.run_number}}) - arm64-v8a"
path: app/build/outputs/apk/foss/debug/*-arm64-v8a-*.apk
if-no-files-found: error

- uses: actions/upload-artifact@v4
with:
name: "Iconify (FOSS) v${{ env.VERSION_NAME }} Dev (#${{github.run_number}}) - armeabi-v7a"
path: app/build/outputs/apk/foss/debug/*-armeabi-v7a-*.apk
if-no-files-found: error

- uses: actions/upload-artifact@v4
with:
name: "Iconify (FOSS) v${{ env.VERSION_NAME }} Dev (#${{github.run_number}}) - x86"
path: app/build/outputs/apk/foss/debug/*-x86-*.apk
if-no-files-found: error

- uses: actions/upload-artifact@v4
with:
name: "Iconify (FOSS) v${{ env.VERSION_NAME }} Dev (#${{github.run_number}}) - x86_64"
path: app/build/outputs/apk/foss/debug/*-x86_64-*.apk
if-no-files-found: error

- name: Get Commit Messages
Expand Down Expand Up @@ -111,7 +129,7 @@ jobs:
- name: Clean Previous Release Folder
run: rm -rf releases && mkdir -p releases

- name: Zip Artifact for Deployment
- name: Zip Artifact for Sending to Telegram
run: |
cd app/build/outputs/apk/standard/debug/
zip "../../../../../../releases/Iconify v${{ env.VERSION_NAME }} Dev (#${{github.run_number}}).zip" *.apk -r
Expand Down
15 changes: 13 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
targetSdk = 35
versionCode = 22
versionName = "7.0.0"
setProperty("archivesBaseName", "Iconify v$versionName")
setProperty("archivesBaseName", "Iconify v${defaultConfig.versionName}")
buildConfigField("int", "MIN_SDK_VERSION", "$minSdk")
}

Expand Down Expand Up @@ -87,6 +87,17 @@ android {
}
}

if (hasProperty("splitApks")) {
splits {
abi {
isEnable = true
reset()
include("arm64-v8a", "armeabi-v7a", "x86", "x86_64")
isUniversalApk = false
}
}
}

buildFeatures {
viewBinding = true
dataBinding = true
Expand Down Expand Up @@ -256,4 +267,4 @@ dependencies {

tasks.register("printVersionName") {
println(android.defaultConfig.versionName?.replace("-(Stable|Beta)".toRegex(), ""))
}
}

0 comments on commit 02ef5cf

Please sign in to comment.