Skip to content

Commit

Permalink
chore: updated secrets in build file to set secrets.properties as pro…
Browse files Browse the repository at this point in the history
…pertiesFilename (#619)

* chore: updated secrets in build file to set secrets.properties as propertiesFilename

* chore: updated README

* chore: updated README

* chore: updated README

* chore: updated README

* chore: updated secrets.properties

* chore: updated CI script

* chore: updated CI script

* chore: updated CI script

* chore: removed secrets.properties and add to .gitignore
  • Loading branch information
kikoso authored Aug 28, 2024
1 parent 351d0a9 commit 91b40fa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/instrumentation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
env:
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
run: |
[ -z "$MAPS_API_KEY" ] && MAPS_API_KEY="YOUR_API_KEY"; echo "MAPS_API_KEY=$MAPS_API_KEY" >> ./local.properties
[ -z "$MAPS_API_KEY" ] && MAPS_API_KEY="YOUR_API_KEY"; echo "MAPS_API_KEY=$MAPS_API_KEY" >> ./secrets.properties
- name: Build debug
run: ./gradlew assembleDebug
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
.cxx
local.properties
.java-version
secrets.properties
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ This repository includes a [sample app](app).
To run it:

1. Get a [Maps API key][api-key]
1. Create a file in the root directory named `local.properties` with a single line that looks like this, replacing YOUR_KEY with the key from step 1: `MAPS_API_KEY=YOUR_KEY`
1. Build and run
2. Open the `secrets.properties` file in your top-level directory, and then add the following code. Replace YOUR_API_KEY with your API key. Store your key in this file because secrets.properties is excluded from being checked into a version control system.
If the `secrets.properties` file does not exist, create it in the same folder as the `local.default.properties` file.

```
MAPS_API_KEY=YOUR_API_KEY
```
3. Build and run

## Documentation

Expand Down
7 changes: 6 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ dependencies {

secrets {
// To add your Maps API key to this project:
// 1. Add this line to your local.properties file, where YOUR_API_KEY is your API key:
// 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file.
// 2. Add this line, where YOUR_API_KEY is your API key:
// MAPS_API_KEY=YOUR_API_KEY
propertiesFileName = "secrets.properties"

// A properties file containing default secret values. This file can be
// checked in version control.
defaultPropertiesFileName = "local.defaults.properties"
}

0 comments on commit 91b40fa

Please sign in to comment.