This repository has been archived on 2025-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
PiratX-Archive/.circleci/config.yml
2019-06-08 11:00:03 +02:00

53 lines
2 KiB
YAML

version: 2
jobs:
test:
docker:
- image: registry.gitlab.com/fdroid/ci-images-client:latest
steps:
- checkout
- restore_cache:
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
- 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
- run: ./gradlew lintStandardDebug
- save_cache:
paths:
- .gradle/caches
- .gradle/wrapper
key: gradle-{{ checksum "build.gradle" }}-{{ checksum ".circleci/config.yml" }}
- store_artifacts:
path: build/outputs/apk/standard
destination: apk
build:
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
#* temporarly disabled fdroid nightly builds
# workaround for fdroid nightly circleci bug
#*- run: sed -i "s/os.getenv('CIRCLE_REPOSITORY_URL')/\"https:\/\/github.com\/genofire\/Pix-Art-Messenger\"/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
# generate version number
#*- 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
# build
- run: ./gradlew assembleStandard
# publish on nightly fdroid repo
#*- run: fdroid nightly
- save_cache:
paths:
- ~/.android
key: android
- store_artifacts:
path: build/outputs/apk/standard
destination: apk
workflows:
version: 2
build_test:
jobs:
- build