diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8af528d9931dee02c336edab99cc50ea73d94ddc..32977fdd39554808234af5343c880e08d2532c20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,16 @@ image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:master" +variables: + PROJECT_ID: "83" # under Settings -> General + APK_PATH: "app/build/outputs/apk/ose/release" + UNSIGNED_APK: "davx5-ose-release-unsigned.apk" + DEV_APK: "Account-manager-dev.apk" + STABLE_APK: "Account-manager-stable.apk" + stages: - update-from-upstream - build + - release before_script: - echo email.key=$PEPPER >> local.properties @@ -27,10 +35,95 @@ build: stage: build script: - ./gradlew build -x test + - cd app/build/outputs/apk/ose/ + - | + 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/ose/ +init_submodules: + stage: release + rules: + - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' + when: on_success + script: + - | + git submodule add --force \ + https://gitlab.e.foundation/e/os/system-apps-update-info.git systemAppsUpdateInfo + artifacts: + paths: + - systemAppsUpdateInfo/ + +generate-apks: + stage: 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" "$DEV_APK" "$STABLE_APK" + artifacts: + paths: + - $APK_PATH/$UNSIGNED_APK + - $APK_PATH/$DEV_APK + - $APK_PATH/$STABLE_APK + +create-json-files: + stage: 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" "$DEV_APK" "$STABLE_APK" + artifacts: + paths: + - dev.json + - stable.json + +create-release: + stage: 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" "$DEV_APK" "$STABLE_APK" + .update-from-upstream: stage: update-from-upstream rules: diff --git a/build.gradle b/build.gradle index e7341354fa58cc95cfa19c0bd857a21fdc305db3..e969706ab4a9dd19c37b22e1bac029d0e9bb1092 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { commonsText: '1.10.0', // own libraries cert4android: '2bb3898', - dav4jvm: '1ed89c1', + dav4jvm: '1ed89c165d', ical4android: '1.1.2', vcard4android: '1.1.2' ]