@@ -53,9 +53,9 @@ gpg --keyserver keyserver.ubuntu.com --send-keys ABCD1234EFGH5678
5353gpg --keyserver keys.openpgp.org --send-keys ABCD1234EFGH5678
5454gpg --keyserver pgp.mit.edu --send-keys ABCD1234EFGH5678
5555
56- # Export private key in base64 for GitHub Secrets
57- gpg --export-secret-keys ABCD1234EFGH5678 | base64
58- # Copy the entire base64 output
56+ # Export private key for GitHub Secrets (ASCII armored format)
57+ gpg --armor -- export-secret-keys ABCD1234EFGH5678
58+ # Copy the entire output (including BEGIN/END lines)
5959```
6060
6161### 4. Configure GitHub Secrets
@@ -66,7 +66,7 @@ Add these secrets to your GitHub repository (Settings → Secrets and variables
6666| -------------| -------------| ------------|
6767| ` MAVEN_CENTRAL_USERNAME ` | Maven Central Portal username | From token generation at central.sonatype.com/account |
6868| ` MAVEN_CENTRAL_PASSWORD ` | Maven Central Portal password | From token generation at central.sonatype.com/account |
69- | ` GPG_PRIVATE_KEY ` | GPG private key in base64 | Run: ` gpg --export-secret-keys YOUR_KEY_ID \| base64 ` |
69+ | ` GPG_PRIVATE_KEY ` | GPG private key (ASCII armored) | Run: ` gpg --armor -- export-secret-keys YOUR_KEY_ID ` |
7070| ` GPG_PASSPHRASE ` | Passphrase for GPG key | The passphrase you set when creating the GPG key |
7171
7272``` bash
@@ -75,8 +75,8 @@ gh secret set MAVEN_CENTRAL_USERNAME --body "your-token-username"
7575gh secret set MAVEN_CENTRAL_PASSWORD --body " your-token-password"
7676gh secret set GPG_PASSPHRASE --body " your-gpg-passphrase"
7777
78- # For GPG_PRIVATE_KEY (multiline):
79- gpg --export-secret-keys ABCD1234EFGH5678 | base64 > gpg-key.txt
78+ # For GPG_PRIVATE_KEY (multiline - ASCII armored format ):
79+ gpg --armor -- export-secret-keys ABCD1234EFGH5678 > gpg-key.txt
8080gh secret set GPG_PRIVATE_KEY < gpg-key.txt
8181rm gpg-key.txt
8282```
0 commit comments