-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
41 lines (35 loc) · 1.11 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
image: registry.gitlab.com/tiro-is/heyra/android-ci@sha256:786ad41f1d8897676930b08fb275ac362d0d0f21c774c401ac1c896aad947bf9
variables:
GIT_SUBMODULE_STRATEGY: recursive
GRADLE_USER_HOME: ".gradle/_downloaded"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
cache:
paths:
- .gradle/
stages:
- checks
- build
- test
- deploy
kotlin style linter:
stage: checks
script:
- ./gradlew lintKotlin
build:
stage: build
script:
- ./gradlew assembleDebug
artifacts:
paths:
- app/build/outputs/
publish to play store:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+(\.[0-9]+)?(-(prealpha|alpha|beta|dev)([0-9]+)?)?$/
before_script:
- echo "$ANDROID_KEYSTORE" | base64 -d > app/keystore.jks
- echo "$ANDROID_KEYSTORE_PROPERTIES" | base64 -d > app/keystore.properties
script:
- export TRACK=$(echo "$CI_COMMIT_TAG" | perl -lne 'if (/^[0-9]+\.[0-9]+$/) { print "production" } elsif (/^[0-9]+\.[0-9]+-(beta|alpha|prealpha|internal)[0-9]*$/) { print $1 } else { print "internal" }')
- ./gradlew publishApps --track=$TRACK