If you release for the first time or you forgot the details, long version is recommended, which explains the steps in a great detail. Otherwise you can use TLDR version.
- Increase versions of the necessary library artifacts to be released, including the BOM version.
You can use
checkIfUpdateNeededSinceCurrentTagGradle task to help you figure out what artifacts have changed since the last release. - Update
CHANGELOGfor the new release. - Create a tag for the new BOM version in the required format.
- Run
prePublishCheckGradle task and fix all found issues if needed. - If you were forced to do some changes, fast-forward the tag to the latest commit. Don't forget
to update
CHANGELOGif you were forced to publish more artifacts. - Push the tag. CI will perform necessary checks and publish all artifacts.
Once you are ready to publish new versions of library artifacts, you can start publishing process:
- First you need to increase the versions of all artifacts that need to be published, including the BOM version.
You can use
checkIfUpdateNeededSinceCurrentTagGradle task to figure out what modules have changed since the last release. It does not have to mean that everything needs to be released, because you might want to release some artifacts in separate releases. However, there might be situations, when you will be forced to publish some updates, if some artifacts depend on possible internal ones that changed. In this case you will need to publish new versions of all artifacts that depend on internal ones to preserve binary compatibility between modules, because internal modules might contain breaking changes to public API. It might be difficult to ensure that proper artifacts are updated when necessary due to these kind of dependencies and that's whyverifyPublishingtask exists, that fails if there might be some potentially incompatible dependencies and forces you to publish relevant artifacts together in a single BOM. - Update
CHANGELOGfor the new release. - Create a tag for the new BOM version in the required format. You can optionally run
verifyBomVersionGradle task to verify, if the version of the BOM artifact is synced with the version in the tag. - Run
prePublishCheckGradle task. This task performs same checks as CI during a deployment, so you can fix issues faster by running this quicker local verification before pushing to the remote. This task performs usual checks like building modules, running tests, etc., but it also runs all custom check tasks mentioned above, so you actually do not have to run them separately and you can just runprePublishCheck, but it is good to know that they exist and what they do. You can also find more detailed information in the documentation comments in the source code of those tasks. - If you were forced to do some changes, fast-forward the tag to the latest commit. Don't forget
to update
CHANGELOGif you were forced to publish more artifacts. - Push the tag. CI will perform necessary checks and publish all artifacts.