Skip to content

Commit

Permalink
chore: Cleanup unused API_KEY from sample apps (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud-elmorabea authored Oct 3, 2024
1 parent a8c84e3 commit ce6edf6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-sample-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ jobs:
- sample-app: "java_layout"
cio-cdpapikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY"
cio-siteid-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_API_KEY"
- sample-app: "kotlin_compose"
cio-cdpapikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_CDP_API_KEY"
cio-siteid-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_API_KEY"


runs-on: ubuntu-latest
name: Building app...${{ matrix.sample-app }}
steps:
Expand All @@ -90,7 +88,6 @@ jobs:
touch "samples/local.properties"
echo "cdpApiKey=${{ secrets[matrix.cio-cdpapikey-secret-key] }}" >> "samples/local.properties"
echo "siteId=${{ secrets[matrix.cio-siteid-secret-key] }}" >> "samples/local.properties"
echo "apiKey=${{ secrets[matrix.cio-apikey-secret-key] }}" >> "samples/local.properties"
- name: Dump GitHub Action metadata because Fastlane uses it. Viewing it here helps debug JSON parsing code in Firebase.
run: cat $GITHUB_EVENT_PATH
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,25 @@ jobs:
- sample-app-with-agp: "java_layout_sdk"
sample-app: "java_layout"
cio-siteid-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_API_KEY"
cio-cdpapikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY"
agp-version: "8.3.1"
gradle-version: "8.4"
- sample-app-with-agp: "kotlin_compose_sdk"
sample-app: "kotlin_compose"
cio-siteid-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_API_KEY"
cio-cdpapikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_CDP_API_KEY"
agp-version: "8.3.1"
gradle-version: "8.4"
- sample-app-with-agp: "java_layout_7"
sample-app: "java_layout"
cio-siteid-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_API_KEY"
cio-cdpapikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_CDP_API_KEY"
agp-version: "7.4.1"
gradle-version: "7.6.4"
- sample-app-with-agp: "kotlin_compose_7"
sample-app: "kotlin_compose"
cio-siteid-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID"
cio-apikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_API_KEY"
cio-cdpapikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_CDP_API_KEY"
agp-version: "7.4.1"
gradle-version: "7.6.4"

Expand All @@ -118,7 +118,7 @@ jobs:
touch "samples/local.properties"
echo "sdkVersion=${{ needs.publish.outputs.snapshot_version }}" >> "samples/local.properties"
echo "siteId=${{ secrets[matrix.cio-siteid-secret-key] }}" >> "samples/local.properties"
echo "apiKey=${{ secrets[matrix.cio-apikey-secret-key] }}" >> "samples/local.properties"
echo "cdpApiKey=${{ secrets[matrix.cio-cdpapikey-secret-key] }}" >> "samples/local.properties"
- name: Update files for Gradle compatibility
# If AGP version matches the default value, we don't need to specify further versions.
Expand Down
2 changes: 0 additions & 2 deletions samples/sample-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ android {
// e.g. Java Layout sample app has prefix javaLayout_ for API keys
// javaLayout_cdpApiKey=KEY has higher priority than cdpApiKey=KEY
// cdpApiKey=KEY can be used as a fallback for all sample apps
String apiKey = getConfigWithPrefix("apiKey")
String cdpApiKey = getConfigWithPrefix("cdpApiKey")
String siteId = getConfigWithPrefix("siteId")

// Set build config fields for API keys
buildConfigField "String", "API_KEY", "\"${apiKey}\""
buildConfigField "String", "CDP_API_KEY", "\"${cdpApiKey}\""
buildConfigField "String", "SITE_ID", "\"${siteId}\""
}
Expand Down

0 comments on commit ce6edf6

Please sign in to comment.