Skip to content

Commit 4755ff2

Browse files
committed
Move protomaps server URL into GitHub secrets along with new API key
Update GitHub workflows to extract the values into local.properties.
1 parent 7611b89 commit 4755ff2

13 files changed

Lines changed: 74 additions & 284 deletions

File tree

.github/workflows/build-app.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ jobs:
7070
id: get-version
7171
run: echo "VERSION=$(git describe --tags)" >> $GITHUB_OUTPUT
7272

73-
#- name: Setup tile provider API key
74-
# env:
75-
# TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
76-
# run: |
77-
# echo tileProviderApiKey=$TILE_PROVIDER_API_KEY > local.properties
73+
- name: Setup tile provider API key
74+
env:
75+
TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
76+
TILE_PROVIDER_URL: ${{ secrets.TILE_PROVIDER_URL }}
77+
run: |
78+
echo tileProviderUrl=$TILE_PROVIDER_URL > local.properties
79+
echo tileProviderApiKey=$TILE_PROVIDER_API_KEY >> local.properties
7880
7981
- name: Decode Google services
8082
env:

.github/workflows/nightly.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ jobs:
4848
with:
4949
fetch-depth: 0
5050

51-
#- name: Setup tile provider API key
52-
# env:
53-
# TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
54-
# run: |
55-
# echo tileProviderApiKey=$TILE_PROVIDER_API_KEY > local.properties
51+
- name: Setup tile provider
52+
env:
53+
TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
54+
TILE_PROVIDER_URL: ${{ secrets.TILE_PROVIDER_URL }}
55+
run: |
56+
echo tileProviderUrl=$TILE_PROVIDER_URL > local.properties
57+
echo tileProviderApiKey=$TILE_PROVIDER_API_KEY >> local.properties
5658
5759
- name: Decode Google services
5860
env:
@@ -127,11 +129,13 @@ jobs:
127129
with:
128130
fetch-depth: 0
129131

130-
#- name: Setup tile provider API key
131-
# env:
132-
# TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
133-
# run: |
134-
# echo tileProviderApiKey=$TILE_PROVIDER_API_KEY > local.properties
132+
- name: Setup tile provider
133+
env:
134+
TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
135+
TILE_PROVIDER_URL: ${{ secrets.TILE_PROVIDER_URL }}
136+
run: |
137+
echo tileProviderUrl=$TILE_PROVIDER_URL > local.properties
138+
echo tileProviderApiKey=$TILE_PROVIDER_API_KEY >> local.properties
135139
136140
- name: Decode Google services
137141
env:

.github/workflows/run-tests.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ jobs:
2525
with:
2626
fetch-depth: 0
2727

28+
- name: Setup tile provider
29+
env:
30+
TILE_PROVIDER_API_KEY: ${{ secrets.TILE_PROVIDER_API_KEY }}
31+
TILE_PROVIDER_URL: ${{ secrets.TILE_PROVIDER_URL }}
32+
run: |
33+
pwd
34+
ls -l
35+
echo tileProviderUrl=$TILE_PROVIDER_URL > local.properties
36+
echo tileProviderApiKey=$TILE_PROVIDER_API_KEY >> local.properties
37+
2838
- name: Setup Gradle
2939
uses: gradle/actions/setup-gradle@v4
3040

@@ -35,7 +45,10 @@ jobs:
3545
java-version: '19'
3646

3747
- name: Run lint over the repo
38-
run: ./gradlew lint
48+
run: |
49+
./gradlew lint
50+
cat local.properties
51+
3952
4053
- name: Run tests
4154
run: ./gradlew test

.github/workflows/tag-and-build-release.yaml

Lines changed: 0 additions & 244 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import com.google.protobuf.gradle.id
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import java.io.FileInputStream
4+
import java.util.Properties
25

36
plugins {
47
alias(libs.plugins.android.application)
@@ -45,20 +48,21 @@ android {
4548
versionCode = 86
4649
versionName = "0.0.85"
4750

48-
// We don't currently require a Tile provider API key
49-
//
50-
// // Retrieve the tile provider API from local.properties. This is not under version control
51-
// // and must be configured by each developer locally. GitHb actions fill in local.properties
52-
// // from a secret.
53-
// var tileProviderApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
54-
// try {
55-
// val localProperties = Properties()
56-
// localProperties.load(FileInputStream(rootProject.file("local.properties")))
57-
// tileProviderApiKey = localProperties["tileProviderApiKey"].toString()
58-
// } catch (e: Exception) {
59-
// println("Failed to load local.properties for TILE_PROVIDER_API_KEY: $e")
60-
// }
61-
// buildConfigField("String", "TILE_PROVIDER_API_KEY", "\"${tileProviderApiKey}\"")
51+
// Retrieve the tile provider URL and API key from local.properties. This is not under
52+
// version control and must be configured by each developer locally. GitHub actions fill in
53+
// local.properties from a secret.
54+
var tileProviderUrl = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
55+
var tileProviderApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
56+
try {
57+
val localProperties = Properties()
58+
localProperties.load(FileInputStream(rootProject.file("local.properties")))
59+
tileProviderUrl = localProperties["tileProviderUrl"].toString()
60+
tileProviderApiKey = localProperties["tileProviderApiKey"].toString()
61+
} catch (e: Exception) {
62+
println("Failed to load local.properties for tile provider: $e")
63+
}
64+
buildConfigField("String", "TILE_PROVIDER_URL", "\"${tileProviderUrl}\"")
65+
buildConfigField("String", "TILE_PROVIDER_API_KEY", "\"${tileProviderApiKey}\"")
6266

6367
buildConfigField("String", "VERSION_NAME", "\"${versionName}\"")
6468
buildConfigField("String", "FMOD_LIB", "\"fmod\"")
@@ -102,8 +106,11 @@ android {
102106
sourceCompatibility = JavaVersion.VERSION_19
103107
targetCompatibility = JavaVersion.VERSION_19
104108
}
105-
kotlinOptions {
106-
jvmTarget = "19"
109+
110+
kotlin {
111+
compilerOptions {
112+
compilerOptions.jvmTarget.set(JvmTarget.JVM_19)
113+
}
107114
}
108115
buildFeatures {
109116
compose = true

0 commit comments

Comments
 (0)