2021-04-22 20:51:12 +02:00
|
|
|
version: 3
|
2017-07-30 14:53:54 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2021-05-19 19:38:51 +02:00
|
|
|
- image: circleci/android:api-29
|
2017-07-30 14:53:54 +02:00
|
|
|
working_directory: ~/ultrasonic
|
2021-04-27 11:42:43 +02:00
|
|
|
environment:
|
2017-07-30 14:53:54 +02:00
|
|
|
JVM_OPTS: -Xmx3200m
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2021-05-20 07:40:07 +02:00
|
|
|
keys:
|
|
|
|
- v1-ultrasonic-{{ .Branch }}-{{ checksum "dependencies.gradle" }}
|
|
|
|
- v1-ultrasonic-{{ .Branch }}
|
|
|
|
- v1-ultrasonic
|
2018-02-25 22:35:48 +01:00
|
|
|
- run:
|
2021-05-20 08:12:29 +02:00
|
|
|
name: configure gradle.properties for CI building
|
|
|
|
command: |
|
|
|
|
sed -i '/^org.gradle.jvmargs/d' gradle.properties
|
|
|
|
sed -i 's/^org.gradle.daemon=true/org.gradle.daemon=false/g' 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
|
2021-05-19 12:39:20 +02:00
|
|
|
command: ./gradlew -Pqc detekt
|
2017-07-30 14:53:54 +02:00
|
|
|
- run:
|
2021-08-26 11:27:54 +02:00
|
|
|
name: build debug
|
2017-07-30 14:53:54 +02:00
|
|
|
command: ./gradlew assembleDebug
|
|
|
|
- run:
|
|
|
|
name: unit-tests
|
2017-08-09 22:02:32 +02:00
|
|
|
command: |
|
2018-10-06 13:52:14 +02:00
|
|
|
./gradlew ciTest testDebugUnitTest
|
2017-08-09 22:02:32 +02:00
|
|
|
./gradlew jacocoFullReport
|
2017-07-31 22:46:37 +02:00
|
|
|
- run:
|
|
|
|
name: lint
|
2018-10-07 21:36:47 +02:00
|
|
|
command: ./gradlew :ultrasonic:lintRelease
|
2017-07-30 22:26:41 +02:00
|
|
|
- run:
|
2021-08-26 11:27:54 +02:00
|
|
|
name: build
|
|
|
|
command: ./gradlew buildRelease
|
|
|
|
- run:
|
|
|
|
name: assemble release
|
|
|
|
command: ./gradlew assembleRelease
|
2017-07-30 14:53:54 +02:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.gradle
|
2021-05-20 07:40:07 +02:00
|
|
|
key: v1-ultrasonic-{{ .Branch }}-{{ checksum "dependencies.gradle" }}
|
2017-07-31 22:46:37 +02:00
|
|
|
- store_artifacts:
|
|
|
|
path: ultrasonic/build/reports
|
2020-03-23 10:11:12 +01:00
|
|
|
destination: reports
|
|
|
|
- store_artifacts:
|
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
|
2021-01-19 15:26:32 +01:00
|
|
|
tx push -s
|
2018-01-25 18:46:23 +01:00
|
|
|
generate_signed_apk:
|
|
|
|
docker:
|
2020-03-23 17:47:44 +01:00
|
|
|
- image: circleci/android:api-28
|
2018-01-25 18:46:23 +01:00
|
|
|
working_directory: ~/ultrasonic
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2021-05-20 07:40:07 +02:00
|
|
|
keys:
|
|
|
|
- v1-ultrasonic-{{ .Branch }}-{{ checksum "dependencies.gradle" }}
|
|
|
|
- v1-ultrasonic-{{ .Branch }}
|
|
|
|
- v1-ultrasonic
|
2018-01-25 18:46:23 +01:00
|
|
|
- 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
|
|
|
|