[android][ci] Actualize stores

Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
This commit is contained in:
Roman Tsisyk 2021-05-16 09:17:07 +03:00
parent aed79c71df
commit 43c9eb0936
2 changed files with 40 additions and 172 deletions

View file

@ -5,10 +5,20 @@ on:
- '202*' # Approved manually via `production` environment
jobs:
android-google-release:
name: Android Google Release
android-release:
name: Android Release
runs-on: ubuntu-latest
environment: production
strategy:
matrix:
include:
- flavor: google
bundle: true
- flavor: huawei
bundle: true
- flavor: samsung
- flavor: amazon
- flavor: web
steps:
- name: Install build tools and dependencies
shell: bash
@ -50,67 +60,20 @@ jobs:
shell: bash
working-directory: android
run: |
./gradlew bundleGoogleRelease
./gradlew bundle${{ matrix.flavor }}release assemble${{ matrix.flavor }}release
- name: Upload AAB to Artifacts
uses: actions/upload-artifact@v2
if: ${{ matrix.bundle }}
with:
name: google-release-aab
path: ./android/build/outputs/bundle/googleRelease/OrganicMaps-*-google-release.aab
name: ${{ matrix.flavor }}-release-aab
path: ./android/build/outputs/bundle/${{ matrix.flavor }}Release/OrganicMaps-*-${{ matrix.flavor }}-release.aab
if-no-files-found: error
android-web-release:
name: Android Web Release
runs-on: ubuntu-latest
environment: production
steps:
- name: Install build tools and dependencies
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Checkout sources
uses: actions/checkout@v2
- name: Parallel submodules checkout
shell: bash
run: git submodule update --init --recursive --jobs=$(($(nproc) * 2))
- name: Checkout private keys
uses: actions/checkout@v2
with:
repository: ${{ secrets.PRIVATE_REPO }}
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
ref: master
path: private.git
- name: Configure repo with private keys
shell: bash
run: |
./configure.sh ./private.git
rm -rf ./private.git
- name: Set up SDK
shell: bash
run: (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT)
- name: Compile
shell: bash
working-directory: android
run: |
./gradlew -Pfirebase assembleWebRelease \
uploadCrashlyticsMappingFileWebRelease \
uploadCrashlyticsSymbolFileWebRelease
- name: Upload APK to Artifacts
uses: actions/upload-artifact@v2
if: ${{ !matrix.bundle }}
with:
name: web-release-apk
path: ./android/build/outputs/apk/web/release/OrganicMaps-*-web-release.apk
name: ${{ matrix.flavor }}-release-apk
path: ./android/build/outputs/apk/${{ matrix.flavor }}/release/OrganicMaps-*-${{ matrix.flavor }}-release.apk
if-no-files-found: error

View file

@ -11,8 +11,9 @@ buildscript {
//
// Detect flavors from the task name.
def isFdroid = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase().contains("fdroid");
def isBeta = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase().contains("beta");
def taskName = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase();
def isFdroid = taskName.contains("fdroid");
def isBeta = taskName.contains("beta");
// Enable Google Mobile Services for all flavors except fdroid.
def googleMobileServicesDefault = !isFdroid;
@ -185,26 +186,24 @@ android {
ndk {
abiFilters = new HashSet<>()
if (project.hasProperty('arm32') || project.hasProperty('armeabi-v7a')) {
println('Building for armeabi-v7a')
abiFilters.add('armeabi-v7a')
} else if (project.hasProperty('arm64') || project.hasProperty('arm64-v8a')) {
println('Building for arm64-v8a')
abiFilters.add('arm64-v8a')
} else if (project.hasProperty('x86_64')) {
println('Building for x86_64')
abiFilters.add('x86_64')
} else if (project.hasProperty('x86')) {
println('Building for x86')
abiFilters.add('x86')
} else {
if (!project.hasProperty('splitApk')) {
println('Building for armeabi-v7a, arm64-v8a, x86, x86_64')
abiFilters.add('x86')
abiFilters.add('x86_64')
abiFilters.add('armeabi-v7a')
abiFilters.add('arm64-v8a')
}
}
if (project.hasProperty('arm64') || project.hasProperty('arm64-v8a')) {
abiFilters.add('arm64-v8a')
}
if (project.hasProperty('x86_64')) {
abiFilters.add('x86_64')
}
if (project.hasProperty('x86')) {
abiFilters.add('x86')
}
if (abiFilters.isEmpty()) {
abiFilters.add('armeabi-v7a')
abiFilters.add('arm64-v8a')
abiFilters.add('x86_64')
abiFilters.add('x86')
}
println('Building for ' + String.join(", ", abiFilters))
}
}
@ -233,7 +232,6 @@ android {
productFlavors {
// See getVersion()
final int HUAWEI_VERSION_CODE_BASE = 01_00_00_00_00
final int TENCENT_VERSION_CODE_BASE = 02_00_00_00_00
google {
dimension "default"
@ -245,7 +243,7 @@ android {
samsung {
dimension "default"
versionName = android.defaultConfig.versionName + '-Samsung'
buildConfigField 'String', 'REVIEW_URL', '"samsungapps://ProductDetail/app.omaps"'
buildConfigField 'String', 'REVIEW_URL', '"samsungapps://ProductDetail/app.organicmaps"'
buildConfigField 'String', 'SUPPORT_MAIL', '"samsung@organicmaps.app"'
android.sourceSets.samsung.assets.srcDirs = ['flavors/world-enabled']
}
@ -253,44 +251,12 @@ android {
amazon {
dimension "default"
versionName = android.defaultConfig.versionName + '-Amazon'
buildConfigField 'String', 'REVIEW_URL', '"amzn://apps/android?p=app.omaps"'
buildConfigField 'String', 'REVIEW_URL', '"amzn://apps/android?p=app.organicmaps"'
buildConfigField 'String', 'SUPPORT_MAIL', '"amazon@organicmaps.app"'
buildConfigField 'int', 'RATING_THRESHOLD', '4'
android.sourceSets.amazon.assets.srcDirs = ['flavors/world-enabled']
}
yandex {
dimension "default"
versionName = android.defaultConfig.versionName + '-Yandex'
buildConfigField 'String', 'REVIEW_URL', '"yastore://details?id=app.omaps"'
android.sourceSets.yandex.assets.srcDirs = ['flavors/world-enabled']
}
preinstall {
dimension "default"
versionName = android.defaultConfig.versionName + '-Preinstall'
buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@organicmaps.app"'
}
cipherlab {
dimension "default"
versionName = android.defaultConfig.versionName + '-CipherLab'
android.sourceSets.cipherlab.assets.srcDirs = ['flavors/world-enabled']
}
xiaomi {
dimension "default"
versionName = android.defaultConfig.versionName + '-Xiaomi'
buildConfigField 'String', 'REVIEW_URL', '"http://app.mi.com/detail/85835?ref=search"'
android.sourceSets.xiaomi.assets.srcDirs = ['flavors/world-enabled']
}
lenovo {
dimension "default"
versionName = android.defaultConfig.versionName + '-Lenovo'
android.sourceSets.lenovo.assets.srcDirs = ['flavors/world-enabled']
}
web {
dimension "default"
versionName = android.defaultConfig.versionName + '-Web'
@ -305,58 +271,6 @@ android {
//android.sourceSets.fdroid.assets.srcDirs = ['flavors/world-enabled']
}
nineApp {
dimension "default"
versionName = android.defaultConfig.versionName + '-9app'
buildConfigField 'String', 'REVIEW_URL', '"http://www.9apps.com/android-apps/mapswithme-maps-pro/"'
android.sourceSets.nineApp.assets.srcDirs = ['flavors/world-enabled']
}
mobogenie {
dimension "default"
versionName = android.defaultConfig.versionName + '-Mobogenie'
android.sourceSets.mobogenie.assets.srcDirs = ['flavors/world-enabled']
buildConfigField 'String', 'REVIEW_URL', '"http://www.mobogenie.com/download-maps-me-4240212.html"'
}
tencent {
dimension "default"
versionName = android.defaultConfig.versionName + '-Tencent'
versionCode TENCENT_VERSION_CODE_BASE + android.defaultConfig.versionCode
android.sourceSets.tencent.assets.srcDirs = ['flavors/world-enabled']
buildConfigField 'String', 'REVIEW_URL', '"http://android.myapp.com/myapp/detail.htm?apkName=app.omaps"'
}
baidu {
dimension "default"
versionName = android.defaultConfig.versionName + '-Baidu'
android.sourceSets.baidu.assets.srcDirs = ['flavors/world-enabled']
buildConfigField 'String', 'REVIEW_URL', '"http://shouji.baidu.com/software/item?docid=7999892&f=sug@software"'
}
appChina {
dimension "default"
versionName = android.defaultConfig.versionName + '-AppChina'
android.sourceSets.appChina.assets.srcDirs = ['flavors/world-enabled']
buildConfigField 'String', 'REVIEW_URL', '"http://www.appchina.com/app/app.omaps"'
}
moboMarket {
dimension "default"
versionName = android.defaultConfig.versionName + '-MoboMarket'
android.sourceSets.moboMarket.assets.srcDirs = ['flavors/world-enabled']
// TODO While store url is unknown, force all rating reviews to be sent to our email.
// Change it in the next version after publishing app to the store.
buildConfigField 'int', 'RATING_THRESHOLD', '6'
}
blackberry {
dimension "default"
versionName = android.defaultConfig.versionName + '-Blackberry'
android.sourceSets.blackberry.assets.srcDirs = ['flavors/world-enabled']
buildConfigField 'String', 'REVIEW_URL', '"https://appworld.blackberry.com/webstore/content/51013892"'
}
huawei {
dimension "default"
versionName = android.defaultConfig.versionName + '-Huawei'
@ -366,15 +280,6 @@ android {
}
}
variantFilter { variant ->
if (!variant.getFlavors().get(0).name.equals("web")
&& !variant.getFlavors().get(0).name.equals("google")
&& !variant.getFlavors().get(0).name.equals("fdroid")
&& !project.hasProperty("anyVariant")) {
variant.setIgnore(true)
}
}
splits.abi {
boolean enabled = project.hasProperty('splitApk')
println ("Create separate apks: " + enabled)