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

Commit 313c9df9 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Remove pushToPrebuilt target for now

parent 2f9a1393
Loading
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -128,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