From 66f2fcd0f4f01efcbea4209fc6ee3eb75d213547 Mon Sep 17 00:00:00 2001 From: Max Lambrecht Date: Sat, 17 Feb 2024 13:06:12 -0600 Subject: [PATCH] Fix signing Signed-off-by: Max Lambrecht --- .github/workflows/release_build.yml | 26 ++++++++------------------ build.gradle | 2 +- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index e1dc3196..0c52c639 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -11,30 +11,20 @@ jobs: runs-on: ubuntu-latest env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + GPG_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }} + SIGNING_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSPHRASE}} steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Configure GPG - run: | - echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf - echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf - gpgconf --kill gpg-agent - gpgconf --launch gpg-agent - - - name: Import GPG key - run: | - echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'adopt' - name: Publish to Nexus Maven Repository run: | - ./gradlew publish \ - -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ - -Psigning.password="${{ secrets.SIGNING_KEY_PASSWORD }}" \ - -Psigning.secretKeyRingFile="${HOME}/.gnupg/pubring.kbx" + ./gradlew publish \ No newline at end of file diff --git a/build.gradle b/build.gradle index b46d05d0..c02169bc 100644 --- a/build.gradle +++ b/build.gradle @@ -96,7 +96,7 @@ subprojects { } signing { - useGpgCmd() + useInMemoryPgpKeys(System.getenv('PGP_PRIVATE_KEY'), System.getenv('PGP_KEY_PASSPHRASE')) sign publishing.publications.mavenJava }