From 984ae4d0ed3ebeb96e1c787d4f9234cb44805f14 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 20 Jan 2023 14:27:07 +0100 Subject: [PATCH 1/3] Add lint.xml file for releases --- lint.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lint.xml diff --git a/lint.xml b/lint.xml new file mode 100644 index 000000000..1e93dd895 --- /dev/null +++ b/lint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + -- GitLab From e0a32258c8f1d2a5a3ba02c0a9b5b4eef47ef971 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 20 Jan 2023 15:11:05 +0100 Subject: [PATCH 2/3] Remove pushToPrebuilt target for now --- .gitlab-ci.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62a911281..8d3c91b11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -125,38 +125,3 @@ ktlintRelease: artifacts: paths: - app/build/reports/ktlint/ - - -pushToPrebuilt: - stage: publish - needs: ["buildRelease"] - when: manual - variables: - NEW_APK_PATH: "app/build/outputs/apk/release/" - before_script: - - 'which ssh-agent || ( apt update -y && apt install openssh-client -y )' - - eval $(ssh-agent -s) - - echo "$SSH_E_ROBOT_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts - - chmod 644 ~/.ssh/known_hosts - - git config user.email "gitlab@e.foundation" - - git config user.name "gitlab" - script: - - NEW_APK_NAME=$(basename ${NEW_APK_PATH}*-release.apk) - - NEW_APK_VERSION=$(awk -F '-' '{print $2}' <<< "$NEW_APK_NAME") - - echo $NEW_APK_NAME - - echo $NEW_APK_VERSION - - git lfs clone git@gitlab.e.foundation:e/os/android_prebuilts_prebuiltapks_lfs.git - - cd android_prebuilts_prebuiltapks_lfs - - rm Apps/*-release.apk - - mv ../${NEW_APK_PATH}/${NEW_APK_NAME} Apps/ - # todo: improve to replace sed command, by a new one based on REGEXP (instead of using line number) - - sed -i "6s/.*/LOCAL_SRC_FILES := ${NEW_APK_NAME}/" Apps/Android.mk - - git add Apps - - git status - - git commit -m "Update Apps Lounge apk to ${NEW_APK_VERSION}\nFrom ${CI_COMMIT_SHA}" - - git push - # Sometimes a single push doesn't do all the job, so we have to push twice - - git push \ No newline at end of file -- GitLab From 7e05ea0a44c2bfbc8f8fc76fe06c50114eea5a5f Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 20 Jan 2023 15:11:33 +0100 Subject: [PATCH 3/3] Trigger lint for Merge Request --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d3c91b11..b2a3d2bd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ test: - app/build/reports/tests/* reports: junit: app/build/test-results/*/TEST-*.xml - + # Default lint configuration for debug builds # Manual as we don't want to run them generally for debug builds .lintDebugDefault: @@ -112,6 +112,9 @@ buildReleaseStable: lintRelease: extends: .lintReleaseDefault + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: always script: - ./gradlew lintRelease artifacts: -- GitLab