File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ ENV GITHUB_SHA=$GITHUB_SHA \
2020 SENTRY_RELEASE=$SENTRY_RELEASE
2121
2222RUN ./scripts/prebuild.sh && \
23- flutter build web --release --source-maps --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE && \
23+ flutter build web --release --source-maps \
24+ --dart-define=SENTRY_RELEASE=$SENTRY_RELEASE \
25+ --dart-define=SENTRY_DIST=$GITHUB_SHA && \
2426 if [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_RELEASE" ]; then \
2527 echo "Sentry configuration detected, uploading sourcemaps..." && \
2628 curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=2.20.7 bash && \
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ class SentryConfig {
3232 // Check if Sentry is available
3333 final bool isAvailable;
3434
35+ // The distribution version of the release.
36+ // In this project, it represents the Git SHA passed via `--dart-define=SENTRY_DIST`.
37+ // This must match the `--dist` parameter used when uploading source maps to Sentry.
38+ final String ? dist;
39+
3540 SentryConfig ({
3641 required this .dsn,
3742 required this .environment,
@@ -42,6 +47,7 @@ class SentryConfig {
4247 this .isDebug = BuildUtils .isDebugMode,
4348 this .attachScreenshot = false ,
4449 this .isAvailable = false ,
50+ this .dist,
4551 });
4652
4753 /// Load configuration from an env file.
@@ -62,11 +68,14 @@ class SentryConfig {
6268
6369 final appVersion = await ApplicationManager ().getAppVersion ();
6470
71+ const sentryDist = String .fromEnvironment ('SENTRY_DIST' );
72+
6573 return SentryConfig (
6674 dsn: sentryDSN,
6775 environment: sentryEnvironment,
6876 release: appVersion,
6977 isAvailable: isAvailable,
78+ dist: sentryDist.isNotEmpty ? sentryDist : null ,
7079 );
7180 }
7281}
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class SentryInitializer {
3030 options.dsn = config.dsn;
3131 options.environment = config.environment;
3232 options.release = config.release;
33+ options.dist = config.dist;
3334 options.tracesSampleRate = config.tracesSampleRate;
3435 options.profilesSampleRate = config.profilesSampleRate;
3536 options.enableLogs = config.enableLogs;
You can’t perform that action at this time.
0 commit comments