diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9884d1e..b8e6f0c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,16 +22,14 @@ jobs: - name: "🔨 Run Build" id: build env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - run: > - ./gradlew build - -Dgeb.env=chromeHeadless + DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + run: ./gradlew build - name: "📤 Publish Snapshot to repo.grails.org" if: steps.build.outcome == 'success' && github.event_name == 'push' env: ORG_GRADLE_PROJECT_artifactoryUsername: ${{ secrets.ARTIFACTORY_USERNAME }} ORG_GRADLE_PROJECT_artifactoryPassword: ${{ secrets.ARTIFACTORY_PASSWORD }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: > ./gradlew -Dorg.gradle.internal.publish.checksums.insecure=true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 111c770..9f2c475 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: - name: "📤 Publish to Sonatype" id: publish_to_sonatype env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} ORG_GRADLE_PROJECT_sonatypeOssUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypeOssPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_sonatypeOssStagingProfileId: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} diff --git a/build.gradle b/build.gradle index 59ac8ae..e8db6ec 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,7 @@ version = projectVersion apply plugin: 'groovy' apply plugin: 'java-library' +apply plugin: 'jvm-test-suite' apply plugin: 'org.grails.grails-plugin' apply plugin: 'io.github.gradle-nexus.publish-plugin' apply plugin: 'maven-publish' @@ -41,7 +42,7 @@ configurations.configureEach { } java { - sourceCompatibility = JavaVersion.VERSION_17 + toolchain.languageVersion = JavaLanguageVersion.of(17) withSourcesJar() withJavadocJar() } @@ -81,9 +82,19 @@ tasks.named('jar', Jar) { archiveClassifier = '' } -tasks.withType(Test).configureEach { - useJUnitPlatform() - testLogging { events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' } +testing { + suites { + test { + useJUnitJupiter() + targets.configureEach { + testTask.configure { Test task -> + task.testLogging { + events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' + } + } + } + } + } } ext.set('signing.keyId', System.getenv('SIGNING_KEY')) @@ -91,7 +102,6 @@ ext.set('signing.password', System.getenv('SIGNING_PASSPHRASE')) ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT')) ext.set('isReleaseVersion', !isSnapshot) - def javaComponent = components.named('java') publishing { publications { diff --git a/settings.gradle b/settings.gradle index 466ad7a..c6d4146 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,25 +1,24 @@ plugins { - id 'com.gradle.enterprise' version '3.16.2' - id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.13' + id 'com.gradle.develocity' version '3.18' + id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0.2' } -gradleEnterprise { +def isCI = System.getenv('CI') != null +def isLocal = !isCI +def isAuthenticated = System.getenv('DEVELOCITY_ACCESS_KEY') != null + +develocity { server = 'https://ge.grails.org' buildScan { - publishAlwaysIf(System.getenv('CI') == 'true') - publishIfAuthenticated() - uploadInBackground = System.getenv("CI") == null - capture { - taskInputFiles = true - } + publishing.onlyIf { isAuthenticated } + uploadInBackground = isLocal } } buildCache { - local { enabled = System.getenv('CI') != 'true' } - remote(gradleEnterprise.buildCache) { - def isAuthenticated = System.getenv('GRADLE_ENTERPRISE_ACCESS_KEY') - push = System.getenv('CI') == 'true' && isAuthenticated + local { enabled = isLocal } + remote(develocity.buildCache) { + push = isCI && isAuthenticated enabled = true } }