From dbf6b6c612a93959fc3efd0255ddbddb32a96824 Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:14:39 +0100 Subject: [PATCH] [acme] Update common files for branch 5.3.x (#459) * Update common files * sonatype --------- Co-authored-by: Sergio del Amo --- .github/renovate.json | 22 +++++++++++++------ .github/workflows/gradle.yml | 7 ++++++ buildSrc/build.gradle | 1 + ...icronaut.build.internal.acme-module.gradle | 10 +++++++++ gradle/libs.versions.toml | 3 ++- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 09c2a598..99eeec10 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,24 +1,32 @@ { "extends": [ - "config:base" + "config:recommended" + ], + "addLabels": [ + "type: dependency-upgrade" ], - "addLabels": ["type: dependency-upgrade"], "schedule": [ - "after 10pm every day" + "after 10pm" ], "prHourlyLimit": 1, "prConcurrentLimit": 20, "timezone": "Europe/Prague", "packageRules": [ { - "matchPackagePatterns": ["actions.*"], "dependencyDashboardApproval": true, - "matchUpdateTypes": ["patch"], + "matchUpdateTypes": [ + "patch" + ], "matchCurrentVersion": "!/^0/", - "automerge": true + "automerge": true, + "matchPackageNames": [ + "/actions.*/" + ] }, { - "matchUpdateTypes": ["patch"], + "matchUpdateTypes": [ + "patch" + ], "matchCurrentVersion": "!/^0/", "automerge": true } diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 571e79a2..aab934a7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,6 +30,8 @@ jobs: PREDICTIVE_TEST_SELECTION: "${{ github.event_name == 'pull_request' && 'true' || 'false' }}" SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OSS_INDEX_USERNAME: ${{ secrets.OSS_INDEX_USERNAME }} + OSS_INDEX_PASSWORD: ${{ secrets.OSS_INDEX_PASSWORD }} steps: # https://github.com/actions/virtual-environments/issues/709 - name: "🗑 Free disk space" @@ -58,6 +60,11 @@ jobs: run: | [ -f ./setup.sh ] && ./setup.sh || [ ! -f ./setup.sh ] + - name: "🚔 Sonatype Scan" + id: sonatypescan + run: | + ./gradlew ossIndexAudit --no-parallel + - name: "🛠 Build with Gradle" id: gradle run: | diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 21e3c454..2fdd54a0 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -9,4 +9,5 @@ repositories { dependencies { implementation libs.gradle.micronaut + implementation(libs.sonatype.scan) } diff --git a/buildSrc/src/main/groovy/io.micronaut.build.internal.acme-module.gradle b/buildSrc/src/main/groovy/io.micronaut.build.internal.acme-module.gradle index 1f594871..5b982203 100644 --- a/buildSrc/src/main/groovy/io.micronaut.build.internal.acme-module.gradle +++ b/buildSrc/src/main/groovy/io.micronaut.build.internal.acme-module.gradle @@ -1,4 +1,14 @@ plugins { id "io.micronaut.build.internal.module" id "io.micronaut.build.internal.acme-base" + id("org.sonatype.gradle.plugins.scan") +} +String ossIndexUsername = System.getenv("OSS_INDEX_USERNAME") ?: project.properties["ossIndexUsername"] +String ossIndexPassword = System.getenv("OSS_INDEX_PASSWORD") ?: project.properties["ossIndexPassword"] +boolean sonatypePluginConfigured = ossIndexUsername != null && ossIndexPassword != null +if (sonatypePluginConfigured) { + ossIndexAudit { + username = ossIndexUsername + password = ossIndexPassword + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c1b02925..481d6faa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,7 +12,7 @@ micronaut-serde = "2.12.0" micronaut-test-resources="2.6.2" micronaut-validation = "4.8.0" micronaut-gradle-plugin = "4.4.4" - +sonatype-scan = "3.0.0" [libraries] # Core micronaut-core = { module = 'io.micronaut:micronaut-core-bom', version.ref = 'micronaut' } @@ -29,3 +29,4 @@ netty-tcnative-boringssl-static = { module = 'io.netty:netty-tcnative-boringssl- groovy-json = { module = 'org.apache.groovy:groovy-json' } groovy-dateutil = { module = 'org.apache.groovy:groovy-dateutil' } gradle-micronaut = { module = "io.micronaut.gradle:micronaut-gradle-plugin", version.ref = "micronaut-gradle-plugin" } +sonatype-scan = { module = "org.sonatype.gradle.plugins:scan-gradle-plugin", version.ref = "sonatype-scan" }