Skip to content

Commit

Permalink
ci: add DataDog tokens to GitHub workflows [WPB-9788] (#3116)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods authored Jun 24, 2024
1 parent 2d98ae7 commit 86dbace
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-beta-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
run:
./gradlew app:assembleBetaRelease
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand All @@ -66,6 +68,8 @@ jobs:
run:
./gradlew app:bundleBetaRelease
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-develop-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
run:
./gradlew app:assembleDevDebug
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand All @@ -63,6 +65,8 @@ jobs:
run:
./gradlew app:assembleStagingRelease
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-rc-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
run:
./gradlew app:assembleInternalCompat
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand All @@ -62,6 +64,8 @@ jobs:
run:
./gradlew app:bundleInternalCompat
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand All @@ -75,6 +79,8 @@ jobs:
run:
./gradlew app:assembleStagingCompat
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ private fun getFlavorsSettings(): NormalizedFlavorSettings =
android {
defaultConfig {
val datadogApiKeyKey = "DATADOG_CLIENT_TOKEN"
val apiKey: String? = System.getenv(datadogApiKeyKey) ?: project.getLocalProperty(datadogApiKeyKey, null)
buildConfigField("String", "DATADOG_CLIENT_TOKEN", apiKey?.let { "\"$it\"" } ?: "null")
val datadogApiKey: String? = System.getenv(datadogApiKeyKey) ?: project.getLocalProperty(datadogApiKeyKey, null)
buildConfigField("String", datadogApiKeyKey, datadogApiKey?.let { "\"$it\"" } ?: "null")

val datadogAppId = "DATADOG_APP_ID"
val appId: String? = System.getenv(datadogAppId) ?: project.getLocalProperty(datadogAppId, null)
buildConfigField("String", datadogAppId, appId?.let { "\"$it\"" } ?: "null")
val datadogAppIdKey = "DATADOG_APP_ID"
val appId: String? = System.getenv(datadogAppIdKey) ?: project.getLocalProperty(datadogAppIdKey, null)
buildConfigField("String", datadogAppIdKey, appId?.let { "\"$it\"" } ?: "null")
}
// Most of the configuration is done in the build-logic
// through the Wire Application convention plugin
Expand Down

0 comments on commit 86dbace

Please sign in to comment.