From 68d1ee0e01d51974a92313d51b84aaad3fe7a957 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 16 Nov 2022 16:24:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=87=AA=E5=8A=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b007fdbc..5fef4211 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,8 @@ name: Publish package to the Maven Central Repository on: - push: - tags: [ "*" ] + release: + types: [created] jobs: publish: @@ -31,15 +31,11 @@ jobs: with: java-version: 8 distribution: 'adopt' - server-id: sonatype-nexus-staging - server-username: ${{ secrets.NEXUS_USERNAME }} - server-password: ${{ secrets.NEXUS_PASSWORD }} - gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} - nexus_username: ${{ secrets.NEXUS_USERNAME }} - nexus_password: ${{ secrets.NEXUS_PASSWORD }} - maven_args: -Dmaven.test.skip=false -Dmaven.javadoc.skip=false -Dgpg.skip=false \ No newline at end of file + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file