2017-07-30 14:53:54 +02:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2018-01-20 11:28:34 +01:00
|
|
|
- image: circleci/android:api-27-alpha
|
2017-07-30 14:53:54 +02:00
|
|
|
working_directory: ~/ultrasonic
|
|
|
|
envoronment:
|
|
|
|
JVM_OPTS: -Xmx3200m
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: gradle-cache-{{ checksum "dependencies.gradle" }}
|
2018-02-25 22:35:48 +01:00
|
|
|
- run:
|
|
|
|
name: clean gradle.properties
|
|
|
|
command: echo "" > gradle.properties
|
2017-07-30 14:53:54 +02:00
|
|
|
- run:
|
|
|
|
name: checkstyle
|
|
|
|
command: ./gradlew -Pqc ktlintCheck
|
2018-03-18 18:13:19 +01:00
|
|
|
- run:
|
|
|
|
name: static analysis
|
|
|
|
command: ./gradlew -Pqc detektCheck
|
2017-07-30 14:53:54 +02:00
|
|
|
- run:
|
|
|
|
name: build
|
|
|
|
command: ./gradlew assembleDebug
|
|
|
|
- run:
|
|
|
|
name: unit-tests
|
2017-08-09 22:02:32 +02:00
|
|
|
command: |
|
2018-03-11 11:52:24 +01:00
|
|
|
./gradlew :subsonic-api:test :cache:test :ultrasonic:testDebugUnitTest
|
2017-08-09 22:02:32 +02:00
|
|
|
./gradlew jacocoFullReport
|
2017-08-11 19:46:37 +02:00
|
|
|
bash <(curl -s https://codecov.io/bash)
|
2017-07-31 22:46:37 +02:00
|
|
|
- run:
|
|
|
|
name: lint
|
|
|
|
command: ./gradlew lint
|
2017-07-30 22:26:41 +02:00
|
|
|
- run:
|
2018-03-18 18:13:19 +01:00
|
|
|
name: assemble release build
|
|
|
|
command: ./gradlew assembleRelease
|
2017-07-30 14:53:54 +02:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.gradle
|
2017-07-31 22:46:37 +02:00
|
|
|
key: gradle-cache-{{ checksum "dependencies.gradle" }}
|
|
|
|
- store_artifacts:
|
|
|
|
path: ultrasonic/build/reports
|
2017-11-16 22:04:38 +01:00
|
|
|
path: subsonic-api/build/reports
|
2017-08-09 22:02:32 +02:00
|
|
|
destination: reports
|
|
|
|
- store_artifacts:
|
|
|
|
path: build/reports/jacoco/jacocoFullReport/
|
2018-01-24 13:13:13 +01:00
|
|
|
push_translations:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:3.6
|
|
|
|
working_directory: ~/ultrasonic
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: install transifex client
|
|
|
|
command: |
|
|
|
|
python -m venv ~/venv
|
|
|
|
. ~/venv/bin/activate
|
|
|
|
pip install transifex-client
|
|
|
|
- run:
|
|
|
|
name: configure transifex client
|
|
|
|
command: echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = api\npassword = '"${TRANSIFEX_PASSWORD}"$'\n' > ~/.transifexrc
|
|
|
|
- run:
|
|
|
|
name: push changes in translation files
|
|
|
|
command: |
|
|
|
|
. ~/venv/bin/activate
|
|
|
|
tx push -st
|
2018-01-25 18:46:23 +01:00
|
|
|
generate_signed_apk:
|
|
|
|
docker:
|
|
|
|
- image: circleci/android:api-27-alpha
|
|
|
|
working_directory: ~/ultrasonic
|
|
|
|
envoronment:
|
2018-01-25 22:22:42 +01:00
|
|
|
JAVA_TOOL_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
|
2018-01-25 18:46:23 +01:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: gradle-cache-{{ checksum "dependencies.gradle" }}
|
|
|
|
- run:
|
|
|
|
name: decrypt ultrasonic-keystore
|
|
|
|
command: openssl aes-256-cbc -K ${ULTRASONIC_KEYSTORE_KEY} -iv ${ULTRASONIC_KEYSTORE_IV} -in ultrasonic-keystore.enc -out ultrasonic-keystore -d
|
|
|
|
- run:
|
|
|
|
name: build release apk
|
|
|
|
command: ./gradlew build assembleRelease
|
|
|
|
- run:
|
|
|
|
name: sign release apk
|
|
|
|
command: |
|
|
|
|
mkdir -p /tmp/ultrasonic-release
|
2018-01-29 21:04:04 +01:00
|
|
|
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/ultrasonic/ultrasonic-keystore -storepass ${ULTRASONIC_KEYSTORE_STOREPASS} -keypass ${ULTRASONIC_KEYSTORE_KEYPASS} ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk ultrasonic
|
|
|
|
jarsigner -verify ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk
|
|
|
|
${ANDROID_HOME}/build-tools/27.0.0/zipalign -v 4 ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk /tmp/ultrasonic-release/ultrasonic-${CIRCLE_TAG}.apk
|
2018-01-25 18:46:23 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /tmp/ultrasonic-release
|
|
|
|
paths:
|
|
|
|
- ultrasonic-*.apk
|
2018-01-25 22:22:42 +01:00
|
|
|
publish_github_signed_apk:
|
2018-01-25 18:46:23 +01:00
|
|
|
docker:
|
|
|
|
- image: circleci/golang
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /tmp/ultrasonic-release
|
|
|
|
- run:
|
|
|
|
name: install ghr
|
|
|
|
command: go get -v github.com/tcnksm/ghr
|
|
|
|
- run:
|
2018-01-25 22:22:42 +01:00
|
|
|
name: publish release on github tag
|
2018-01-25 18:46:23 +01:00
|
|
|
command: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} /tmp/ultrasonic-release
|
2018-01-24 13:13:13 +01:00
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
build_and_push_translations:
|
|
|
|
jobs:
|
|
|
|
- build
|
|
|
|
- push_translations:
|
|
|
|
requires:
|
|
|
|
- build
|
2018-01-25 08:57:19 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
- master
|
2018-01-25 18:46:23 +01:00
|
|
|
- generate_signed_apk:
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^[0-9]+(\.[0-9]+)*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-01-25 22:22:42 +01:00
|
|
|
- publish_github_signed_apk:
|
2018-01-25 18:46:23 +01:00
|
|
|
requires:
|
|
|
|
- generate_signed_apk
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^[0-9]+(\.[0-9]+)*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2017-08-09 22:02:32 +02:00
|
|
|
|