diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7440603..1fd44da 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,14 +34,15 @@ jobs: - uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v1.4.4 + uses: actions/setup-java@v4 with: + distribution: temurin java-version: 11 - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-id: central + server-username: ${{ secrets.OSSRH_USER_TOKEN }} + server-password: ${{ secrets.OSSRH_PWD_TOKEN }} gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-passphrase: ${{ secrets.GPG_PWD }} - name: Package run: | @@ -51,10 +52,6 @@ jobs: if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') run: | mvn --no-transfer-progress --batch-mode deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USER_TOKEN }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PWD_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PWD }} - name: Cache Jars uses: actions/upload-artifact@v4 diff --git a/pom.xml b/pom.xml index 343504a..44e92f3 100644 --- a/pom.xml +++ b/pom.xml @@ -43,19 +43,6 @@ com.scanoss.cli.CommandLine - - - ossrh - Maven Central Snapshot Repo - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - Maven Central Staging Repo - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - @@ -248,6 +235,7 @@ sign + gpg.passphrase --pinentry-mode @@ -258,14 +246,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 true - ossrh - https://oss.sonatype.org/ - true + central + true + published diff --git a/settings.xml b/settings.xml index 7f3fc02..aab0a16 100644 --- a/settings.xml +++ b/settings.xml @@ -1,7 +1,7 @@ - ossrh + central ${env.OSSRH_USER_TOKEN} ${env.OSSRH_PWD_TOKEN}