From 624856bcd0ef50b0eee9bf0dbebdf202435ea7d5 Mon Sep 17 00:00:00 2001 From: KunagisaYuki <44619693+KunagisaYuki@users.noreply.github.com> Date: Fri, 21 Dec 2018 18:55:50 +0800 Subject: [PATCH] configure circleci make circleci run --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..1677176e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,43 @@ +version: 2 +jobs: + build: + working_directory: ~/code + docker: + - image: circleci/android:api-27-alpha + environment: + JVM_OPTS: -Xmx4G + steps: + - checkout + - restore_cache: + key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} + - run: + name: Download Dependencies + command: ./gradlew androidDependencies + - save_cache: + paths: + - ~/.gradle + key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} + - run: + name: Run Tests + command: ./gradlew lint test + - store_test_results: + path: app/build/test-results + destination: test-results/ + - run: + name: Initial build + command: ./gradlew clean assembleRelease --no-daemon --stacktrace + - store_artifacts: + path: app/build/outputs/apk/ + destination: apks/ + - deploy: + name: "Deploy Igniter🐎" + command: | + echo "Branch: ${CIRCLE_BRANCH} , PR: ${CIRCLE_PULL_REQUEST}" + if [ "${CIRCLE_BRANCH}" == "develop" -o "${CIRCLE_PULL_REQUEST}" != "" ]; then + ./gradlew crashlyticsUploadDistributionDevelopmentRelease --stacktrace --debug --no-daemon + fi + + release=$(cut -c-7 <<< "${CIRCLE_BRANCH}") + if [ "$release" == "release"]; then + ./gradlew crashlyticsUploadDistributionProductionRelease --stacktrace --debug --no-daemon + fi \ No newline at end of file