Problem: No automated way to deploy a release to maven central
trevorbernard opened this issue · 2 comments
Create github workflow/action to automate deploying to maven central
I’m doing that for one of my project (RRD4J). I host the PGP keys in CircleCI, in a environment variable called SECRING_GPG_ASC_BASE64.
In the CircleCI publish sequence, I configured it with that code:
echo $SECRING_GPG_ASC_BASE64 | base64 --decode | gpg --batch --no-tty --import --yes
mvn -B deploy -Pgpgsign -Dgpg.keyname=4F069858
The gpgsign activates the maven-gpg-plugin.
The current configuration using https://oss.sonatype.org/service/local/staging/deploy/maven2/ as the repository is the correct one, publishing a non snapshot release is enough, it will be signed and published to the stagging repository at https://oss.sonatype.org.
So the command mvn release:clean release:prepare
should be kept, as it will prepare a commit and publish it. CircleCI will generate an artifact and publish it, without the need of doing mvn release:perform
locally.
Done in commit ba2fc72