-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
60 lines (52 loc) · 1.17 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
image: gabrielepmattia/docker-android-alpine
stages:
- build
- test
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
# Init vm build configuration
- export GRADLE_USER_HOME=$(pwd)/.gradle
- mkdir -p $GRADLE_USER_HOME
- chmod +x ./gradlew
- echo "bintrayUser=" $BINTRAY_USER >> $GRADLE_USER_HOME/gradle.properties
- echo "bintrayApiKey=" $BINTRAY_KEY >> $GRADLE_USER_HOME/gradle.properties
cache:
paths:
- .gradle/wrapper
- .gradle/caches
# --------------- Build -------------- #
build:
stage: build
script:
- ./gradlew assemble
artifacts:
paths:
- build/outputs/
expire_in: 1 week
# --------------- Deploy -------------- #
deploy-beta:
stage: deploy
script:
- ./gradlew bintrayUpload '-PpublishTrack=beta'
only:
- /(.*)[^b]b$/
except:
- branches
deploy-production:
stage: deploy
script:
- ./gradlew bintrayUpload '-PpublishTrack=production'
only:
- tags
except:
- /(.*)[^b]b$/
- branches
## To deploy
# ./gradlew updateVersion
# git commit -am "Increased version"
# git tag -a 1.1.1b -m "asd" [if beta]
# git tag -a 1.1.1 -m "asd" [if not beta]
# git push
# git push --tags