diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee36959f9ccfc8b4543b45e959006f79241d4a20..81d5b71c55ae27882c0818025727ce44dbb5bb6c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,40 +2,29 @@ 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" # TODO: check if usage of * is working then update or remove this comment + DEV_APK: "eDrive-community.apk" + STABLE_APK: "eDrive-official.apk" stages: - build - test - + - release before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew - cache: key: ${CI_PROJECT_ID} paths: - .gradle/ -test: - allow_failure: true - stage: test - script: - - ls /usr/lib/jvm/ - - ./gradlew test -PtestAccountName="$testAccountName" -PtestAccountPwd="$testAccountPwd" -PtestServerUrl="$testServerUrl" - artifacts: - when: always - paths: - - app/build/test-results/*/TEST-*.xml - - app/build/reports/tests/* - reports: - junit: app/build/test-results/*/TEST-*.xml - - lint: stage: build + allow_failure: true # TODO remove before to merge script: - ./gradlew lintRelease - ./gradlew detekt @@ -43,13 +32,57 @@ lint: 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 +# |===============| +# | validation | +# | --------------| +# | Automatic test| +# |===============| +test: + allow_failure: true + stage: test + script: + - ls /usr/lib/jvm/ + - ./gradlew test -PtestAccountName="$testAccountName" -PtestAccountPwd="$testAccountPwd" -PtestServerUrl="$testServerUrl" + artifacts: + when: always + paths: + - app/build/test-results/*/TEST-*.xml + - app/build/reports/tests/* + reports: + junit: app/build/test-results/*/TEST-*.xml + +# |==========================================| +# | Make eDrive updatable through app lounge | +# | ---------------------------------------- | +# | eDrive as a dependency on AccountManager | +# |==========================================| + +include: + - component: $CI_SERVER_FQDN/vincent/paperboy-ci/sign-apks@1.0.5-beta + inputs: + stage: release + unsignedApk: "eDrive-*-release-unsigned.apk" + apk_dir_path: "app/build/outputs/apk/release" + official_apk: "eDrive-community.apk" + community_apk: "eDrive-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'