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

Commit b68c9417 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

feat(updates): Update Notes through App Lounge

parent c50f6781
Loading
Loading
Loading
Loading
+82 −1
Original line number Diff line number Diff line
image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest"

variables:
  APK_PATH: "app/build/outputs/apk/release"
  UNSIGNED_APK: "app-release-unsigned.apk"
  COMMUNITY_APK: "Notes_community.apk"
  OFFICIAL_APK: "Notes_official.apk"

stages:
  - update-from-upstream
  - build
  - gitlab_release

before_script:
  - export GRADLE_USER_HOME=$(pwd)/.gradle
@@ -78,3 +85,77 @@ update-default-branch:
    UPSTREAM_DEFAULT_BRANCH: main
    UPSTREAM_URL: https://github.com/nextcloud/notes-android.git
    TEMP_LATEST_TAG_BRANCH: latest_upstream_tag_branch

init_submodules:
  stage: gitlab_release
  rules:
    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
      when: on_success
  script:
    - git clone https://gitlab.e.foundation/e/os/system-apps-update-info.git systemAppsUpdateInfo
  artifacts:
    paths:
      - systemAppsUpdateInfo/scripts/

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:
    - |
      ./systemAppsUpdateInfo/scripts/generate-apks.sh \
      "$APK_PATH" "$UNSIGNED_APK" "$COMMUNITY_APK" "$OFFICIAL_APK"
  artifacts:
    paths:
      - $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"
+5 −0
Original line number Diff line number Diff line
apply plugin: 'com.android.application'

def buildDate = { ->
    return new Date().format('yyyyMMddHHmmss')
}

android {
    compileSdkVersion 33
    buildToolsVersion '31.0.0'
@@ -36,6 +40,7 @@ android {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            versionNameSuffix "-${buildDate()}"
        }
    }