diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e7caf75..63459ec 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,8 +35,12 @@ jobs: run: chmod +x ./gradlew - name: Create local.properties + env: + MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }} run: | - echo "MAPS_API_KEY=${{ secrets.MAPS_API_KEY }}" > local.properties + if [ -n "$MAPS_API_KEY" ]; then + echo "MAPS_API_KEY=$MAPS_API_KEY" > local.properties + fi - name: Run Build, Lint, and Test run: >- diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a93c6fb..58cf5f8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -13,6 +13,10 @@ plugins { alias(libs.plugins.kotlin.serialization) } +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} + kotlin { compilerOptions { jvmTarget = JvmTarget.JVM_17 diff --git a/local.defaults.properties b/local.defaults.properties new file mode 100644 index 0000000..995b0da --- /dev/null +++ b/local.defaults.properties @@ -0,0 +1 @@ +MAPS_API_KEY=DEFAULT_API_KEY