Skip to content

Release instructions

Tero Saarni edited this page Nov 2, 2024 · 46 revisions

Preparations

Namespace fi.protonode was created in Maven Central for being able to publish packages. The request for reserving namespace was done via Jira issue https://issues.sonatype.org/browse/OSSRH-81823.

build.gradle was set up for publishing and signing, according to Maven Central requirements.

GPG key for signing packages must be available and published in GPG keyserver(s).

The GPG key ID and Sonatype OSSRH (OSS Repository Hosting) credentials must be configured in ~/.gradle/gradle.properties as following:

signing.gnupg.keyName=<KEY ID>   # Find id with "gpg --list-keys"
signing.gnupg.executable=gpg
ossrhUsername=<USER NAME>
ossrhPassword=<TOKEN>

Note that USER_NAME is not your login user name. Both user name and token are generated by following steps:

  1. Login to https://s01.oss.sonatype.org/.
  2. Click Profile in upper right corner of the page.
  3. Select User token from drop-down menu.

Release process

Publish snapshot

Snapshots can be published for testing the release process or for making unreleased package available for users to download for other reasons.

Follow the steps to publish a snapshot:

  1. Check that version number in gradle.properties has -SNAPSHOT suffix.
  2. Run gradle publish to deploy. GPG passphrase will be prompted for signing.

Snapshots are NOT synchronized to Maven Central Repository. Therefore, to use snapshots as dependency for a project, the snapshot repository URL must be added to the project. If using gradle it is done by adding following into build.gradle:

repositories {
    maven {
        url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
        mavenContent {
            snapshotsOnly()
        }
    }
}

Snapshot release will be available at https://s01.oss.sonatype.org/content/repositories/snapshots/ immediately. Same version can be published multiple times. Latter publish overwrites the previous version.

Publish release

⚠️ Warning: Package cannot be deleted or replaced after promoting it to release from staging!

Follow the steps to publish release to Maven Central https://repo1.maven.org/maven2/:

  1. Update the to-be-released version number in gradle.properties by removing -SNAPSHOT and commit that as to-be-released version: git add gradle.properties && git commit -m "Updated for release vX.Y.Z".
  2. Tag the release git tag vX.Y.Z.
  3. Run unit test gradle test.
  4. Run gradle publish to deploy. GPG passphrase will be prompted for signing.
  5. Login to https://s01.oss.sonatype.org/ to promote the upload to release.
  6. Click Staging repositories and check that uploaded files look OK. The package might take a while to appear in the staging list. If nothing got uploaded, re-generate user token in Profile and update ~/.gradle/gradle.properties.
  7. Click Close to proceed or Drop to delete the staging repository if something went wrong.
  8. Wait for the checks to run. Click Refresh to update the status. The package may disappear from staging repository for a while during wait.
  9. Click Release once successfully closed. Files will appear in this directory after a delay.
  10. Update gradle.properties for the next development version by stepping the version number and including -SNAPSHOT suffix. git add gradle.properties && git commit -m "Updated for next snapshot version".
  11. Push changes git push && git push --tags.
  12. Create github release by submitting form at https://github.com/tsaarni/java-certy/releases/new.

How long will it take for the package to be synchronized to Maven Central Repository? From the Jira ticket at the time when ordering the namespace:

Your component will be available to the public on Central https://repo1.maven.org/maven2/, typically within 30 minutes, though updates to https://search.maven.org can take up to four hours.

Links

Clone this wiki locally