Skip to content

Latest commit

 

History

History
89 lines (67 loc) · 3.1 KB

CONTRIBUTING.md

File metadata and controls

89 lines (67 loc) · 3.1 KB

Contributing

We welcome contributions to this project by both internal and external parties

How to contribute

  1. Fork the repository into your own github account (external contributors) or create a new branch (internal contributions)
  2. Make your code changes
  3. Ensure you commit message is descriptive as it acts as the changelog. Mark any breaking changes with BREAKING. Include a rectification strategy if you introduce a BREAKING change.
  4. Ensure README.md is updated if needed. All code samples in the README should have corresponding (actual sames) in the various docs/ folders
  5. Submit a pull request back to master branch (or the branch you are contributing to)
  6. Ensure Github Actions build passes
  7. Await reviews
  8. Once merged into master a SNAPSHOT build will be available for consumption immediately here. Note that snapshots change regularly and cannot be relied upon.
  9. Hard Releases will be made once enough features have been added.

Building

./gradlew spotlessApply shadowJar

Deploying locally and deploying to .m2/

./gradlew publishToMavenLocal

Ensure you add mavenLocal() to your consuming project and the dependency verison matches that in your local .m2 folder

Uploading to maven central

see .github/workflows/release.yml

Uploading to maven central (manually)

Gradle release plugin is not currently working so this is a manual process at the moment.

Setup GPG on your machine

  1. copy the GPG Private key into a file private.key
  2. run
gpg --import private.key
cd ~/.gnupg
gpg -k
gpg --export-secret-key YOUR_KEY_ID > ~/.gnupg/secring.gpg

Preparing

  1. Create a tag X.X.X
  2. Update gradle.properties and remove -SNAPSHOT from the version number
  3. Check this file into version control and push the branch to the remote
  4. run
export SONAR_USERNAME=?
export SONAR_PASSWORD=?
export GPG_KEY_ID=?
export GPG_KEY_PASSPHRASE=?
export PATH_TO_SECRING_GPG=~/.gnupg/secring.gpg

# I found shadowed classes are not included if you don't separate the gradle operations
./gradlew clean shadowJar
./gradlew signArchives uploadArchives -PossrhUsername=${SONAR_USERNAME} -PossrhPassword=${SONAR_PASSWORD} -Psigning.keyId=${GPG_KEY_ID} -Psigning.password=${GPG_KEY_PASSPHRASE} -Psigning.secretKeyRingFile=${PATH_TO_SECRING_GPG}

Releasing Full Tutorial

  1. Login to SONAR (https://oss.sonatype.org)
  2. Click 'Staging Repositories' and locate the 'iogithuborigin-energy' bundle
  3. Review artifacts are correct in the 'Content' tab
  4. Press the 'Close' and give a reason such as "Jack Matthews - Confirmed artifacts are OK"
  5. Wait for about 1 min and press the 'Refresh button', if all sanity checks have passed the 'Release' button will be visible
  6. Press the 'Release' button and give a reason for releasing
  7. Objects should be available in about 10 min (Longer for search.maven.org)

Cleanup

  1. Checkout master branch
  2. Increment version number in gradle.properties
  3. Create pull request for merge