Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16223069 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

Merge branch '2286-eDrive-update-through-appLounge' into 'main'

feat: Make eDrive updatable through App Lounge

See merge request !296
parents a7c94cce 45ca253b
Loading
Loading
Loading
Loading
Loading
+103 −12
Original line number Diff line number Diff line
@@ -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
+8 −1
Original line number Diff line number Diff line
@@ -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'
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
    <string name="notif_sync_channel_name">Sincronizar el canal de trabajador</string>
    <plurals name="notif_sync_is_running_txt">
        <item quantity="one">%d archivo a sincronizar</item>
        <item quantity="many">%d archivos a sincronizar</item>
        <item quantity="other">%d archivos a sincronizar</item>
    </plurals>
    <string name="notif_sync_channel_description">Notificación sobre el contenido que está en sincronización</string>