diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 228bb989..65855181 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,8 +19,8 @@ jobs: - uses: actions/setup-java@v3 with: - java-version: '17' - distribution: oracle + java-version: '11' + distribution: adopt - name: Build & Test uses: burrunan/gradle-cache-action@v1 @@ -31,12 +31,10 @@ jobs: job-id: jdk11-build-test arguments: check sonar - - name: Upload Reports - uses: actions/upload-artifact@v3 - if: always() + - name: Report Tests + uses: dorny/test-reporter@v1 + if: success() || failure() with: - name: reports - path: | - core/build/reports/ - okhttp/build/reports/ - jdk/build/reports/ + name: Tests Results + path: "**/build/test-results/*/*.xml" + reporter: java-junit diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 9c5d0088..44b18763 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -21,8 +21,8 @@ jobs: - uses: actions/setup-java@v3 with: - java-version: '17' - distribution: oracle + java-version: '11' + distribution: adopt - name: Build Artifacts & Documentation uses: burrunan/gradle-cache-action@v1 @@ -40,11 +40,11 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} with: job-id: jdk11-build-test - arguments: publishRelease -x test + arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository githubRelease -x test properties: | releaseVersion=${{ github.ref_name }} - ossrhUsername=${{ secrets.OSSRH_USER }} - ossrhPassword=${{ secrets.OSSRH_PASS }} + sonatypeUsername=${{ secrets.OSSRH_USER }} + sonatypePassword=${{ secrets.OSSRH_PASS }} github.token=${{ secrets.GITHUB_TOKEN }} - name: Publish Documentation diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 92259658..88e5d707 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -21,8 +21,8 @@ jobs: - uses: actions/setup-java@v3 with: - java-version: '17' - distribution: oracle + java-version: '11' + distribution: adopt - name: Build Artifacts & Documentation uses: burrunan/gradle-cache-action@v1 @@ -34,10 +34,10 @@ jobs: uses: burrunan/gradle-cache-action@v1 with: job-id: jdk11-build-test - arguments: publishAllPublicationsToMavenCentralRepository + arguments: publishToSonatype properties: | - ossrhUsername=${{ secrets.OSSRH_USER }} - ossrhPassword=${{ secrets.OSSRH_PASS }} + sonatypeUsername=${{ secrets.OSSRH_USER }} + sonatypePassword=${{ secrets.OSSRH_PASS }} - name: Publish Documentation uses: JamesIves/github-pages-deploy-action@v4 diff --git a/build.gradle.kts b/build.gradle.kts index a1b8cabc..d3de5b37 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,6 +9,7 @@ plugins { id("org.jetbrains.dokka") id("com.github.breadmoirai.github-release") id("org.sonarqube") + id("io.github.gradle-nexus.publish-plugin") kotlin("jvm") apply (false) @@ -132,7 +133,7 @@ configure(moduleNames.map { project(":sunday-$it") }) { } configure { - input = files("src/main/kotlin") + source = files("src/main/kotlin") config = files("${rootProject.layout.projectDirectory}/src/main/detekt/detekt.yml") buildUponDefaultConfig = true @@ -176,6 +177,9 @@ configure(moduleNames.map { project(":sunday-$it") }) { create("library") { from(components["java"]) + suppressPomMetadataWarningsFor("testFixturesApiElements") + suppressPomMetadataWarningsFor("testFixturesRuntimeElements") + pom { when (project.name) { @@ -246,20 +250,6 @@ configure(moduleNames.map { project(":sunday-$it") }) { } } - - repositories { - maven { - name = "MavenCentral" - val snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - val releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - url = uri(if (isSnapshot) snapshotUrl else releaseUrl) - credentials { - username = project.findProperty("ossrhUsername")?.toString() - password = project.findProperty("ossrhPassword")?.toString() - } - } - } - } configure { @@ -276,6 +266,11 @@ configure(moduleNames.map { project(":sunday-$it") }) { onlyIf { !isSnapshot } } + + // + // ANALYSIS + // + sonarqube { properties { property("sonar.sources", "src/main") @@ -308,6 +303,16 @@ sonarqube { } } + +// +// DOCS +// + +tasks.dokkaHtmlMultiModule.configure { + outputDirectory.set(buildDir.resolve("dokka/${releaseVersion}")) +} + + // // RELEASING // @@ -317,9 +322,9 @@ githubRelease { repo("sunday-kt") tagName(releaseVersion) targetCommitish("main") - releaseName("v${releaseVersion}") + releaseName("🚀 v${releaseVersion}") generateReleaseNotes(true) - draft(true) + draft(false) prerelease(!releaseVersion.matches("""^\d+\.\d+\.\d+$""".toRegex())) releaseAssets( moduleNames.flatMap { moduleName -> @@ -334,25 +339,8 @@ githubRelease { ) } -tasks { - - dokkaHtmlMultiModule.configure { - outputDirectory.set(buildDir.resolve("dokka/${releaseVersion}")) - } - - register("publishMavenRelease") { - dependsOn( - moduleNames.map { moduleName -> - ":sunday-$moduleName:publishAllPublicationsToMavenCentralRepository" - } - ) - } - - register("publishRelease") { - dependsOn( - "publishMavenRelease", - "githubRelease" - ) +nexusPublishing { + repositories { + sonatype() } - } diff --git a/gradle.properties b/gradle.properties index f3c35fba..819b3dd9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,8 @@ licenserPluginVersion=0.6.1 kotlinterPluginVersion=3.4.4 detektPluginVersion=1.22.0 githubReleasePluginVersion=2.4.1 -sonarqubeVersion=3.5.0.2730 +sonarqubePluginVersion=3.5.0.2730 +nexusPublishPluginVersion=1.1.0 slf4jVersion=2.0.4 kotlinCoroutinesVersion=1.6.4 diff --git a/settings.gradle.kts b/settings.gradle.kts index f7cc0e0b..9de8a555 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,7 +12,8 @@ pluginManagement { val kotlinterPluginVersion: String by settings val detektPluginVersion: String by settings val githubReleasePluginVersion: String by settings - val sonarqubeVersion: String by settings + val sonarqubePluginVersion: String by settings + val nexusPublishPluginVersion: String by settings plugins { kotlin("jvm") version kotlinPluginVersion @@ -21,7 +22,8 @@ pluginManagement { id("org.jmailen.kotlinter") version kotlinterPluginVersion id("io.gitlab.arturbosch.detekt") version detektPluginVersion id("com.github.breadmoirai.github-release") version githubReleasePluginVersion - id("org.sonarqube") version sonarqubeVersion + id("org.sonarqube") version sonarqubePluginVersion + id("io.github.gradle-nexus.publish-plugin") version nexusPublishPluginVersion } }