[android] Streamline Google Play metadata handling

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-05-25 15:34:05 +07:00
committed by Konstantin Pastbin
parent 7df2188212
commit 44eca9ab5e
2 changed files with 5 additions and 38 deletions

View File

@@ -12,19 +12,12 @@ jobs:
environment: production environment: production
steps: steps:
- name: Checkout sources - name: Checkout sources
# TODO: use shallow (and sparse?) checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Parallel submodules checkout # - name: Parallel submodules checkout
shell: bash # shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) # run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Checkout screenshots
uses: actions/checkout@v4
with:
repository: ${{ secrets.SCREENSHOTS_REPO }}
ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }}
ref: main
path: screenshots
- name: Restore release keys - name: Restore release keys
shell: bash shell: bash
@@ -37,6 +30,6 @@ jobs:
- name: Upload - name: Upload
shell: bash shell: bash
run: ./gradlew prepareGoogleReleaseListing publishGoogleReleaseListing run: ./gradlew publishGoogleReleaseListing
working-directory: android working-directory: android
timeout-minutes: 5 timeout-minutes: 5

View File

@@ -372,32 +372,6 @@ android.applicationVariants.all { variant ->
variant.resValue 'string', 'app_id', variant.applicationId variant.resValue 'string', 'app_id', variant.applicationId
} }
task prepareGoogleReleaseListing {
// Prepares Google Play metainfo from F-Droid metainfo.
final sourceFlavor = 'fdroid'
final targetFlavor = 'google'
doLast {
final sourceDir = new File("${projectDir}/src/$sourceFlavor/play/listings")
final targetDir = new File("${projectDir}/src/$targetFlavor/play/listings")
final sourceFiles = fileTree(dir: sourceDir,
include: '**/*.txt', exclude: "**/*-${targetFlavor}.txt")
sourceFiles.each { File sourceFile ->
final locale = sourceFile.parentFile.getName()
final targetLocaleDir = new File(targetDir, locale)
if (!targetLocaleDir.isDirectory())
targetLocaleDir.mkdirs()
final targetFile = new File(targetLocaleDir, sourceFile.getName())
// Override Google-specific values by using ${name}-google.txt files.
final overrideFile = new File(sourceFile.getPath().replace('.txt', "-${targetFlavor}.txt"))
targetFile.text = overrideFile.exists() ? overrideFile.text : sourceFile.text
}
copy {
from "${projectDir}/../../screenshots/android"
into targetDir
}
}
}
play { play {
enabled.set(false) enabled.set(false)
track.set('production') track.set('production')