diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee36959f9ccfc8b4543b45e959006f79241d4a20..39f5a1bde55d1e0bd995f13346a8732152290ff6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,23 +2,56 @@ image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest" variables: SENTRY_DSN: "${SENTRY_DSN}" + APK_PATH: "app/build/outputs/apk/release" + UNSIGNED_APK: "eDrive-release-unsigned.apk" + COMMUNITY_APK: "eDrive-community.apk" + OFFICIAL_APK: "eDrive-official.apk" stages: - build - test - + - gitlab_release before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew - cache: key: ${CI_PROJECT_ID} paths: - .gradle/ +lint: + stage: build + script: + - ./gradlew lintRelease + - ./gradlew detekt + artifacts: + paths: + - build/reports/detekt/ + +# |===========| +# | Build APK | +# |===========| +build: + stage: build + script: + - ./gradlew assemble + - cd app/build/outputs/apk/ + - | + if [[ ! -d "release" ]]; then + echo "$APK_PATH does not exist." + exit 1 + fi + cd "release" + - unsigned_build=$(ls *.apk | grep "unsigned") + - cp $unsigned_build $UNSIGNED_APK + artifacts: + paths: + - app/build/outputs/apk/ + expire_in: 4 weeks + test: allow_failure: true stage: test @@ -34,22 +67,80 @@ test: junit: app/build/test-results/*/TEST-*.xml -lint: - stage: build +# Below job makes eDrive updatable through app lounge + +init_submodules: + stage: gitlab_release + rules: + - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' + when: on_success script: - - ./gradlew lintRelease - - ./gradlew detekt + - git clone https://gitlab.e.foundation/e/os/system-apps-update-info.git systemAppsUpdateInfo artifacts: paths: - - build/reports/detekt/ + - systemAppsUpdateInfo/scripts/ -build: - stage: build +generate-apks: + stage: gitlab_release + rules: + - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' + when: on_success + needs: + - init_submodules + - build + dependencies: + - init_submodules + - build + before_script: + - apt update && apt install apksigner -y script: - - ./gradlew assemble + - | + ./systemAppsUpdateInfo/scripts/generate-apks.sh \ + "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK" artifacts: paths: - - app/build/outputs/apk/ - expire_in: 4 weeks + - $APK_PATH/$UNSIGNED_APK + - $APK_PATH/$COMMUNITY_APK + - $APK_PATH/$OFFICIAL_APK +create-json-files: + stage: gitlab_release + dependencies: + - init_submodules + - generate-apks + needs: + - init_submodules + - generate-apks + rules: + - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' + when: manual + before_script: + - apt update && apt install jq aapt -y + script: + - | + ./systemAppsUpdateInfo/scripts/create-json-files.sh \ + "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK" + artifacts: + paths: + - community.json + - official.json + + +create-release: + stage: gitlab_release + dependencies: + - init_submodules + needs: + - init_submodules + - create-json-files + - generate-apks + rules: + - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' + when: on_success + before_script: + - apt update && apt install jq -y + script: + - | + ./systemAppsUpdateInfo/scripts/create-release.sh \ + "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK" \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index db6f91dd3419a6b0bbbc02509a366c28aa3018b3..431a29a959692c4409a80d03cb33791c80dbafef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -97,7 +97,13 @@ android { } dependencies { - implementation 'foundation.e:Nextcloud-Android-Library:1.0.9-u2.17-release' + implementation("foundation.e:Nextcloud-Android-Library:1.0.9-u2.17-release") { + exclude group: 'com.gitlab.bitfireAT', module: 'dav4jvm' // Got from AccountManager + exclude group: 'com.github.bitfireAT', module: 'dav4jvm' + exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version + exclude group: 'com.squareup.okhttp3' + } + implementation "commons-httpclient:commons-httpclient:3.1@jar" implementation fileTree(include: ['*.jar'], dir: 'libs') api 'androidx.annotation:annotation:1.7.0' @@ -114,6 +120,7 @@ dependencies { implementation 'foundation.e:elib:0.0.1-alpha11' implementation 'foundation.e.lib:telemetry:0.0.11-alpha' + androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test:rules:1.5.0' androidTestImplementation 'androidx.annotation:annotation:1.7.0' diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f9ff2bd787e5bad8019b638f40964fc9da744831..efcd3e2742b161ee5f454b2e8bd43bec0c054530 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -36,7 +36,6 @@ Sincronizar el canal de trabajador %d archivo a sincronizar - %d archivos a sincronizar %d archivos a sincronizar Notificación sobre el contenido que está en sincronización