From b62563175748d645d188a5794bc0fc111e8c5a60 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 27 Sep 2024 20:02:07 +0530 Subject: [PATCH 1/3] feat(updates): Update Notes through App Lounge --- .gitlab-ci.yml | 83 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bfbbba567..3e24e657a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,15 @@ 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" + 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 @@ -77,4 +84,78 @@ update-default-branch: UPSTREAM_BRANCH: upstream/master UPSTREAM_DEFAULT_BRANCH: main UPSTREAM_URL: https://github.com/nextcloud/notes-android.git - TEMP_LATEST_TAG_BRANCH: latest_upstream_tag_branch \ No newline at end of file + 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" -- GitLab From 520397ea2dcda53957b55b8f8037c982b8a95770 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Fri, 27 Sep 2024 21:24:11 +0530 Subject: [PATCH 2/3] refactor(updates): typo fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3e24e657a..142a372f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ 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" + UNSIGNED_APK: "app-release-unsigned.apk" COMMUNITY_APK: "Notes_community.apk" OFFICIAL_APK: "Notes_official.apk" -- GitLab From ce440107c5ef9f203dbb932c0ed49c6223da1851 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Mon, 30 Sep 2024 17:04:14 +0530 Subject: [PATCH 3/3] add build date to release version name suffix --- app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index bc596c3b1..6e816b9e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,9 @@ 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()}" } } -- GitLab