chaosflix/.circleci/config.yml

111 lines
4.2 KiB
YAML
Raw Normal View History

2019-04-30 19:46:10 +02:00
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-28
environment:
2019-04-30 21:45:01 +02:00
JVM_OPTS: -XX\:MaxHeapSize\=2048m -Xmx1536m
LIBS: NoFree
2019-04-30 21:30:48 +02:00
BUILD_TYPE: Release
2019-05-04 13:00:57 +02:00
APPCENTER_OWNER: nicidienase
APPCENTER_GROUP: "Collaborators"
RELEASENOTES_FILE: "release_notes.txt"
2019-04-30 20:59:34 +02:00
branches:
only:
2019-05-01 19:48:07 +02:00
- master
- develop
2019-11-12 22:29:43 +01:00
- /feature\/.*/
2019-04-30 19:46:10 +02:00
steps:
- checkout
2019-04-30 22:12:50 +02:00
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }}
2019-04-30 20:36:21 +02:00
- run:
name: Setup env
command: |
.circleci/setup_env.sh >> $BASH_ENV
echo "VERSION_CODE_TOUCH=$(.circleci/getVersionCode.sh -t)" >> $BASH_ENV
echo "VERSION_CODE_LEANBACK=$(.circleci/getVersionCode.sh -l)" >> $BASH_ENV
# . $BASH_ENV
# echo "STAGE=${STAGE}"
# echo "VERSION_NAME=${VERSION_NAME}"
# echo "VersionCode: $(.circleci/getVersionCode.sh -t)"
# echo "BUILD_TYPE_LOWER=${BUILD_TYPE_LOWER}"
# echo "STAGE_LOWER=${STAGE_LOWER}"
# echo "LIBS_LOWER=${LIBS_LOWER}"
2019-04-30 19:46:10 +02:00
- run:
name: Download Dependencies
command: ./gradlew $SIGN_CONFIG androidDependencies
2019-05-04 13:13:42 +02:00
- run:
name: ktlint
command: |
./gradlew $SIGN_CONFIG --continue \
common:ktlint${STAGE}${LIBS}${BUILD_TYPE}Check \
touch:ktlint${STAGE}${LIBS}${BUILD_TYPE}Check \
leanback:ktlint${STAGE}${LIBS}${BUILD_TYPE}Check
2019-04-30 19:46:10 +02:00
- run:
2019-04-30 21:04:51 +02:00
name: Build Touch
command: |
./gradlew $SIGN_CONFIG \
-PversionCode=$VERSION_CODE_TOUCH \
-PversionName=${VERSION_NAME} \
touch:assemble${STAGE_LOWER}${LIBS}${BUILD_TYPE}
2019-04-30 21:04:51 +02:00
- run:
name: Build Leanback
command: |
./gradlew $SIGN_CONFIG \
-PversionCode=$VERSION_CODE_LEANBACK \
-PversionName=${VERSION_NAME} \
leanback:assemble${STAGE_LOWER}${LIBS}${BUILD_TYPE}
2019-05-01 12:23:25 +02:00
- run:
2019-05-01 12:44:18 +02:00
name: Test
command: |
./gradlew $SIGN_CONFIG --continue \
common:test${STAGE}${LIBS}${BUILD_TYPE}UnitTest \
common:lint${STAGE}${LIBS}${BUILD_TYPE} \
touch:test${STAGE}${LIBS}${BUILD_TYPE}UnitTest \
touch:lint${STAGE}${LIBS}${BUILD_TYPE} \
leanback:test${STAGE}${LIBS}${BUILD_TYPE}UnitTest \
leanback:lint${STAGE}${LIBS}${BUILD_TYPE}
- store_artifacts:
path: common/build/outputs
destination: common-reports
- store_artifacts:
path: touch/build/outputs
destination: touch
- store_artifacts:
path: touch/build/outputs
destination: touch-reports
- store_artifacts:
path: leanback/build/outputs
destination: leanback
- store_artifacts:
path: leanback/build/reports
destination: leanback-reports
2019-05-01 13:45:51 +02:00
- store_artifacts:
path: common/build/reports/ktlint/
destination: ktlint-reports
2019-05-01 12:23:25 +02:00
- store_test_results:
path: common/build/test-results
2019-05-01 12:23:25 +02:00
- store_test_results:
path: touch/build/test-results
2019-05-01 12:23:25 +02:00
- store_test_results:
path: leanback/build/test-results
2019-05-04 13:00:57 +02:00
- run:
name: Appcenter Upload
command: |
git log --format="%h %s" master..HEAD > $RELEASENOTES_FILE
2019-05-04 13:00:57 +02:00
.circleci/appCenterUpload.sh \
$APPCENTER_OWNER \
$APPCENTER_TOKEN \
2019-05-04 13:26:03 +02:00
"touch/build/outputs/apk/${STAGE_LOWER}${LIBS}/${BUILD_TYPE_LOWER}/touch-${STAGE_LOWER}-${LIBS_LOWER}-${BUILD_TYPE_LOWER}.apk" \
$RELEASENOTES_FILE \
$APPCENTER_GROUP \
"touch/build/outputs/mapping/${STAGE_LOWER}${LIBS}/${BUILD_TYPE_LOWER}/mapping.txt" \
"$VERSION_CODE_TOUCH" \
"$VERSION_NAME"
2019-05-01 12:23:25 +02:00
- save_cache:
paths:
- ~/.gradle
2019-05-01 18:09:10 +02:00
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }}