From b87ee95bae768bd7ad8615f0db7ea06b776b9846 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Sat, 20 Mar 2021 19:43:28 +0100 Subject: [PATCH] Fixed configure.sh script and gh actions Signed-off-by: Alexander Borsuk --- .github/workflows/android-beta.yaml | 29 +++--- .github/workflows/android-check.yaml | 2 +- .gitignore | 9 +- android/build.gradle | 15 ++- android/debug.keystore | Bin 0 -> 2216 bytes configure.sh | 103 +++++++++++++++++-- private/debug/android/debug.keystore | Bin 2605 -> 0 bytes private/debug/android/secure.properties | 6 -- private/debug/private.h => private_default.h | 2 +- 9 files changed, 126 insertions(+), 40 deletions(-) create mode 100644 android/debug.keystore delete mode 100644 private/debug/android/debug.keystore delete mode 100644 private/debug/android/secure.properties rename private/debug/private.h => private_default.h (98%) diff --git a/.github/workflows/android-beta.yaml b/.github/workflows/android-beta.yaml index d8800ca0d9..bd0cd14db9 100644 --- a/.github/workflows/android-beta.yaml +++ b/.github/workflows/android-beta.yaml @@ -16,27 +16,32 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - with: - submodules: recursive - - name: Checkout keys + - name: Parallel submodules checkout + shell: bash + run: | + git submodule update --init --recursive --jobs=20 + + - name: Checkout private keys uses: actions/checkout@v2 with: - repository: omapsapp/omapsapp-release-keys - path: private/release - ref: release - ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + repository: omapsapp/omapsapp-production-keys + token: ${{ secrets.PRIVATE_TOKEN }} + ref: master + path: private.git + + - name: Configure repo with private keys + shell: bash + repo-token: ${{ secrets.GITHUB_TOKEN }} + run: | + ./configure.sh ./private.git + rm -rf ./private.git - name: Remove old outputs shell: bash run: | rm -rf android/build/outputs/ - - name: Configure - shell: bash - run: | - ./configure.sh release - - name: Set up SDK shell: bash run: | diff --git a/.github/workflows/android-check.yaml b/.github/workflows/android-check.yaml index 88b1b5768d..6fe88d8068 100644 --- a/.github/workflows/android-check.yaml +++ b/.github/workflows/android-check.yaml @@ -17,7 +17,7 @@ jobs: with: submodules: recursive - - name: Configure + - name: Configure in Open Source mode shell: bash run: | ./configure.sh diff --git a/.gitignore b/.gitignore index c49cf0635f..0cd0ab49b4 100644 --- a/.gitignore +++ b/.gitignore @@ -159,18 +159,16 @@ tizen/*/crash-info/* .idea # Private repository files. -private/release -private/beta +.private_repository_url +.private_repository_branch private.h -android/*.keystore +android/release.keystore android/secure.properties -android/pushwoosh.properties android/libnotify.properties android/google-services.json android/firebase-app-distribution.json server iphone/Maps/app.omaps/ -private/ *.li @@ -200,4 +198,3 @@ tools/python/data/*/*.egg-info # Configs tools/python/maps_generator/var/etc/map_generator.ini tools/python/routing/etc/*.ini - diff --git a/android/build.gradle b/android/build.gradle index 1de91c05eb..0b685fa92d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -420,7 +420,14 @@ android { } signingConfigs { - mapswithme { + debug { + storeFile file('debug.keystore') + storePassword '12345678' + keyAlias 'debug' + keyPassword '12345678' + } + + release { storeFile file(spropStoreFile) storePassword spropStorePassword keyAlias spropKeyAlias @@ -434,14 +441,14 @@ android { versionNameSuffix '-debug' jniDebuggable true // Enable jni debug build zipAlignEnabled true - signingConfig signingConfigs.mapswithme + signingConfig signingConfigs.debug resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix resValue 'string', 'app_name', project.ext.appName + applicationIdSuffix ndk.debugSymbolLevel = 'SYMBOL_TABLE' } release { - signingConfig signingConfigs.mapswithme + signingConfig signingConfigs.release minifyEnabled true shrinkResources true proguardFile('proguard-mwm.txt') @@ -458,7 +465,7 @@ android { beta { applicationIdSuffix '.beta' versionNameSuffix '-beta' - signingConfig signingConfigs.mapswithme + signingConfig signingConfigs.release matchingFallbacks = ['debug', 'release'] resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix resValue 'string', 'app_name', project.ext.appName + applicationIdSuffix diff --git a/android/debug.keystore b/android/debug.keystore new file mode 100644 index 0000000000000000000000000000000000000000..64e002e93ae064274ad27c30338f1ffc2ef3e8b6 GIT bin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4 @@ -#!/bin/bash +#!/usr/bin/env bash # Please run this script to configure the repository after cloning it. # When configuring with private repository, the following override hierarchy is used: @@ -12,28 +12,111 @@ set -e -u BASE_PATH=$(cd "$(dirname "$0")"; pwd) +PRIVATE_HEADER="$BASE_PATH/private.h" +DEFAULT_PRIVATE_HEADER="$BASE_PATH/private_default.h" +PRIVATE_CAR_MODEL_COEFS="$BASE_PATH/routing_common/car_model_coefs.hpp" +DEFAULT_PRIVATE_CAR_MODEL_COEFS="$BASE_PATH/routing_common/car_model_coefs_default.hpp" + +PRIVATE_PROPERTIES="$BASE_PATH/android/secure.properties" +PRIVATE_NETWORK_CONFIG="$BASE_PATH/android/res/xml/network_security_config.xml" +PRIVATE_GOOGLE_SERVICES="$BASE_PATH/android/google-services.json" +SAVED_PRIVATE_REPO_FILE="$BASE_PATH/.private_repository_url" +SAVED_PRIVATE_BRANCH_FILE="$BASE_PATH/.private_repository_branch" +TMP_REPO_DIR="$BASE_PATH/.tmp.private.repo" + usage() { - echo "This tool configures omaps repository" + echo "This tool configures omaps with private repository or as an opensource build" + echo "Usage:" + echo " $0 private_repo_url [private_repo_branch] - to configure with private repository" + echo " echo '[private_repo_url] [private_repo_branch]' | $0 - alternate invocation for private repository configuration" + echo " $0 - to use with saved repository url and branch or to set up an open source build if nothing is saved" echo "" - echo "./configure.sh [debug|beta|release]" } -TYPE=${1:-debug} -if [ ! -f "private/$TYPE/private.h" ]; then - echo "Can find private/$TYPE configuration" >&2 +setup_opensource() { + echo "Initializing repository with default values in Open-Source mode." + cat "$DEFAULT_PRIVATE_HEADER" > "$PRIVATE_HEADER" + cat "$DEFAULT_PRIVATE_CAR_MODEL_COEFS" > "$PRIVATE_CAR_MODEL_COEFS" + echo 'ext { + spropStoreFile = "debug.keystore" + spropStorePassword = "12345678" + spropKeyAlias = "debug" + spropKeyPassword = "12345678" +} +' > "$PRIVATE_PROPERTIES" + echo ' + +' > "$PRIVATE_NETWORK_CONFIG" + echo '{"client": [{"api_key": [{"current_key": ""}], "client_info": {"mobilesdk_app_id": "omaps", "android_client_info": {"package_name": "app.omaps.debug"}}}], "configuration_version": "1", "project_info": {"storage_bucket": "", "project_id": "", "project_number": ""}}' > "$PRIVATE_GOOGLE_SERVICES" +} + +setup_private() { + echo "Setting up private configuration: repo '$PRIVATE_REPO', branch '$PRIVATE_BRANCH'" + rm -rf "$TMP_REPO_DIR" + git clone --depth 1 --no-single-branch "$PRIVATE_REPO" "$TMP_REPO_DIR" + echo "$PRIVATE_REPO" > "$SAVED_PRIVATE_REPO_FILE" + echo "$PRIVATE_BRANCH" > "$SAVED_PRIVATE_BRANCH_FILE" + echo "Saved private repository url '$PRIVATE_REPO' to '$SAVED_PRIVATE_REPO_FILE'" + echo "Saved private branch '$PRIVATE_BRANCH' to '$SAVED_PRIVATE_BRANCH_FILE'" + (cd $TMP_REPO_DIR && git checkout $PRIVATE_BRANCH) + rm -rf "$TMP_REPO_DIR/.git" "$TMP_REPO_DIR/README.md" + cp -Rv "$TMP_REPO_DIR"/* "$BASE_PATH" + rm -rf "$TMP_REPO_DIR" + echo "Private files have been updated." +} + +if [ "${1-}" = "-h" -o "${1-}" = "--help" ]; then + usage exit 1 fi -echo "Initializing repository with default values for $TYPE." -cp -pR ./private/$TYPE/* . -# TODO: Remove these lines when XCode project is finally generated by CMake. +ARGS_PRIVATE_REPO=${1-} +ARGS_PRIVATE_BRANCH=${2-} + +if [ -n "$ARGS_PRIVATE_REPO" ]; then + PRIVATE_REPO=$ARGS_PRIVATE_REPO + if [ -n "$ARGS_PRIVATE_BRANCH" ]; then + PRIVATE_BRANCH=$ARGS_PRIVATE_BRANCH + else + PRIVATE_BRANCH=master + fi +else + read -t 1 READ_PRIVATE_REPO READ_PRIVATE_BRANCH || true + if [ -n "${READ_PRIVATE_REPO-}" ]; then + PRIVATE_REPO=$READ_PRIVATE_REPO + if [ -n "${READ_PRIVATE_BRANCH-}" ]; then + PRIVATE_BRANCH=$READ_PRIVATE_BRANCH + else + PRIVATE_BRANCH=master + fi + elif [ -f "$SAVED_PRIVATE_REPO_FILE" ]; then + PRIVATE_REPO=`cat "$SAVED_PRIVATE_REPO_FILE"` + echo "Using stored private repository URL: $PRIVATE_REPO" + if [ -f "$SAVED_PRIVATE_BRANCH_FILE" ]; then + PRIVATE_BRANCH=`cat "$SAVED_PRIVATE_BRANCH_FILE"` + echo "Using stored private branch: $PRIVATE_BRANCH" + else + PRIVATE_BRANCH=master + fi + else + PRIVATE_REPO="" + fi +fi + +if [ -n "$PRIVATE_REPO" ]; then + setup_private +else + setup_opensource +fi + +# TODO: Remove these lines when XCode project is finally generated by CMake. if [ ! -d "$BASE_PATH/3party/boost/" ]; then echo "You need to have boost submodule present to run bootstrap.sh" echo "Try 'git submodule update --init --recursive'" exit 1 fi if [ ! -d "$BASE_PATH/3party/boost/tools" ]; then - echo "Boost's submodule tools is not present, but required for bootstrap" + echo "Boost's submodule 'tools' is missing, it is required for bootstrap" echo "Try 'git submodule update --init --recursive'" exit 1 fi diff --git a/private/debug/android/debug.keystore b/private/debug/android/debug.keystore deleted file mode 100644 index 3f00732999c0c0b7c01f8e25fa2bd2d59d347bb8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2605 zcmY+EX*3iH8^?zk!^l!1F_Co`q_Jkre#^d&wUB+uo*||%mYA_q_9eF%l0=1T&pwI7 zAY?8XV_(PCkn4TV``&x*hvz)!{Qm#v`S?R%nBnwvKm-Od4~9r2+)g-PrDLQk#Xv?u z7|8G${)E6Vc>XJ5umxcltj@66*%*P({qKr}nU1~`1EL`?paTRP%=~|R_8bc0oWj<; zA(J~sWqrM(+gVN>-=S2A^guwD83+UF&lEC~NzV3D-cQNx+z#AE5hnbCZ1l=Gq>Y;{ zR`VLNWU*#&?615w7_@BKP@J**Rbt|7tW+X7(YJg!6fL_miWA%J*hhoL5QCgpIjPY8 z6my+(2Mh2X`b#ID86@&e|9q;Ds1+QpEf%@4)-R79s2*0B8S(g|n!j~8?Ya}`i~O+A zvC>5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^btN*b;yTFWv;>$&I2#IsQW6CN(cR{79g>)X-# zddaSb)0-mdBo!`Wjee%h>Y=-;P9w`!SRxHC-09l;P`{$#DBI)Q6cF9BZ(r7%dHMj%bFPrs2weGBz>4p+^ z?XP?*lSPZDcAt|K(J{GQHmxYWv40w@6*~j07V`-+I^^exRda^ALY5rl!)n>~;YU3KE9&z%Nq{ifFzb}DAWC-gRgb=;t6H+d#z zAgS15^<4$?{q3lN(#bVyG-^0Umk_#Ny+KLaIf8s#1s%ye8+Dr zA1BvA?Z^#RUE|Ywjq?fVi>0C_0~&0~`E$qLD$ak;9h3|OiKgRSxFD|sa|>P&FA5D| zy?(gN1JdmGyCv6q(Ew>DWlw%yy0&d<$c;~5(UTdOse+R_x=uS3=V)rJ`G31a0LL)=FeN52Zwk!> z&9t*}p(Eo=MyJ6^^<@E{I3#IT9(#Wvdjv11sVqEly^} z%6JIJ_C2DEdN;>#(*k0(WCL>vNm~0fgmE^X6Fe$C5m_}&q$PJf{-jm#?vE5bU zLmjxX%Z=x0z)Uc6gX`qwmCRTsB1^_Dwn({j$o-L?U>r3%i1N5Qx({jNpIj8yY+m%9 zAm;t_QqZG&@St*JS&YkA?u%zh*OHgckH~f{>%wxdPwxV<`7_M?9r+w|={?7!cGT-g zc62*#(v>f#T7ImidB^`o)w% zNCkFiUM_gqQH_M@MoQmqV7ycEc(7g*vUJNZllh?7MB1wb^|s5)9LzRtL9(VsiGKCg zQ+gKBOx0FB8mVlVeU{nLbYa30Wt%gkwlOEj3cE-&HeAW%_VD*Ej3;S2Kfvyi&_Bg; znBRSPnqMuxTKOcErW2lGsmK#YQy4Ik_85Wry#2#eRNG|7ItpF^HR_@h+?u(OY_!Li9ZAU-wCT;K2ht^!{sm@V B;L892 diff --git a/private/debug/android/secure.properties b/private/debug/android/secure.properties deleted file mode 100644 index ddc84cc159..0000000000 --- a/private/debug/android/secure.properties +++ /dev/null @@ -1,6 +0,0 @@ -ext { - spropStoreFile = "debug.keystore" - spropStorePassword = "12345678" - spropKeyAlias = "debug" - spropKeyPassword = "12345678" -} diff --git a/private/debug/private.h b/private_default.h similarity index 98% rename from private/debug/private.h rename to private_default.h index e84dc901ad..40032de939 100644 --- a/private/debug/private.h +++ b/private_default.h @@ -15,7 +15,7 @@ #define RESOURCES_METASERVER_URL "" #define METASERVER_URL "" #define DIFF_LIST_URL "" -#define DEFAULT_URLS_JSON "[ \"https://cdn.omaps.app/\" ]" +#define DEFAULT_URLS_JSON "" #define AD_PERMISION_SERVER_URL "" #define AD_PERMISION_CHECK_DURATION 2 * 60 * 60 #define HOCKEY_APP_KEY ""