2018-11-08 22:53:06 +01:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-11-09 09:57:09 +01:00
|
|
|
test:
|
|
|
|
docker:
|
|
|
|
- image: registry.gitlab.com/fdroid/ci-images-client:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-11-09 10:00:56 +01:00
|
|
|
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
|
2018-11-09 09:57:09 +01:00
|
|
|
- run: export GRADLE_USER_HOME=$PWD/.gradle
|
|
|
|
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
|
2019-11-15 17:31:17 +01:00
|
|
|
- run: ./gradlew lintGitDebug
|
2018-11-09 09:57:09 +01:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- .gradle/caches
|
|
|
|
- .gradle/wrapper
|
2018-11-09 10:00:56 +01:00
|
|
|
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
|
2018-11-09 09:57:09 +01:00
|
|
|
- store_artifacts:
|
|
|
|
path: build/outputs/apk/standard
|
|
|
|
destination: apk
|
2018-11-08 22:53:06 +01:00
|
|
|
build:
|
2019-06-08 22:30:39 +02:00
|
|
|
docker:
|
|
|
|
- image: registry.gitlab.com/fdroid/ci-images-client:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key: android
|
|
|
|
- run: export GRADLE_USER_HOME=$PWD/.gradle
|
|
|
|
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
|
|
|
|
# build
|
2019-11-15 17:31:17 +01:00
|
|
|
- run: ./gradlew assembleGit
|
2019-06-08 22:30:39 +02:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- ~/.android
|
|
|
|
key: android
|
|
|
|
- store_artifacts:
|
2019-11-20 14:50:13 +01:00
|
|
|
path: build/outputs/apk/git
|
2019-06-08 22:30:39 +02:00
|
|
|
|
|
|
|
publish:
|
2018-11-08 22:53:06 +01:00
|
|
|
docker:
|
|
|
|
- image: registry.gitlab.com/fdroid/ci-images-client:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
2018-11-09 10:00:56 +01:00
|
|
|
key: android
|
2018-11-08 22:53:06 +01:00
|
|
|
- run: export GRADLE_USER_HOME=$PWD/.gradle
|
|
|
|
- run: echo y | sdkmanager "platforms;android-$(sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' build.gradle)" > /dev/null
|
2019-04-19 14:48:37 +02:00
|
|
|
# workaround for fdroid nightly circleci bug
|
2019-06-08 22:12:40 +02:00
|
|
|
- run: sed -i "s/os.getenv('CIRCLE_REPOSITORY_URL')/\"https:\/\/github.com\/kriztan\/Pix-Art-Messenger\"/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
|
2019-04-19 14:48:37 +02:00
|
|
|
# generate version number
|
2019-06-08 22:11:15 +02:00
|
|
|
- run: sed -i "s/^\(\s*versionCode\s*\).*$/\1$(git rev-list --first-parent --count HEAD)/" build.gradle
|
|
|
|
- run: sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$(printf '%s-%05d' $(git describe --tag --abbrev=0) $(git rev-list --first-parent --count HEAD))\"/" build.gradle
|
|
|
|
- run: cat -n build.gradle
|
2019-04-19 14:48:37 +02:00
|
|
|
# build
|
2019-11-15 17:31:17 +01:00
|
|
|
- run: ./gradlew assembleGit
|
2019-04-19 14:48:37 +02:00
|
|
|
# publish on nightly fdroid repo
|
2019-06-08 22:11:15 +02:00
|
|
|
- run: fdroid nightly
|
2018-11-09 09:57:09 +01:00
|
|
|
- save_cache:
|
|
|
|
paths:
|
2018-11-09 10:00:56 +01:00
|
|
|
- ~/.android
|
|
|
|
key: android
|
2018-11-08 22:53:06 +01:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-06-08 22:49:37 +02:00
|
|
|
test_build:
|
2018-11-08 22:53:06 +01:00
|
|
|
jobs:
|
2019-06-08 23:03:21 +02:00
|
|
|
- build:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: master
|
|
|
|
- publish:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|