This document describes how to release a new version of FriendlyID to Maven Central.
Before releasing, ensure you have:
- GitHub Repository Access: Write access to push tags
- GitHub Secrets Configured: The following secrets must be set in repository settings:
OSSRH_USERNAME- Sonatype OSSRH usernameOSSRH_TOKEN- Sonatype OSSRH token/passwordGPG_PRIVATE_KEY- GPG private key for artifact signingGPG_PASSPHRASE- Passphrase for the GPG key
Ensure your local repository is up to date and all tests pass:
git checkout master
git pull origin master
mvn clean installCreate an annotated tag with the version number (must start with v):
# For release version (e.g., 1.2.0)
git tag -a v1.2.0 -m "Release 1.2.0"
# For release candidate (e.g., 1.2.0-RC1)
git tag -a v1.2.0-RC1 -m "Release 1.2.0-RC1"Push the tag to trigger the automated release:
git push origin v1.2.0- Go to Actions tab in GitHub repository
- Watch the Release workflow execution
- The workflow will:
- Build all modules with the specified version
- Run all tests (can be skipped with
-DskipTests) - Sign artifacts with GPG
- Deploy to Maven Central (OSSRH)
- Create GitHub Release with artifacts
After successful deployment:
- Check Maven Central Repository
- Verify the GitHub Release was created with artifacts
- Test the release in a separate project:
<dependency>
<groupId>com.devskiller.friendly-id</groupId>
<artifactId>friendly-id</artifactId>
<version>1.2.0</version>
</dependency>Follow Semantic Versioning:
- MAJOR version (X.0.0): Incompatible API changes
- MINOR version (0.X.0): New functionality, backwards-compatible
- PATCH version (0.0.X): Backwards-compatible bug fixes
Examples:
v1.0.0- Initial releasev1.1.0- New feature (e.g., OpenFeign integration)v1.1.1- Bug fixv2.0.0- Breaking change (e.g., Java version upgrade)
Snapshot versions are built automatically on every push to master branch but are NOT deployed to Maven Central. They use the version defined in the <revision> property in the parent POM.
If automated release fails, you can release manually:
# Build and deploy to Maven Central
mvn clean deploy -P release -Drevision=1.2.0
# Create GitHub release manually through GitHub UIIf a release needs to be rolled back:
- Do NOT delete tags from Maven Central - versions are immutable
- Delete the GitHub tag and release:
git tag -d v1.2.0 git push origin :refs/tags/v1.2.0
- Release a new patch version with the fix
- Verify
GPG_PRIVATE_KEYsecret is correctly formatted (including-----BEGIN PGP PRIVATE KEY BLOCK-----) - Check
GPG_PASSPHRASEis correct - Ensure GPG key hasn't expired
- Verify
OSSRH_USERNAMEandOSSRH_TOKENare correct - Check OSSRH Status
- Review deployment logs in GitHub Actions
- Check all tests pass locally:
mvn clean install - Review GitHub Actions logs for specific error
- Ensure all dependencies are available in Maven Central
After successful release:
- Update
<revision>in parentpom.xmlto next SNAPSHOT version - Update version in
README.mdexamples (if needed) - Announce release (GitHub Discussions, Twitter, etc.)
- Close related GitHub issues/PRs
This project uses Maven CI-friendly versioning. The version is controlled by the ${revision} property:
- Default: Defined in parent
pom.xml(1.1.1-SNAPSHOT) - Override:
mvn -Drevision=X.Y.Z - Release: GitHub Actions sets version from git tag