.gitlab-ci.yml 3.95 KB
Newer Older
1
.android_job_template: &android_job_definition
2 3 4 5
  type: build
  artifacts:
    paths:
      - $CI_PROJECT_DIR/demos/kitchen_sink/bin/$CI_BUILD_NAME-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}.apk
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  before_script:
    # Prepare to install Java, skip the accept licence dialog
    - apt-get install debconf
    - echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
    - echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
    - dpkg --add-architecture i386
    - apt-get update
    # P4A dependencies
    - apt-get install -y build-essential ccache git zlib1g-dev python2.7 python2.7-dev libncurses5:i386 libstdc++6:i386 zlib1g:i386 openjdk-7-jdk unzip ant ccache
    - apt-get update -qy
    - apt-get install -y python-dev python-pip
    # Debug things
    - python -v
    - which python
    - pip -V
    # P4A dependencies
    - pip install https://github.com/kivy/buildozer/archive/master.zip colorama appdirs sh jinja2 six cython --upgrade
    - cd $CI_PROJECT_DIR/gitlab-ci
    - python ./android_sdk_downloader.py


android_kitchen_armeabi:
  <<: *android_job_definition
29 30 31 32 33 34 35 36 37 38
  script:
    - echo "Building KitchenSink for armeabi"
    - cd $CI_PROJECT_DIR/gitlab-ci
    # Install API
    - python ./android_sdk_downloader.py --api 19
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    # Build vars
    - export APP_ANDROID_ARCH=armeabi
    - export APP_ANDROID_API=19
    # Build
39
    - buildozer android debug
40 41 42 43 44 45
    # If nothing in bin dir, then the build has failed
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    - if [ ! "$(ls -A ./bin)" ]; then exit 1; fi
    - cd bin
    # Rename apk in format {android_arch}-{git_branch}-{git_commit_hash}
    - mv *.apk $CI_BUILD_NAME-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}.apk
46 47

android_kitchen_arm-v7a:
48
  <<: *android_job_definition
49 50 51 52 53 54 55 56 57 58
  script:
    - echo "Building KitchenSink for armeabi-v7a"
    - cd $CI_PROJECT_DIR/gitlab-ci
    # Install API
    - python ./android_sdk_downloader.py --api 21
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    # Build vars
    - export APP_ANDROID_ARCH=armeabi-v7a
    - export APP_ANDROID_API=21
    # Build
59
    - buildozer android debug
60 61 62 63 64 65
    # If nothing in bin dir, then the build has failed
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    - if [ ! "$(ls -A ./bin)" ]; then exit 1; fi
    - cd bin
    # Rename apk in format {android_arch}-{git_branch}-{git_commit_hash}
    - mv *.apk $CI_BUILD_NAME-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}.apk
66 67 68


android_kitchen_arm64-v8a:
69
  <<: *android_job_definition
70 71 72 73 74 75 76 77 78
  script:
    - echo "Building KitchenSink for arm64-v8a"
    - cd $CI_PROJECT_DIR/gitlab-ci
    # Install API
    - python ./android_sdk_downloader.py --api 21
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    # Build vars
    - export APP_ANDROID_ARCH=arm64-v8a
    - export APP_ANDROID_API=21
79
    - buildozer android debug
80 81 82 83 84 85
    # If nothing in bin dir, then the build has failed
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    - if [ ! "$(ls -A ./bin)" ]; then exit 1; fi
    - cd bin
    # Rename apk in format {android_arch}-{git_branch}-{git_commit_hash}
    - mv *.apk $CI_BUILD_NAME-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}.apk
86 87

android_kitchen_x86:
88
  <<: *android_job_definition
89 90 91 92 93 94 95 96 97 98
  script:
    - echo "Building KitchenSink for x86"
    - cd $CI_PROJECT_DIR/gitlab-ci
    # Install API
    - python ./android_sdk_downloader.py --api 21
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    # Build vars
    - export APP_ANDROID_ARCH=x86
    - export APP_ANDROID_API=21
    # Build
99
    - buildozer android debug
100 101 102 103 104
    # If nothing in bin dir, then the build has failed
    - cd $CI_PROJECT_DIR/demos/kitchen_sink
    - if [ ! "$(ls -A ./bin)" ]; then exit 1; fi
    - cd bin
    # Rename apk in format {android_arch}-{git_branch}-{git_commit_hash}
ZingBallyhoo's avatar
ZingBallyhoo committed
105 106 107
    - mv *.apk $CI_BUILD_NAME-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}.apk

trigger_build_site:
108
  stage: build
ZingBallyhoo's avatar
ZingBallyhoo committed
109 110 111 112
  script:
    - curl -X POST -F token=$KIVYMD_DOC_BUILD_TOKEN -F ref=master https://gitlab.com/api/v3/projects/2719855/trigger/builds
  only:
    - master