diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26fafe9..60cdadb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,11 +12,30 @@ jobs: packages: write steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 21 - - name: Publish package - run: mvn --batch-mode deploy + + - name: Build with Maven + run: mvn -ntp -B package + + - name: Set up Maven Central Repository + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.CENTRAL_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to the Maven Central Repository + run: mvn -ntp -B -DskipTests -Prelease-central deploy env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.CENTRAL_GPG_PASS_PHRASE }} diff --git a/pom.xml b/pom.xml index 00acc4b..029ed01 100644 --- a/pom.xml +++ b/pom.xml @@ -223,38 +223,18 @@ - release-ossrh - - - ossrh - Central Repository OSSRH (Snapshot) - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - Central Repository OSSRH - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - + release-central - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - - - deploy - - deploy - - - - ossrh - https://s01.oss.sonatype.org - true + central + true + true