Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new deployment pipeline #806

Merged
merged 5 commits into from Oct 20, 2023
Merged

Conversation

johnjaylward
Copy link
Contributor

@johnjaylward johnjaylward commented Oct 16, 2023

What problem does this code solve?

Adds a new pipeline that should allow automatic deployment to Maven Central when a new GitHub Release is published. This reduces the manual work involved in creating and publishing releases. If the project needs to be handed off again, this should also reduce the hand-off steps.

The pipeline was based on GitHub documentation and StackOverflow how to use GPG in Workflows and modified slightly for our use-case as defined in the Wiki Release document and Sonatype release documentation. In order for the pipeline to run successfully, The following Secrets will need to be added to the workflow configuration in the GitHub Project. Only the project maintainer can do this configuration.

Secrets names:

  • OSSRH_USERNAME set to your Sonatype Jira username
  • OSSRH_TOKEN set to your Sonatype Jira password/token
  • MAVEN_GPG_PRIVATE_KEY set to your GPG private key: gpg --list-secret-keys --keyid-format LONG to get the Key ID, then gpg --export-secret-keys --armor {your_keyId} to get the actual key that goes in the secret
  • MAVEN_GPG_PASSPHRASE set to the passphrase needed to use your private key

Risks

Low. If the auto-deployment fails, manual deployment can still be done. Corrections could be made on-the-fly, or could be queued up for the next release.

Changes to the API?

No

Will this require a new release?

No

Should the documentation be updated?

It would be a good idea.

Does it break the unit tests?

No

Was any code refactored in this commit?

No

Review status

APPROVED

Starting 3-day comment window

@johnjaylward johnjaylward marked this pull request as ready for review October 16, 2023 22:28
@johnjaylward
Copy link
Contributor Author

Here's an example of a failed deployment because I did not set up the secrets:
https://github.com/johnjaylward/JSON-java/actions/runs/6539967284

@johnjaylward
Copy link
Contributor Author

Related to #801

@stleary stleary merged commit 82c8f48 into stleary:master Oct 20, 2023
5 checks passed
@johnjaylward johnjaylward deleted the deploymentPipeline branch October 20, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants