diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3bd413dd41..8a678355c8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -106,8 +106,6 @@ jobs: - uses: actions/download-artifact@v4 with: name: Gallery Release (Maps) - - name: Remove apk release suffix - run: find . -name "Gallery-*.apk" -exec bash -c 'mv "$1" "${1//-release/}"' _ {} \; - name: Generate SHA256 run: find . -name "Gallery-*.apk" -exec bash -c 'sha256sum "$1" | awk '\''{print $1}'\'' > "$1.sha256"' _ {} \; - name: Create Release diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 34b60beb03..e81d17c82b 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -101,7 +101,7 @@ jobs: chmod +x ./strip_allfiles_permission.sh && ./strip_allfiles_permission.sh && echo ALL_FILES_ACCESS=false > ./app.properties - name: Build Google Play Bundle - run: ./gradlew bundleGplay + run: ./gradlew bundleUniversalGplay env: SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }} SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} @@ -111,15 +111,15 @@ jobs: with: serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} packageName: com.dot.gallery.gplay - releaseFiles: app/build/outputs/bundle/gplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-gplay.aab + releaseFiles: app/build/outputs/bundle/universalGplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-universal-gplay.aab track: production releaseName: ${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }} Release - mappingFile: app/build/outputs/mapping/gplay/mapping.txt - debugSymbols: app/build/intermediates/merged_native_libs/gplay/mergeGplayNativeLibs/out/lib + mappingFile: app/build/outputs/mapping/universalGplay/mapping.txt + debugSymbols: app/build/intermediates/merged_native_libs/universalGplay/mergeUniversalGplayNativeLibs/out/lib - uses: actions/upload-artifact@v4 with: name: Gallery Release (GPlay Bundle) - path: app/build/outputs/bundle/gplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-gplay.aab + path: app/build/outputs/bundle/universalGplay/Gallery-${{ steps.versionname.outputs.versionName }}-${{ steps.versioncode.outputs.versionCode }}-universal-gplay.aab release: needs: [build_nomaps, build_maps] @@ -131,8 +131,6 @@ jobs: - uses: actions/download-artifact@v4 with: name: Gallery Release (Maps) - - name: Remove apk release suffix - run: find . -name "Gallery-*.apk" -exec bash -c 'mv "$1" "${1//-release/}"' _ {} \; - name: Generate SHA256 run: find . -name "Gallery-*.apk" -exec bash -c 'sha256sum "$1" | awk '\''{print $1}'\'' > "$1.sha256"' _ {} \; - name: Create Release diff --git a/app/build.gradle.kts b/app/build.gradle.kts index be05cdec32..f04542a73f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,4 @@ +import com.android.build.gradle.internal.api.BaseVariantOutputImpl import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag import java.io.FileInputStream import java.util.Properties @@ -22,17 +23,14 @@ android { applicationId = "com.dot.gallery" minSdk = 30 targetSdk = 35 - versionCode = 31007 + versionCode = 31008 versionName = "3.1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary = true } - base.archivesName.set("Gallery-${versionName}-$versionCode") - if (getApiKey() == "\"DEBUG\"") { - base.archivesName.set("${base.archivesName.get()}-nomaps") - } + base.archivesName.set("Gallery-${versionName}-$versionCode" + mapsApiApplicationPrefix) } lint.baseline = file("lint-baseline.xml") @@ -119,19 +117,46 @@ android { schemaDirectory("$projectDir/schemas/") } - splits { - abi { - isEnable = true - reset() - include("armeabi-v7a", "arm64-v8a", "x86", "x86_64") - isUniversalApk = true - } - } - dependenciesInfo { // Disables dependency metadata when building APKs. includeInApk = false } + + flavorDimensions += listOf("abi") + productFlavors { + create("arm64-v8a") { + dimension = "abi" + versionCode = 4 + (android.defaultConfig.versionCode ?: 0) * 10 + ndk.abiFilters.add("arm64-v8a") + } + create("armeabi-v7a") { + dimension = "abi" + versionCode = 3 + (android.defaultConfig.versionCode ?: 0) * 10 + ndk.abiFilters.add("armeabi-v7a") + } + create("x86_64") { + dimension = "abi" + versionCode = 2 + (android.defaultConfig.versionCode ?: 0) * 10 + ndk.abiFilters.add("x86_64") + } + create("x86") { + dimension = "abi" + versionCode = 1 + (android.defaultConfig.versionCode ?: 0) * 10 + ndk.abiFilters.add("x86") + } + create("universal") { + dimension = "abi" + versionCode = 0 + (android.defaultConfig.versionCode ?: 0) * 10 + ndk.abiFilters.addAll(listOf("x86", "x86_64", "armeabi-v7a", "arm64-v8a")) + } + } + + applicationVariants.all { + outputs.forEach { output -> + (output as BaseVariantOutputImpl).outputFileName = + "Gallery-${versionName}-$versionCode-${productFlavors[0].name}" + mapsApiApplicationPrefix + ".apk" + } + } } dependencies { @@ -258,6 +283,14 @@ dependencies { debugRuntimeOnly(libs.compose.ui.test.manifest) } +val mapsApiApplicationPrefix: String + get() = if (getApiKey() == "\"DEBUG\"") { + "-nomaps" + } else { + "" + } + + fun getApiKey(): String { val fl = rootProject.file("api.properties") diff --git a/baselineProfile/build.gradle.kts b/baselineProfile/build.gradle.kts index 7e59830d70..023b206fa3 100644 --- a/baselineProfile/build.gradle.kts +++ b/baselineProfile/build.gradle.kts @@ -15,6 +15,25 @@ android { create("nonMinifiedStaging") { } } + flavorDimensions += listOf("abi") + productFlavors { + create("arm64-v8a") { + dimension = "abi" + ndk.abiFilters.add("arm64-v8a") + } + create("armeabi-v7a") { + dimension = "abi" + ndk.abiFilters.add("armeabi-v7a") + } + create("x86_64") { + dimension = "abi" + ndk.abiFilters.add("x86_64") + } + create("x86") { + dimension = "abi" + ndk.abiFilters.add("x86") + } + } namespace = "com.dot.baselineprofile" compileSdk = 34