diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bcd5b4c..fc53849 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,7 +53,7 @@ jobs: # Obviously reguired step - name: Publish package # wraped the signing.password with single quotes as the password could contain special characters - run: ./gradlew publish -Psigning.keyId=${{secrets.OSSRH_GPG_SECRET_KEY_ID}} -Psigning.password='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}' -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) --warn --stacktrace + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Psigning.keyId=${{secrets.OSSRH_GPG_SECRET_KEY_ID}} -Psigning.password='${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}}' -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) --warn --stacktrace env: MAVEN_USERNAME: ${{secrets.OSSRH_USERNAME}} MAVEN_PASSWORD: ${{secrets.OSSRH_PASSWORD}} diff --git a/build.gradle b/build.gradle index 3d7a087..7edeff0 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java-library' id 'maven-publish' id 'signing' + id "io.github.gradle-nexus.publish-plugin" version "1.1.0" } repositories { @@ -26,7 +27,7 @@ java { group = 'io.github.robbilie' archivesBaseName = 'node-green' -version = '0.0.2' +version = '0.0.4' publishing { publications { @@ -67,14 +68,15 @@ publishing { } } } +} + +nexusPublishing { repositories { - maven { - name = "OSSRH" - url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") - } + sonatype { + nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") + snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") } } }