From 86dbacea878a4c45f8c24f29af014cf318480ce2 Mon Sep 17 00:00:00 2001 From: Vitor Hugo Schwaab Date: Mon, 24 Jun 2024 10:02:42 +0200 Subject: [PATCH] ci: add DataDog tokens to GitHub workflows [WPB-9788] (#3116) --- .github/workflows/build-beta-app.yml | 4 ++++ .github/workflows/build-develop-app.yml | 4 ++++ .github/workflows/build-rc-app.yml | 6 ++++++ app/build.gradle.kts | 10 +++++----- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-beta-app.yml b/.github/workflows/build-beta-app.yml index eedc30cd638..26236433cf5 100644 --- a/.github/workflows/build-beta-app.yml +++ b/.github/workflows/build-beta-app.yml @@ -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 }} @@ -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 }} diff --git a/.github/workflows/build-develop-app.yml b/.github/workflows/build-develop-app.yml index 649204bc0ca..e9efdd64c8f 100644 --- a/.github/workflows/build-develop-app.yml +++ b/.github/workflows/build-develop-app.yml @@ -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 }} @@ -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 }} diff --git a/.github/workflows/build-rc-app.yml b/.github/workflows/build-rc-app.yml index 8ba25d17d94..56090054d13 100644 --- a/.github/workflows/build-rc-app.yml +++ b/.github/workflows/build-rc-app.yml @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 56429dd3c8d..601dc27b147 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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