-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
117 lines (106 loc) · 3.04 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
image: jangrewe/gitlab-ci-android
cache:
key: ${CI_PROJECT_ID}
paths:
- .gradle/
before_script:
- export GRADLE_USER_HOME=$(pwd)/.gradle
- chmod +x ./gradlew
stages:
- test
- assembleDebugApk
- deployDebugApk
- assembleReleaseApk
- deployRepleaseApk
- assembleReleaseBundle
- deployBundle
testDebug:
stage: test
only:
- ninja-master
script:
- ./gradlew -Pci --console=plain testConversationsFreeDebugUnitTest
testRelease:
stage: test
only:
- tags
script:
- ./gradlew -Pci --console=plain testConversationsFreeReleaseUnitTest
assembleDebug:
stage: assembleDebugApk
only:
- ninja-master
script:
- ./gradlew assembleConversationsFreeDebug
artifacts:
paths:
- build/outputs/apk/conversationsFree/debug
deployDebug:
stage: deployDebugApk
only:
- ninja-master
script:
- |
curl \
-F token="${APK_SLACK_CHANNEL_ACCESS_TOKEN}" \
-F channels="${APK_SLACK_CHANNEL_ID}" \
-F initial_comment="Hello Team! Here is the latest Ninja Chat debug APK" \
-F "file=@$(find build/outputs/apk/conversationsFree/debug -name '*arm64*')" \
https://slack.com/api/files.upload
cache: {}
assembleReleaseApk:
stage: assembleReleaseApk
only:
- tags
script:
- echo $KEYSTORE_FILE | base64 -d > my.keystore
- ./gradlew assembleConversationsFreeRelease
-Pandroid.injected.signing.store.file=$(pwd)/my.keystore
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD
-Pandroid.injected.signing.key.alias=$KEY_ALIAS
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
artifacts:
paths:
- build/outputs/apk/conversationsFree/release
- CHANGELOG
deployReleaseApk:
stage: deployRepleaseApk
only:
- tags
script:
- |
curl \
-F token="${APK_SLACK_CHANNEL_ACCESS_TOKEN}" \
-F channels="${APK_SLACK_CHANNEL_ID}" \
-F initial_comment="Hello Team! Here is the latest Ninja Chat release APK" \
-F "file=@$(find build/outputs/apk/conversationsFree/release -name '*arm64*')" \
https://slack.com/api/files.upload
cache: {}
assembleReleaseBundle:
stage: assembleReleaseBundle
only:
- tags
script:
- echo $KEYSTORE_FILE | base64 -d > my.keystore
- ./gradlew bundleConversationsFreeSystemRelease
-Pandroid.injected.signing.store.file=$(pwd)/my.keystore
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD
-Pandroid.injected.signing.key.alias=$KEY_ALIAS
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
artifacts:
paths:
- build/outputs/bundle/conversationsFreeRelease
- CHANGELOG
deployReleaseBundle:
stage: deployBundle
only:
- tags
script:
- |
curl \
-F token="${APK_SLACK_CHANNEL_ACCESS_TOKEN}" \
-F channels="${APK_SLACK_CHANNEL_ID}" \
-F initial_comment="Hello Team! Here is the latest Ninja Chat release Bundle" \
-F "file=@$(find build/outputs/bundle/conversationsFreeRelease -name 'ninja-chat*')" \
https://slack.com/api/files.upload
cache: {}