ReactiveSensors icon indicating copy to clipboard operation
ReactiveSensors copied to clipboard

Automate deployment to Maven Central

Open pwittchen opened this issue 1 year ago • 0 comments

Currently I'm performing deployments manually from my computer.

It should be possible to execute the following gradle commands on GH Actions CI:

  • uploadArchives
  • closeAndReleaseRepository

I've already added secrets to this repo via GH secret configuration.

Things to be done:

  • build project
  • add private gpg key to the project during the build (GPG_PRIVATE_KEY secret)
  • configure signing.keyId gradle param with GPG_KEY_ID secret
  • configure signing.password gradle param with GPG_PASSWORD secret
  • configure signing.secretKeyRingFile (it's defined locally on my machine) or a specific certificate (2nd point) - maybe this can be skipped, left empty or replaced with something else -> to be verified and tested
  • configure NEXUS_USERNAME gradle param with NEXUS_USERNAME secret
  • configure NEXUS_PASSWORD gradle param with NEXUS_PASSWORD secret
  • run uploadArchives gradle command
  • run closeAndReleaseRepository gradle command (this should be tested once command above will work because during tests we can upload and then remove artifacts without releasing them and when command above will fail, this one will fail too)

Notes:

  • Probably CI signing configuration will be a bit different than the local one. I think, the best idea would be to load private GPG Key into memory with GH action and then use in memory GPG Key with Key Id and Key Password and add appropriate gradle singing configuration according to the documentation. Then We can skip signing.secretKeyRingFile which is in the local setup.

References:

  • https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions
  • https://docs.gradle.org/current/userguide/signing_plugin.html

pwittchen avatar Mar 10 '23 11:03 pwittchen