The release process uses the gradle-git plugin to
create a version derived from the current tag and pushes that to master. If no tag is present then
0.0.1
will be used as the starting version.
For publishing we use the build-info-extractor-gradle plugin to push our artifacts to Artifactory.
Invoking the release
task on the root project will execute clean
, build
, and
bintrayUpload
on each sub-project so it's NOT necessary to put those tasks on
the command line when releasing.
The gradle-git plugin provides a handful of stages one can use but for simplicities sake we will focus only on 2: SNAPSHOT and final.
SNAPSHOT is the value set by default for the releaseStage property. This allows the release process to be
kicked over and over again, whilst not having to worry about committing changes, and publishes
artifacts to libs-snapshot-local
.
final is the value one should use for releaseStage property when you're ready to do a production release.
This will get your artifacts published to libs-release-local
.
Other stages are available but lets stick to using these 2 if only to keep the process stupid-simple.
The gradle-git plugin provides 3 scopes to be used to
denote which portion of the version
(using semver format) to bump.
major is the value one should use for releaseScope if you want to bump the major portion of
the version. For example: ./gradlew release -PreleaseStage=final -PreleaseScope=major
will turn
version 1.0.0
to 2.0.0
.
minor is the value one should use for releaseScope if you want to bump the minor portion of
the version. For example: ./gradlew release -PreleaseStage=final -PreleaseScope=minor
will turn
version 0.1.0
to 0.2.0
.
patch is the value one should use for releaseScope if you want to bump the patch portion of
the version. For example: ./gradlew release -PreleaseStage=final -PreleaseScope=patch
will turn
version 0.0.1
to 0.0.2
.
Development Releases will have their artifacts published to the libs-snapshot-local
repository with a generated version based off of the latest tag.
- Execute:
./gradlew release
Production Releases will have their artifacts published to the libs-release-local
repository with a generated version based off of the latest tag.
- Ensure
releaseUsername
andreleasePassword
are valid and set within your~/.gradle/gradle.properties
file. - Ensure all changes are committed otherwise an exception from
gradle-git
will be thrown. - Execute:
./gradlew release -PreleaseStage=final
// Optional: -PreleaseScope=[major|minor|patch]. Default ispatch
.