From bb238ef5c3e3e6d9fbb8671c3bf99a28baa2e31d Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Sun, 24 Dec 2023 11:11:08 +0800 Subject: [PATCH] Fix deploy2 (#15) * fix OSSRH_GPG_SECRET_KEY * fix OSSRH_GPG_SECRET_KEY --- .github/workflows/maven_deploy.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/maven_deploy.yml b/.github/workflows/maven_deploy.yml index ef09b73..9c356c5 100644 --- a/.github/workflows/maven_deploy.yml +++ b/.github/workflows/maven_deploy.yml @@ -21,11 +21,24 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN - - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg_passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }} - nexus_username: ${{ secrets.OSSRH_USERNAME }} - nexus_password: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file + - name: Install gpg secret key + run: | + cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --import + gpg --list-secret-keys --keyid-format LONG + + - name: Publish to Maven Central repository + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + run: | + cat ~/.m2/settings.xml + echo $MAVEN_USERNAME + echo $MAVEN_PASSWORD + mvn \ + --no-transfer-progress \ + -Dgpg.passphrase=${{ secrets.OSSRH_GPG_PASSPHRASE }} \ + clean deploy \ No newline at end of file