diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd3eefd..01b29d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 21 - name: Build with Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/build.gradle.kts b/build.gradle.kts index 9fbc317..e72d1d1 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,7 @@ + import com.github.jengelman.gradle.plugins.shadow.ShadowExtension +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import java.util.* val vertxVersion: String by project @@ -175,14 +178,22 @@ publishing { } deployer { - centralPortalSpec { - // Take these credentials from the Generate User Token page at https://central.sonatype.com/account - auth.user.set(secret(System.getenv("OSSRH_USERNAME"))) - auth.password.set(secret(System.getenv("OSSRH_PASSWORD"))) - - // Signing is required - signing.key.set(secret(String(Base64.getDecoder().decode(System.getenv("GPG_PRIVATE_KEY").replace("\n", ""))))) - signing.password.set(secret(System.getenv("GPG_PASSPHRASE"))) + if (System.getenv("OSSRH_USERNAME") != null && System.getenv("OSSRH_PASSWORD") != null) { + centralPortalSpec { + // Take these credentials from the Generate User Token page at https://central.sonatype.com/account + auth.user.set(secret(System.getenv("OSSRH_USERNAME"))) + auth.password.set(secret(System.getenv("OSSRH_PASSWORD"))) + + // Signing is required + signing.key.set( + secret( + String( + Base64.getDecoder().decode(System.getenv("GPG_PRIVATE_KEY").replace("\n", "")) + ) + ) + ) + signing.password.set(secret(System.getenv("GPG_PASSPHRASE"))) + } } } @@ -201,4 +212,12 @@ signing { } else { logger.warn("Signing is not configured. Skipping signing tasks.") } -} \ No newline at end of file +} + +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8) + languageVersion.set(KotlinVersion.KOTLIN_1_8) + } +}