-
-
Notifications
You must be signed in to change notification settings - Fork 41
188 lines (182 loc) · 5.88 KB
/
cid.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI/CD
on: [push, pull_request]
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process
CI: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch tags and history
run: |
git fetch --depth=1 --progress origin +refs/tags/*:refs/tags/*
git fetch --prune --unshallow --progress
- name: Install JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Gradle Cache
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-v2-gradle-build-${{ hashFiles('**/*') }}
restore-keys: |
${{ runner.os }}-v2-gradle-build-
${{ runner.os }}-v2-gradle-
- name: Validate Gradle integrity
uses: gradle/wrapper-validation-action@v1
- name: Setup debug environment
run: ./gradlew setup -S
if: github.ref != 'refs/heads/master'
- name: Setup release environment
run: ./gradlew setup -S
if: github.ref == 'refs/heads/master'
env:
ROBOT_SCOUTER_RELEASE: true
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
- name: Build debug project
run: ./gradlew :app:server:functions:assemble assembleDebug bundleDebug -S
if: github.ref != 'refs/heads/master'
- name: Build release project
run: |
./gradlew -S :app:server:functions:assemble \
assembleRelease bundleRelease \
crashlyticsUploadDeobs
if: github.ref == 'refs/heads/master'
env:
ROBOT_SCOUTER_RELEASE: true
- name: Upload outputs
uses: actions/upload-artifact@v1
with:
name: outputs
path: app/android-base/build/outputs
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-v2-gradle-test-${{ hashFiles('**/*') }}
restore-keys: |
${{ runner.os }}-v2-gradle-test-
${{ runner.os }}-v2-gradle-
- name: Setup environment
run: ./gradlew setup -S
- name: Run tests
run: ./gradlew check test ktlint lint -S
deploy_snapshot:
needs: [build, test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
env:
ROBOT_SCOUTER_RELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow --progress
- name: Install JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-v2-gradle-deploy-snapshot-${{ hashFiles('**/*') }}
restore-keys: |
${{ runner.os }}-v2-gradle-deploy-snapshot-
${{ runner.os }}-v2-gradle-deploy-
${{ runner.os }}-v2-gradle-
- name: Download outputs
uses: actions/download-artifact@v1
with:
name: outputs
path: app/android-base/build/outputs
- name: Setup environment
run: ./gradlew setup generateChangelog -S
env:
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
- name: Publish snapshot
run: |
./gradlew -S \
publishBundle --artifact-dir=app/android-base/build/outputs/bundle/release \
promoteArtifact
deploy_server:
needs: [build, test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
env:
ROBOT_SCOUTER_RELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install NodeJS
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-v2-gradle-deploy-server-${{ hashFiles('**/*') }}
restore-keys: |
${{ runner.os }}-v2-gradle-deploy-server-
${{ runner.os }}-v2-gradle-deploy-
${{ runner.os }}-v2-gradle-
- name: Setup environment
run: ./gradlew setup -S
env:
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
- name: Deploy server
run: ./gradlew deployServer -S
env:
GOOGLE_APPLICATION_CREDENTIALS: app/android-base/google-play-auto-publisher.json
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
deploy_release:
needs: [deploy_snapshot, deploy_server]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
env:
ROBOT_SCOUTER_RELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --depth=1 --progress origin +refs/tags/*:refs/tags/*
- name: Install JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-v2-gradle-deploy-release-${{ hashFiles('**/*') }}
restore-keys: |
${{ runner.os }}-v2-gradle-deploy-release-
${{ runner.os }}-v2-gradle-deploy-
${{ runner.os }}-v2-gradle-
- name: Setup environment
run: ./gradlew setup -S
env:
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
- name: Publish beta release
run: |
if [ ! -z $(git tag -l --points-at HEAD) ]
then
./gradlew promoteArtifact --from-track alpha --promote-track beta
fi