Skip to content

Commit

Permalink
Fix signing
Browse files Browse the repository at this point in the history
Signed-off-by: Max Lambrecht <[email protected]>
  • Loading branch information
maxlambrecht committed Feb 17, 2024
1 parent b548e92 commit 66f2fcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ subprojects {
}

signing {
useGpgCmd()
useInMemoryPgpKeys(System.getenv('PGP_PRIVATE_KEY'), System.getenv('PGP_KEY_PASSPHRASE'))
sign publishing.publications.mavenJava
}

Expand Down

0 comments on commit 66f2fcd

Please sign in to comment.