mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[android] Streamline Google Play metadata handling
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
7df2188212
commit
44eca9ab5e
@@ -12,19 +12,12 @@ jobs:
|
||||
environment: production
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
# TODO: use shallow (and sparse?) checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Parallel submodules checkout
|
||||
shell: bash
|
||||
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: Parallel submodules checkout
|
||||
# shell: bash
|
||||
# run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
|
||||
- name: Restore release keys
|
||||
shell: bash
|
||||
@@ -37,6 +30,6 @@ jobs:
|
||||
|
||||
- name: Upload
|
||||
shell: bash
|
||||
run: ./gradlew prepareGoogleReleaseListing publishGoogleReleaseListing
|
||||
run: ./gradlew publishGoogleReleaseListing
|
||||
working-directory: android
|
||||
timeout-minutes: 5
|
||||
|
||||
@@ -372,32 +372,6 @@ android.applicationVariants.all { variant ->
|
||||
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 {
|
||||
enabled.set(false)
|
||||
track.set('production')
|
||||
|
||||
Reference in New Issue
Block a user