-
Make sure to increase version number in build.gradle.kts
-
Document changes
-
Do the release
# adjust to te path of your working copy
export KALASIM_HOME=/c/brandl_data/projects/scheduling/kalasim
cd $KALASIM_HOME
# run tests
./gradlew check
trim() { while read -r line; do echo "$line"; done; }
kalasim_version='v'$(grep '^version' ${KALASIM_HOME}/build.gradle.kts | cut -f3 -d' ' | tr -d '"' | trim)
echo "new version is $kalasim_version !"
if [[ $kalasim_version == *"-SNAPSHOT" ]]; then
echo "ERROR: Won't publish snapshot build $kalasim_version!" 1>&2
exit 1
fi
## skip this step when doing a preview release
kscript src/test/kotlin/org/kalasim/misc/PatchVersion.kts "${kalasim_version:1}"
git status
git commit -am "${kalasim_version} release"
#git diff --exit-code || echo "There are uncomitted changes"
git tag "${kalasim_version}"
git push origin
git push origin --tags
### Build and publish the binary release to maven central
#./gradlew publishToMavenLocal
./gradlew publishMavenPublicationToMavenLocal
#./gradlew publish # does not seem to include publishing to sonatype
#./gradlew publishToSonatype closeSonatypeStagingRepository
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
https://getstream.io/blog/publishing-libraries-to-mavencentral-2021/