diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62a91128103a7eb96e570dafcd6a93001db9a061..b2a3d2bd6a34981f3801870ac775e407ee6d49c8 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: @@ -125,38 +128,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 diff --git a/lint.xml b/lint.xml new file mode 100644 index 0000000000000000000000000000000000000000..1e93dd895f77bdac7f5ca649d0510401cb9fac2a --- /dev/null +++ b/lint.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +