2022-04-11 11:07:29 +02:00
|
|
|
version: 2.1
|
|
|
|
parameters:
|
|
|
|
memory-config:
|
|
|
|
type: string
|
|
|
|
default: "-Xmx3200m -Xms256m -XX:MaxMetaspaceSize=1g"
|
|
|
|
memory-config-debug:
|
|
|
|
type: string
|
|
|
|
default: "-Xmx3200m -Xms256m -XX:MaxMetaspaceSize=1g -verbose:gc -Xlog:gc*"
|
2017-07-30 14:53:54 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
2022-06-20 21:45:22 +02:00
|
|
|
- image: cimg/android:2022.06.1
|
2017-07-30 14:53:54 +02:00
|
|
|
working_directory: ~/ultrasonic
|
2021-04-27 11:42:43 +02:00
|
|
|
environment:
|
2022-04-11 11:07:29 +02:00
|
|
|
JVM_OPTS: << pipeline.parameters.memory-config >>
|
|
|
|
JAVA_TOOL_OPTIONS: << pipeline.parameters.memory-config >>
|
|
|
|
GRADLE_OPTS: << pipeline.parameters.memory-config >>
|
2017-07-30 14:53:54 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2021-05-20 07:40:07 +02:00
|
|
|
keys:
|
2021-12-20 22:39:20 +01:00
|
|
|
- v2-ultrasonic-{{ .Branch }}-{{ checksum "gradle/libs.versions.toml" }}
|
|
|
|
- v2-ultrasonic-{{ .Branch }}
|
|
|
|
- v2-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
|
2022-04-11 11:07:29 +02:00
|
|
|
cat 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-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
|
2022-04-11 11:07:29 +02:00
|
|
|
key: v2-ultrasonic-{{ .Branch }}-{{ checksum "gradle/libs.versions.toml" }}
|
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
|
2018-01-24 13:13:13 +01:00
|
|
|
push_translations:
|
|
|
|
docker:
|
2022-03-19 17:35:46 +01:00
|
|
|
- image: cimg/python:3.6
|
2018-01-24 13:13:13 +01:00
|
|
|
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:
|
2022-06-20 21:45:22 +02:00
|
|
|
- image: cimg/android:2022.06.1
|
2018-01-25 18:46:23 +01:00
|
|
|
working_directory: ~/ultrasonic
|
2022-04-11 11:07:29 +02:00
|
|
|
environment:
|
|
|
|
JVM_OPTS: << pipeline.parameters.memory-config >>
|
|
|
|
JAVA_TOOL_OPTIONS: << pipeline.parameters.memory-config >>
|
|
|
|
GRADLE_OPTS: << pipeline.parameters.memory-config >>
|
2018-01-25 18:46:23 +01:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2021-05-20 07:40:07 +02:00
|
|
|
keys:
|
2021-12-20 22:39:20 +01:00
|
|
|
- v2-ultrasonic-{{ .Branch }}-{{ checksum "gradle/libs.versions.toml" }}
|
|
|
|
- v2-ultrasonic-{{ .Branch }}
|
|
|
|
- v2-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: |
|
2022-01-19 09:39:26 +01:00
|
|
|
export PATH="${JAVA_HOME}/bin:${PATH}"
|
2018-01-25 18:46:23 +01:00
|
|
|
mkdir -p /tmp/ultrasonic-release
|
2022-04-11 11:27:02 +02:00
|
|
|
${ANDROID_HOME}/build-tools/32.0.0/zipalign -v 4 ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk /tmp/ultrasonic-release/ultrasonic-${CIRCLE_TAG}.apk
|
|
|
|
${ANDROID_HOME}/build-tools/32.0.0/apksigner sign --verbose --ks ~/ultrasonic/ultrasonic-keystore --ks-pass pass:${ULTRASONIC_KEYSTORE_STOREPASS} --key-pass pass:${ULTRASONIC_KEYSTORE_KEYPASS} /tmp/ultrasonic-release/ultrasonic-${CIRCLE_TAG}.apk
|
|
|
|
${ANDROID_HOME}/build-tools/32.0.0/apksigner verify --verbose /tmp/ultrasonic-release/ultrasonic-${CIRCLE_TAG}.apk
|
2018-01-25 18:46:23 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /tmp/ultrasonic-release
|
|
|
|
paths:
|
2022-01-19 09:39:26 +01:00
|
|
|
- ultrasonic-*.apk*
|
2018-01-25 22:22:42 +01:00
|
|
|
publish_github_signed_apk:
|
2018-01-25 18:46:23 +01:00
|
|
|
docker:
|
2022-04-11 11:58:57 +02:00
|
|
|
- image: cimg/go:1.18
|
2018-01-25 18:46:23 +01:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /tmp/ultrasonic-release
|
|
|
|
- run:
|
|
|
|
name: install ghr
|
2022-04-11 11:58:57 +02:00
|
|
|
command: go install -v github.com/tcnksm/ghr@latest
|
2018-01-25 18:46:23 +01:00
|
|
|
- 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
|
2018-01-25 18:46:23 +01:00
|
|
|
- generate_signed_apk:
|
|
|
|
filters:
|
|
|
|
tags:
|
2022-06-17 09:46:37 +02:00
|
|
|
only: /^[0-9]+(\.[0-9]+)*(-beta\.[0-9]+)?/
|
2018-01-25 18:46:23 +01:00
|
|
|
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:
|
2022-06-17 09:46:37 +02:00
|
|
|
only: /^[0-9]+(\.[0-9]+)*(-beta\.[0-9]+)?/
|
2018-01-25 18:46:23 +01:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2017-08-09 22:02:32 +02:00
|
|
|
|