Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 2.34 KB

release.md

File metadata and controls

90 lines (66 loc) · 2.34 KB

Artifacts are published to Maven Central through Sonatype staging area.

Only l10nmessages, l10nmessages-proc, l10nmessages-mvn-plugin, and l10nmessages-parent are published. Examples and integration tests jars are not (see the modules definition in the release profile and the default profile).

Sonatype documentation for publishing to Maven

Setup GPG keys

Make sure the GPG key is accessible locally to sign artifacts

Sonatype credential in your settings.xml

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>your-jira-id</username>
      <password>your-jira-pwd</password>
    </server>
  </servers>
</settings>

Prepare the commit for the release

Figure out the next version based on SemVer and Conventional Commits.

First make sure to be on the main branch, at latest version.

git checkout main
git fetch origin main
git reset --hard origin/main

Update this document with new version while doing the release.

export NEW_VERSION=1.0.5
mvn versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false
mvn versions:set-scm-tag -DnewTag=${NEW_VERSION} -DgenerateBackupPoms=false
./update-non-maven-versions.sh ${NEW_VERSION}
git commit -am "release: ${NEW_VERSION}"
git push
git tag ${NEW_VERSION}
git push origin ${NEW_VERSION}

Review commit and wait for CI to succeed!

Run the deploy

This will prompt for the GPG key

GPG_TTY=$(tty) mvn clean deploy -Prelease

Prepare next snapshot version

The next snapshot version is the release version with PATCH incremented by one and suffixed with "SNAPSHOT"

export NEW_VERSION=1.0.6-SNAPSHOT
mvn versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false
mvn versions:set-scm-tag -DnewTag=HEAD -DgenerateBackupPoms=false
./update-non-maven-versions.sh ${NEW_VERSION}
git commit -am "release: prepare next version ${NEW_VERSION}"
git push

Again, check CI succeed.

Publish the release

Go to Sonatype to review the staged deployment and release it to Maven Central.

In case of error while doing the release

To remove tags,

git tag -d ${NEW_VERSION}
git push --delete origin ${NEW_VERSION}