Skip to content

Commit 546dae7

Browse files
Merge pull request #122 from dmitry-shibanov/update-docs-for-maven-and-gpg
Add notes about maven extra configuration and gpg key.
2 parents 2fac83d + 4d656d0 commit 546dae7

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ jobs:
8585
```
8686

8787
## Publishing using Apache Maven
88+
89+
### Extra setup for pom.xml:
90+
91+
The Maven GPG Plugin configuration in the pom.xml file should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
92+
93+
```xml
94+
<configuration>
95+
<!-- Prevent gpg from using pinentry programs -->
96+
<gpgArguments>
97+
<arg>--pinentry-mode</arg>
98+
<arg>loopback</arg>
99+
</gpgArguments>
100+
</configuration>
101+
```
102+
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to pick up the `gpg.passphrase` value defined in Maven `settings.xml`.
103+
104+
### Yaml example:
88105
```yaml
89106
jobs:
90107
build:
@@ -164,10 +181,14 @@ The two `settings.xml` files created from the above example look like the follow
164181
</settings>
165182
```
166183

167-
***NOTE: The `settings.xml` file is created in the Actions $HOME directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.***
184+
***NOTE: The `settings.xml` file is created in the Actions $HOME/.m2 directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.***
185+
186+
### GPG
168187

169188
If `gpg-private-key` input is provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).
170189

190+
**GPG key should be imported by: `gpg --armor --export-secret-keys YOUR_ID`**
191+
171192
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
172193

173194
## Publishing using Gradle

0 commit comments

Comments
 (0)