Skip to content

Commit 7c4e689

Browse files
committed
fix(workflow): configurar GPG para modo loopback em ambiente CI
- Configura ~/.gnupg/gpg.conf com pinentry-mode loopback - Adiciona allow-loopback-pinentry no gpg-agent.conf - Passa argumentos GPG corretos para o Maven
1 parent 8c92dcd commit 7c4e689

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.claude/settings.local.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@
1919
"Bash(git commit:*)",
2020
"Bash(git push:*)",
2121
"Bash(git restore:*)",
22-
"Bash(gpg:*)"
22+
"Bash(gpg:*)",
23+
"Bash(git tag:*)",
24+
"Bash(gh run list:*)",
25+
"Bash(git show-ref:*)",
26+
"Bash(curl:*)",
27+
"Bash(python3:*)",
28+
"Bash(mvn help:evaluate:*)",
29+
"Bash(echo:*)",
30+
"Bash(GITHUB_REF=\"refs/tags/v2.0.0-test.1\")",
31+
"Bash(VERSION=\"$GITHUB_REF#refs/tags/v\")"
2332
],
2433
"deny": []
2534
}

.github/workflows/publish-maven-central.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ jobs:
4141
run: |
4242
mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
4343
44+
- name: Configure GPG
45+
run: |
46+
mkdir -p ~/.gnupg
47+
echo "use-agent" >> ~/.gnupg/gpg.conf
48+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
49+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
50+
4451
- name: Import GPG key
4552
run: |
4653
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > /tmp/private_key.asc
47-
gpg --batch --import /tmp/private_key.asc
54+
gpg --batch --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --import /tmp/private_key.asc
4855
rm -f /tmp/private_key.asc
4956
gpg --list-keys
5057
gpg --list-secret-keys
@@ -53,7 +60,9 @@ jobs:
5360
run: |
5461
mvn clean deploy -Pmaven-central -DskipTests \
5562
-s .maven-settings.xml.template \
56-
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
63+
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
64+
-Dgpg.pinentry-mode=loopback \
65+
-Dgpg.batch=true
5766
env:
5867
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
5968
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

.maven-settings.xml.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<properties>
1717
<gpg.executable>gpg</gpg.executable>
1818
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
19+
<gpg.keyname>BEFBA859508A8489</gpg.keyname>
1920
</properties>
2021
</profile>
2122
</profiles>

0 commit comments

Comments
 (0)