GitHub Actions workflow automates publishing of a snapshot to Sonatype and releases the build after closing it to Maven Central.
Alternatively the workflow offers semi automation where it only publishes a snapshot to Sonatype where you can then manage your builds (you may need to log in first) -- read Manual Approach chapter
Steps to follow:
- Bump up Waltz version
- Create a PR with title containing phrase:
Execute Publish Job
if you want to only publish to Sonatype and manage the build then yourself (semi automation)Execute Publish Job, Execute Release Job
if you want to publish to Sonatype AND release the build to Maven Central (full automation)
- Get the PR approved and merge the code. The workflow will be executed automatically.
- Verify the workflow completed all its jobs. The workflow will typically run for a couple of minutes.
First, follow the instructions for installing GPG and creating a key file. You will need a version of GPG < 2.1.
If this is your first time releasing, you will need to create your JIRA account, and then create a JIRA ticket to request permission (for your account) to deploy artifacts to com.wepay
(our groupId). For more information visit OSSRH Guide.
Once you've done that, you should create a gradle.properties
file in your ~/.gradle
directory with the following properties to avoid specifying the same information every time you want to publish:
signing.keyId=<YourKeyId>
signing.password=<YourPublicKeyPassword>
signing.secretKeyRingFile=<PathToYourKeyRingFile>
ossrhUsername=<your-jira-id>
ossrhPassword=<your-jira-password>
After that, you should be able to run the ./gradlew publish
task successfully.
To publish a snapshot to Sonatype, just make sure that the version number ends in -SNAPSHOT
; to avoid doing so, just make sure it doesn't.
You can then manage your builds (you may need to log in first). If you want to publish a release, click Staging Repositories on the left sidebar under the Build Promotion header, find the repository you want to release. You will first need to Close the repository (This just prevents modification of repository). After that is completed, you will be able to Release the repository. (The location of these commands is near the top of the pane, accompanied by Drop, Refresh, and Promote). Your build should be published shortly afterward, although it may not be visible via Maven search for another couple of hours.