From 648e29cfaf9993464ca7b11f55c5a0ce5c39171f Mon Sep 17 00:00:00 2001 From: Simon Njoroge Date: Mon, 3 Feb 2025 14:37:09 +0300 Subject: [PATCH 1/2] Configure Sentry CI auth token --- .../src/main/kotlin/project-properties.gradle.kts | 8 ++++---- android/quest/build.gradle.kts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/buildSrc/src/main/kotlin/project-properties.gradle.kts b/android/buildSrc/src/main/kotlin/project-properties.gradle.kts index 47b9fb752c..999ee97cfd 100644 --- a/android/buildSrc/src/main/kotlin/project-properties.gradle.kts +++ b/android/buildSrc/src/main/kotlin/project-properties.gradle.kts @@ -58,10 +58,10 @@ requiredKeystoreProperties.forEach { property -> // Set Sentry properties val requiredSentryProperties = listOf( - "org", - "project", - "auth.token", - "url" + "sentry.org", + "sentry.project", + "sentry.auth.token", + "sentry.url" ) val sentryProperties = try { diff --git a/android/quest/build.gradle.kts b/android/quest/build.gradle.kts index fef83d3a7e..388b2cf2a6 100644 --- a/android/quest/build.gradle.kts +++ b/android/quest/build.gradle.kts @@ -623,18 +623,18 @@ task("evaluatePerformanceBenchmarkResults") { sentry { // Disables or enables debug log output, e.g. for for sentry-cli. // Default is disabled. - debug.set(true) + debug.set(false) // The slug of the Sentry organization to use for uploading proguard mappings/source contexts. - org.set("""${project.extra["org"]}""") + org.set(System.getenv("SENTRY_ORG") ?: """${project.extra["sentry.org"]}""") // The slug of the Sentry project to use for uploading proguard mappings/source contexts. - projectName.set("""${project.extra["project"]}""") + projectName.set(System.getenv("SENTRY_PROJECT") ?: """${project.extra["sentry.project"]}""") // The authentication token to use for uploading proguard mappings/source contexts. // WARNING: Do not expose this token in your build.gradle files, but rather set an environment // variable and read it into this property. - authToken.set("""${project.extra["auth.token"]}""") + authToken.set(System.getenv("SENTRY_AUTH_TOKEN") ?: """${project.extra["sentry.auth.token"]}""") // The url of your Sentry instance. If you're using SAAS (not self hosting) you do not have to // set this. If you are self hosting you can set your URL here From 28c165f7911050f0918413e794d8b0b97cd507dc Mon Sep 17 00:00:00 2001 From: Simon Njoroge Date: Mon, 3 Feb 2025 15:25:25 +0300 Subject: [PATCH 2/2] Add sentry-release.yml file --- .github/workflows/sentry-release.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/sentry-release.yml diff --git a/.github/workflows/sentry-release.yml b/.github/workflows/sentry-release.yml new file mode 100644 index 0000000000..92c6f0b29c --- /dev/null +++ b/.github/workflows/sentry-release.yml @@ -0,0 +1,40 @@ +name: Upload Mapping Files to Sentry + +on: + push: + branches: [ main ] + tags: [ 'v*' ] + +jobs: + upload-to-sentry: + name: Upload Mapping Files + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Sentry CLI + run: | + curl -sL https://sentry.io/get-cli/ | bash + + - name: Create Sentry release + uses: getsentry/action-release@v1 + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} + with: + environment: production + inject: true + sourcemaps: "./dist" # Adjust path if needed + + - name: Finalize Sentry release + run: | + sentry-cli releases finalize $GITHUB_SHA + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} \ No newline at end of file