From a911904171ff73a435e2c8ca8104c31d6e325ab8 Mon Sep 17 00:00:00 2001 From: sschr15 Date: Thu, 5 Oct 2023 11:03:42 -0500 Subject: [PATCH] Track versions for sentry --- build.gradle.kts | 6 ++++++ src/main/kotlin/org/quiltmc/community/_Utils.kt | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 370503a9..2d358eda 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -122,6 +122,12 @@ tasks { attributes( "Main-Class" to "org.quiltmc.community.AppKt" ) + + if (System.getenv("GITHUB_SHA") != null) { + attributes( + "Implementation-Version" to System.getenv("GITHUB_SHA") + ) + } } } } diff --git a/src/main/kotlin/org/quiltmc/community/_Utils.kt b/src/main/kotlin/org/quiltmc/community/_Utils.kt index bb88aad7..df746d33 100644 --- a/src/main/kotlin/org/quiltmc/community/_Utils.kt +++ b/src/main/kotlin/org/quiltmc/community/_Utils.kt @@ -141,12 +141,17 @@ suspend fun ExtensibleBotBuilder.common() { extensions { sentry { val sentryDsn = envOrNull("SENTRY_DSN") + val version: String? = object {}::class.java.`package`.implementationVersion if (sentryDsn != null) { enable = true dsn = sentryDsn } + + if (version != null) { + release = version + } } help {