Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions - Configure mapping files upload to Sentry #3710

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/sentry-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions android/quest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading