From 5dec72349417b5458503bed17308957b1a12cf97 Mon Sep 17 00:00:00 2001 From: nk_ysg Date: Sun, 24 Dec 2023 12:04:18 +0800 Subject: [PATCH] Fix2 deploy (#18) * fix gpg * fix2 deploy --- .github/workflows/maven_deploy.yml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/maven_deploy.yml b/.github/workflows/maven_deploy.yml index 8615ba7..b433f8a 100644 --- a/.github/workflows/maven_deploy.yml +++ b/.github/workflows/maven_deploy.yml @@ -18,28 +18,21 @@ jobs: fetch-depth: 0 - name: Setup Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: 11 server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - - - name: Install gpg secret key - run: | - export GPG_TTY=$(tty) - cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --import - gpg --list-secret-keys --keyid-format LONG + server-username: ${{ secrets.OSSRH_USERNAME }} + server-password: ${{ secrets.OSSRH_TOKEN }} + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }} + cache: 'maven - name: Publish to Maven Central repository env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + SIGN_KEY_PASS: ${{ secrets.OSSRH_GPG_PASSPHRASE }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_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 + mvn -U -B clean deploy -P release \ No newline at end of file