From 1b6ce2c2d7321ca708a733de93d73abc1550db91 Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Sun, 22 Nov 2026 09:21:10 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.github/wo?= =?UTF-8?q?rkflows/'=20with=20remote=20'config/workflows/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/scorecard.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d0af6a5292a..45b756ccfc1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -49,7 +49,7 @@ jobs: with: swap-size-gb: 10 - name: Initialize CodeQL - uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 + uses: github/codeql-action/init@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4 with: languages: ${{ matrix.language }} - name: Set up JDK 21 @@ -65,4 +65,4 @@ jobs: echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" ./gradlew --no-daemon assembleDebug - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 + uses: github/codeql-action/analyze@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 7fe87600d7e..28b6bc74472 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -34,7 +34,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0 + uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0 with: results_file: results.sarif results_format: sarif @@ -42,6 +42,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 + uses: github/codeql-action/upload-sarif@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4 with: sarif_file: results.sarif From b01c0d25863b5e88ae5906bc07aabef19ed17a13 Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Sun, 22 Nov 2026 09:21:11 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'fastlane/'?= =?UTF-8?q?=20with=20remote=20'config/fastlane/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- fastlane/common.Fastfile | 22 ++++++++++++++ fastlane/fdroid.init.gradle | 46 +++++++++++++++++++++++++++++ fastlane/fdroid.init.gradle.license | 2 ++ 3 files changed, 70 insertions(+) create mode 100644 fastlane/fdroid.init.gradle create mode 100644 fastlane/fdroid.init.gradle.license diff --git a/fastlane/common.Fastfile b/fastlane/common.Fastfile index 9cd6467caa4..2370440f9d0 100644 --- a/fastlane/common.Fastfile +++ b/fastlane/common.Fastfile @@ -20,6 +20,9 @@ MAJOR_MULTIPLIER = 10000000 MINOR_MULTIPLIER = 10000 PATCH_MULTIPLIER = 100 +FDROID_ABI_VERSION_CODES = { "armeabi-v7a" => 1, "arm64-v8a" => 2, "x86" => 3, "x86_64" => 4 }.freeze +FDROID_ABI_MULTIPLIER = 10 + TYPE_ALPHA = "alpha" TYPE_RC = "rc" TYPE_FINAL = "final" @@ -78,6 +81,15 @@ platform :android do uploadToHuawei(versionCode: versionInfo["versionCode"], isPrerelease: isPrerelease) end + desc "Build ABI APKs for F-Droid in app/build/fdroid/" + lane :buildFdroid do + gradle( + task: ":app:assembleGenericRelease", + flags: "--init-script fastlane/fdroid.init.gradle", + properties: { "fdroidAbiSplit" => true } + ) + end + desc "Print version info" lane :printVersionInfo do versionInfo = getVersionInfo() @@ -88,6 +100,9 @@ platform :android do print "Minor: #{versionComponents["minor"]}\n" print "Patch: #{versionComponents["patch"]}\n" print "Build: #{versionComponents["build"]}\n" + fdroidAbiVersionCodes(versionCode: versionInfo["versionCode"]).each do |abi, versionCode| + print "F-Droid #{abi} version code: #{versionCode}\n" + end end desc "Upload Alpha version to play store" @@ -142,6 +157,13 @@ platform :android do test end + desc "Generate F-Droid versionCode per ABI, must match fdroid.init.gradle" + private_lane :fdroidAbiVersionCodes do |options| + versionCode = options[:versionCode] + base = (versionCode / MAJOR_MULTIPLIER) * MAJOR_MULTIPLIER + (versionCode % MAJOR_MULTIPLIER) * FDROID_ABI_MULTIPLIER + FDROID_ABI_VERSION_CODES.transform_values { |abiCode| base + abiCode } + end + desc "Compute version name from version code" private_lane :generateVersionName do |versionComponents| suffix = "" diff --git a/fastlane/fdroid.init.gradle b/fastlane/fdroid.init.gradle new file mode 100644 index 00000000000..9b15457147a --- /dev/null +++ b/fastlane/fdroid.init.gradle @@ -0,0 +1,46 @@ +gradle.beforeProject { project -> + if (project.path != ':app' || !project.providers.gradleProperty('fdroidAbiSplit').isPresent()) { + return + } + if (project.extensions.extraProperties.has('nextcloudFdroidConfigured')) { + return + } + project.extensions.extraProperties.set('nextcloudFdroidConfigured', true) + + project.pluginManager.withPlugin('com.android.application') { + def abiVersionCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4] + def majorMultiplier = 10000000 + def abiMultiplier = 10 + def androidComponents = project.extensions.getByName('androidComponents') + + def buildDirectory = project.layout.buildDirectory.get() + project.layout.buildDirectory.set(buildDirectory.dir('fdroid')) + + androidComponents.finalizeDsl { android -> + ([android.defaultConfig] + android.buildTypes.toList() + android.productFlavors.toList()).each { config -> + config.ndk.abiFilters.clear() + } + android.splits.abi.enable = true + android.splits.abi.reset() + android.splits.abi.include(*abiVersionCodes.keySet().toArray(new String[0])) + android.splits.abi.universalApk = false + } + + androidComponents.beforeVariants(androidComponents.selector().all()) { variant -> + variant.enable = variant.name == 'genericRelease' + } + + androidComponents.onVariants(androidComponents.selector().withName('genericRelease')) { variant -> + variant.outputs.each { output -> + def abi = output.filters.find { it.filterType.name() == 'ABI' }?.identifier + if (!abiVersionCodes.containsKey(abi)) { + throw new GradleException("Unexpected F-Droid APK ABI: ${abi}") + } + def versionCode = output.versionCode.get() + def base = versionCode.intdiv(majorMultiplier) * majorMultiplier + + (versionCode % majorMultiplier) * abiMultiplier + output.versionCode.set(base + abiVersionCodes[abi]) + } + } + } +} diff --git a/fastlane/fdroid.init.gradle.license b/fastlane/fdroid.init.gradle.license new file mode 100644 index 00000000000..b6fc7379fab --- /dev/null +++ b/fastlane/fdroid.init.gradle.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors +SPDX-License-Identifier: GPL-3.0-or-later