From a1cb69cd2926d9ae928285a2964af8736a54e56a Mon Sep 17 00:00:00 2001 From: Rain Ramm Date: Tue, 29 Jul 2025 16:12:47 +0300 Subject: [PATCH] Move from Nexus OSSRH to Central Portal --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 8 +++----- .github/scripts/publish.sh | 7 +++++++ .github/workflows/build-and-test-pull-request.yml | 9 ++++----- .github/workflows/publish-packages.yml | 12 ++++++------ README.md | 2 +- build.gradle | 2 +- deploy/injectGradleCredentials.sh | 5 ----- library.gradle | 4 ++-- sonarcloud.gradle | 4 ++-- 10 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100755 .github/scripts/publish.sh delete mode 100755 deploy/injectGradleCredentials.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..49028ca --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @bitweb/tech diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db7ac60..ea56f29 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,15 @@ version: 2 + updates: + - package-ecosystem: "gradle" directory: "/" schedule: interval: "monthly" - reviewers: - - "Jorich" - - "pr11t" - - "rammrain" groups: all-deps-minor-and-patch: patterns: - "*" update-types: - "minor" - - "patch" \ No newline at end of file + - "patch" diff --git a/.github/scripts/publish.sh b/.github/scripts/publish.sh new file mode 100755 index 0000000..752a48e --- /dev/null +++ b/.github/scripts/publish.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -o errexit + +./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info + +curl -X POST -H "Authorization: Bearer $(printf \"${ORG_GRADLE_PROJECT_mavenCentralUsername}:${ORG_GRADLE_PROJECT_mavenCentralPassword}\" | base64)" https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/ee.bitweb diff --git a/.github/workflows/build-and-test-pull-request.yml b/.github/workflows/build-and-test-pull-request.yml index ec35ffd..5e7cdba 100644 --- a/.github/workflows/build-and-test-pull-request.yml +++ b/.github/workflows/build-and-test-pull-request.yml @@ -11,20 +11,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup Java uses: actions/setup-java@v3 with: distribution: temurin java-version: 17 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: 8.4 + - name: Run build run: ./gradlew build -x test + - name: Run Sonar analysis env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index b87355b..16b6c73 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -1,26 +1,26 @@ name: Publish package to the Maven Central Repository + on: release: types: [created] + jobs: publish: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 + - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: 8.5 + - name: Publish packages env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository + run: ./.github/scripts/publish.sh diff --git a/README.md b/README.md index 8b42d4a..00b3ca0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Given library has helper functions that make it a bit easier to test various fun ``` // https://mvnrepository.com/artifact/ee.bitweb/spring-test-core -testImplementation group: 'ee.bitweb', name: 'spring-test-core', version: '2.0.0' +testImplementation group: 'ee.bitweb', name: 'spring-test-core', version: '2.0.1' ``` Review available versions in [Maven Central](https://mvnrepository.com/artifact/ee.bitweb/spring-test-core). diff --git a/build.gradle b/build.gradle index 3dacae2..b98ca7d 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ plugins { } group 'ee.bitweb' -version '2.0.0' +version '2.0.1' java { sourceCompatibility = '17' } diff --git a/deploy/injectGradleCredentials.sh b/deploy/injectGradleCredentials.sh deleted file mode 100755 index 2fee4b2..0000000 --- a/deploy/injectGradleCredentials.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -o errexit - -echo -e "repoUser=$1" >> "$3" -echo -e "repoPassword=$2" >> "$3" diff --git a/library.gradle b/library.gradle index 34cc761..f83f90f 100644 --- a/library.gradle +++ b/library.gradle @@ -54,8 +54,8 @@ nexusPublishing { repositories { if (project.hasProperty('mavenCentralUsername') & project.hasProperty('mavenCentralPassword')) { sonatype { - nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots")) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) username = project.mavenCentralUsername password = project.mavenCentralPassword } diff --git a/sonarcloud.gradle b/sonarcloud.gradle index fc9ed79..6fef3cf 100644 --- a/sonarcloud.gradle +++ b/sonarcloud.gradle @@ -6,12 +6,12 @@ buildscript { } } dependencies { - classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373") + classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:6.2.0.5505") } } apply plugin: org.sonarqube.gradle.SonarQubePlugin -sonarqube { +sonar { properties { property "sonar.projectKey", "BitWeb_java-test-core-lib" property "sonar.organization", "bitweb-oss"