Skip to content

Commit 6af04b4

Browse files
committed
Migrate to GitHub actions (closes #262)
Signed-off-by: Alex Saveau <[email protected]>
1 parent bf45873 commit 6af04b4

File tree

18 files changed

+277
-264
lines changed

18 files changed

+277
-264
lines changed

Diff for: .circleci/config.yml

-43
This file was deleted.

Diff for: .github/workflows/cid.yml

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
name: CI/CD
2+
3+
on: [push, pull_request]
4+
env:
5+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process
6+
CI: true
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Fetch tags and history
15+
run: |
16+
git fetch --depth=1 --progress origin +refs/tags/*:refs/tags/*
17+
git fetch --prune --unshallow --progress
18+
- name: Install JDK
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 11
22+
- name: Gradle Cache
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.gradle
26+
key: ${{ runner.os }}-v2-gradle-${{ hashFiles('**/*') }}
27+
restore-keys: |
28+
${{ runner.os }}-v2-gradle-
29+
- name: Validate Gradle integrity
30+
uses: gradle/wrapper-validation-action@v1
31+
- name: Setup debug environment
32+
run: ./gradlew setup -S
33+
if: github.ref != 'refs/heads/master'
34+
- name: Setup release environment
35+
run: ./gradlew setup -S
36+
if: github.ref == 'refs/heads/master'
37+
env:
38+
ROBOT_SCOUTER_RELEASE: true
39+
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
40+
- name: Build debug project
41+
run: ./gradlew :app:server:functions:assemble assembleDebug bundleDebug -S
42+
if: github.ref != 'refs/heads/master'
43+
- name: Build release project
44+
run: |
45+
./gradlew -S :app:server:functions:assemble \
46+
assembleRelease bundleRelease \
47+
crashlyticsUploadDeobs
48+
if: github.ref == 'refs/heads/master'
49+
env:
50+
ROBOT_SCOUTER_RELEASE: true
51+
- name: Upload outputs
52+
uses: actions/upload-artifact@v1
53+
with:
54+
name: outputs
55+
path: app/android-base/build/outputs
56+
57+
test:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v2
62+
- name: Install JDK
63+
uses: actions/setup-java@v1
64+
with:
65+
java-version: 11
66+
- name: Cache Gradle
67+
uses: actions/cache@v1
68+
with:
69+
path: ~/.gradle
70+
key: ${{ runner.os }}-v2-gradle-${{ hashFiles('**/*') }}
71+
restore-keys: |
72+
${{ runner.os }}-v2-gradle-
73+
- name: Setup environment
74+
run: ./gradlew setup -S
75+
- name: Run tests
76+
run: ./gradlew check test ktlint lint -S
77+
78+
deploy_snapshot:
79+
needs: [build, test]
80+
runs-on: ubuntu-latest
81+
if: github.ref == 'refs/heads/master'
82+
env:
83+
ROBOT_SCOUTER_RELEASE: true
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v2
87+
- name: Fetch history
88+
run: git fetch --prune --unshallow --progress
89+
- name: Install JDK
90+
uses: actions/setup-java@v1
91+
with:
92+
java-version: 11
93+
- name: Gradle Cache
94+
uses: actions/cache@v1
95+
with:
96+
path: ~/.gradle
97+
key: ${{ runner.os }}-v2-gradle-${{ hashFiles('**/*') }}
98+
restore-keys: |
99+
${{ runner.os }}-v2-gradle-
100+
- name: Download outputs
101+
uses: actions/download-artifact@v1
102+
with:
103+
name: outputs
104+
path: app/android-base/build/outputs
105+
- name: Setup environment
106+
run: ./gradlew setup generateChangelog -S
107+
env:
108+
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
109+
- name: Publish snapshot
110+
run: |
111+
./gradlew -S \
112+
publishBundle --artifact-dir=app/android-base/build/outputs/bundle/release \
113+
promoteArtifact
114+
115+
deploy_server:
116+
needs: [build, test]
117+
runs-on: ubuntu-latest
118+
if: github.ref == 'refs/heads/master'
119+
env:
120+
ROBOT_SCOUTER_RELEASE: true
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v2
124+
- name: Install JDK
125+
uses: actions/setup-java@v1
126+
with:
127+
java-version: 11
128+
- name: Install NodeJS
129+
uses: actions/setup-node@v1
130+
with:
131+
node-version: '12.x'
132+
- name: Gradle Cache
133+
uses: actions/cache@v1
134+
with:
135+
path: ~/.gradle
136+
key: ${{ runner.os }}-v2-gradle-${{ hashFiles('**/*') }}
137+
restore-keys: |
138+
${{ runner.os }}-v2-gradle-
139+
- name: Setup environment
140+
run: ./gradlew setup -S
141+
env:
142+
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
143+
- name: Deploy server
144+
run: ./gradlew deployServer -S
145+
env:
146+
GOOGLE_APPLICATION_CREDENTIALS: app/android-base/google-play-auto-publisher.json
147+
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
148+
149+
deploy_release:
150+
needs: [deploy_snapshot, deploy_server]
151+
runs-on: ubuntu-latest
152+
if: github.ref == 'refs/heads/master'
153+
env:
154+
ROBOT_SCOUTER_RELEASE: true
155+
steps:
156+
- name: Checkout
157+
uses: actions/checkout@v2
158+
- name: Fetch tags
159+
run: git fetch --depth=1 --progress origin +refs/tags/*:refs/tags/*
160+
- name: Install JDK
161+
uses: actions/setup-java@v1
162+
with:
163+
java-version: 11
164+
- name: Gradle Cache
165+
uses: actions/cache@v1
166+
with:
167+
path: ~/.gradle
168+
key: ${{ runner.os }}-v2-gradle-${{ hashFiles('**/*') }}
169+
restore-keys: |
170+
${{ runner.os }}-v2-gradle-
171+
- name: Setup environment
172+
run: ./gradlew setup -S
173+
env:
174+
SECRETS_PASS: ${{ secrets.SECRETS_PASS }}
175+
- name: Publish beta release
176+
run: |
177+
if [ ! -z $(git tag -l --points-at HEAD) ]
178+
then
179+
./gradlew promoteArtifact --from-track alpha --promote-track beta
180+
fi

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</h4>
1414

1515
<p align="center">
16-
<a href="https://circleci.com/gh/SUPERCILEX/Robot-Scouter">
17-
<img src="https://circleci.com/gh/SUPERCILEX/Robot-Scouter.svg?style=svg" />
16+
<a href="https://github.com/SUPERCILEX/Robot-Scouter/actions">
17+
<img src="https://github.com/SUPERCILEX/Robot-Scouter/workflows/CI/CD/badge.svg" />
1818
</a>
1919
</p>
2020

Diff for: app/android-base/build.gradle.kts

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ android {
1616

1717
defaultConfig {
1818
applicationId = "com.supercilex.robotscouter"
19-
versionName = "3.1.0-dev"
19+
versionName = "dev"
2020
multiDexEnabled = true
2121
}
2222

@@ -76,7 +76,6 @@ play {
7676
promoteTrack = "alpha"
7777

7878
resolutionStrategy = "auto"
79-
outputProcessor { versionNameOverride = "$versionNameOverride.$versionCode" }
8079
}
8180

8281
googleServices { disableVersionCheck = true }

Diff for: buildSrc/build.gradle.kts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
repositories {
2+
google()
23
jcenter()
34
}
45

@@ -11,7 +12,10 @@ tasks.withType<ValidatePlugins>().configureEach {
1112
}
1213

1314
dependencies {
14-
implementation("com.google.guava:guava:28.1-jre")
15+
implementation("com.android.tools.build:gradle:4.0.0-alpha09")
1516
implementation("org.ajoberstar.grgit:grgit-gradle:4.0.1")
1617
implementation("com.google.cloud:google-cloud-pubsub:1.102.0")
18+
19+
// TODO remove when GPP 2.7 ships
20+
implementation("com.google.guava:guava:28.1-jre")
1721
}

Diff for: buildSrc/src/main/kotlin/Config.kt

+20-19
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ fun RepositoryHandler.deps() {
1212
includeGroupByRegex("androidx\\..*")
1313

1414
includeGroup("com.android")
15+
includeGroup("android.arch.lifecycle")
16+
includeGroup("android.arch.core")
1517
includeGroup("com.crashlytics.sdk.android")
1618
includeGroup("io.fabric.sdk.android")
1719
}
@@ -67,35 +69,34 @@ object Config {
6769
}
6870

6971
object Jetpack {
70-
const val core = "androidx.core:core-ktx:1.2.0-rc01"
72+
const val core = "androidx.core:core-ktx:1.3.0-alpha01"
7173
const val multidex = "androidx.multidex:multidex:2.0.1"
72-
const val appCompat = "androidx.appcompat:appcompat:1.2.0-alpha01"
73-
const val fragment = "androidx.fragment:fragment-ktx:1.2.0-rc05"
74+
const val appCompat = "androidx.appcompat:appcompat:1.2.0-alpha02"
75+
const val fragment = "androidx.fragment:fragment-ktx:1.2.1"
7476
const val rv = "androidx.recyclerview:recyclerview:1.2.0-alpha01"
75-
const val rvSelection = "androidx.recyclerview:recyclerview-selection:1.1.0-beta01"
77+
const val rvSelection = "androidx.recyclerview:recyclerview-selection:1.1.0-rc01"
7678
const val constraint = "androidx.constraintlayout:constraintlayout:2.0.0-beta4"
7779
const val cardView = "androidx.cardview:cardview:1.0.0"
7880
const val palette = "androidx.palette:palette-ktx:1.0.0"
79-
const val emoji = "androidx.emoji:emoji-appcompat:1.0.0"
81+
const val emoji = "androidx.emoji:emoji-appcompat:1.1.0-alpha01"
8082
const val browser = "androidx.browser:browser:1.3.0-alpha01"
8183
const val pref = "androidx.preference:preference-ktx:1.1.0"
8284

8385
const val material = "com.google.android.material:material:1.2.0-alpha04"
8486

8587
val lifecycle by lazy {
86-
val version = "2.2.0-rc03"
88+
val version = "2.2.0"
8789
listOf(
8890
"androidx.lifecycle:lifecycle-common-java8:$version",
8991
"androidx.lifecycle:lifecycle-extensions:$version",
9092
"androidx.lifecycle:lifecycle-livedata-ktx:$version",
91-
"androidx.lifecycle:lifecycle-viewmodel-ktx:$version"
93+
"androidx.lifecycle:lifecycle-viewmodel-ktx:$version",
94+
"androidx.lifecycle:lifecycle-viewmodel-savedstate:$version"
9295
)
9396
}
94-
const val viewModelState =
95-
"androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-rc03"
9697

9798
val work by lazy {
98-
val version = "2.3.0-rc01"
99+
val version = "2.3.1"
99100
listOf(
100101
"androidx.work:work-runtime-ktx:$version",
101102
"androidx.work:work-gcm:$version"
@@ -104,15 +105,15 @@ object Config {
104105
}
105106

106107
object Firebase {
107-
const val core = "com.google.firebase:firebase-analytics:17.2.2"
108+
const val analytics = "com.google.firebase:firebase-analytics:17.2.2"
108109
const val auth = "com.google.firebase:firebase-auth:19.2.0"
109-
const val firestore = "com.google.firebase:firebase-firestore-ktx:21.3.1"
110-
const val functions = "com.google.firebase:firebase-functions-ktx:19.0.1"
111-
const val storage = "com.google.firebase:firebase-storage-ktx:19.1.0"
112-
const val config = "com.google.firebase:firebase-config-ktx:19.1.0"
113-
const val indexing = "com.google.firebase:firebase-appindexing:19.0.0"
110+
const val firestore = "com.google.firebase:firebase-firestore-ktx:21.4.0"
111+
const val functions = "com.google.firebase:firebase-functions-ktx:19.0.2"
112+
const val storage = "com.google.firebase:firebase-storage-ktx:19.1.1"
113+
const val config = "com.google.firebase:firebase-config-ktx:19.1.1"
114+
const val indexing = "com.google.firebase:firebase-appindexing:19.1.0"
114115
const val messaging = "com.google.firebase:firebase-messaging:20.1.0"
115-
const val links = "com.google.firebase:firebase-dynamic-links:19.0.0"
116+
const val links = "com.google.firebase:firebase-dynamic-links-ktx:19.1.0"
116117
const val perf = "com.google.firebase:firebase-perf:19.0.5"
117118

118119
const val crashlytics = "com.crashlytics.sdk.android:crashlytics:2.10.1"
@@ -121,7 +122,7 @@ object Config {
121122
object PlayServices {
122123
const val auth = "com.google.android.gms:play-services-auth:17.0.0"
123124
const val nearby = "com.google.android.gms:play-services-nearby:17.0.0"
124-
const val playCore = "com.google.android.play:core-ktx:1.6.4"
125+
const val playCore = "com.google.android.play:core-ktx:1.6.5"
125126
}
126127

127128
object FirebaseUi {
@@ -141,7 +142,7 @@ object Config {
141142

142143
private const val glideVersion = "4.11.0"
143144

144-
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.1"
145+
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:2.2"
145146
const val retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion"
146147
const val retrofitGson = "com.squareup.retrofit2:converter-gson:$retrofitVersion"
147148
const val gson = "com.google.code.gson:gson:2.8.6"

0 commit comments

Comments
 (0)