From c96b9b4934c584c7552b6957c0b0512c5e3c1ca3 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Tue, 27 Nov 2018 11:04:47 -0600 Subject: [PATCH] Introduce release-creating script --- README.adoc | 24 ++++++++++++++++-------- ci/create-release.sh | 25 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 8 deletions(-) create mode 100755 ci/create-release.sh diff --git a/README.adoc b/README.adoc index 2f134e0..ccc5d84 100644 --- a/README.adoc +++ b/README.adoc @@ -92,17 +92,25 @@ You can also import the project into your IDE. To do a release (.RELEASE, .RC?, .M?): . Check in all changes and ensure there are no edited files. -. Bump up the version in `pom.xml` to the desired version and commit the change. -. `git tag ` (like v2.0.1.RELEASE) +. Run `ci/create-release.sh ` e.g. (`ci/create-release.sh 2.1.1.RELEASE 2.1.2.BUILD-SNAPSHOT`) + +To deploy your changes: + +. `git checkout release` . Execute a maven deploy. -* For a milestone: `USERNAME= PASSWORD= mvn -Pdistribute,milestone,docs clean deploy` -* For a release: `USERNAME= PASSWORD= mvn -Pdistribute,release,docs clean deploy` -* For a release to maven central: `USERNAME= PASSWORD= mvn -Pdistribute,gpg,central clean deploy -s settings.xml` (At SonaType, *close* and *releases*) -. Bump up the version in `pom.xml` again to the next BUILD-SNAPSHOT. -. Commit the change. +* For a milestone: `USERNAME= PASSWORD= ./mvnw -Pdistribute,milestone,docs clean deploy` +* For a release: `USERNAME= PASSWORD= ./mvnw -Pdistribute,release,docs clean deploy` +* For a release to maven central: `USERNAME= PASSWORD= ./mvnw -Pdistribute,gpg,central clean deploy -s settings.xml` (At SonaType, *close* and *releases*) +. Inspect handiwork at https://repo.spring.io/ or https://oss.sonatype.org/#stagingRepositories + +Once everything has been verified, push everything to origin: + . `git push` . `git push --tags` -. Inspect handiwork at https://repo.spring.io/ or https://oss.sonatype.org/#stagingRepositories +. `git checkout master` +. `git push` + +CI server should build the new snapshot and automatically deploy to artifactory. NOTE: A word about reference documentation. Based upon https://github.com/spring-projects/spring-framework/wiki/gradle-build-and-release-faq#user-content-wiki-docs_schema_dist_publication[this], the `distribute` profile contains an artifactory property that is applied to the ZIP file generated by the `docs` profile. A CRON job will scoop up the zipped up docs and unpack them inside the target location. diff --git a/ci/create-release.sh b/ci/create-release.sh new file mode 100755 index 0000000..1aa456b --- /dev/null +++ b/ci/create-release.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -euo pipefail + +RELEASE=$1 +SNAPSHOT=$2 + +git branch -f release +git checkout release + +# Bump up the version in pom.xml to the desired version and commit the change +./mvnw versions:set -DnewVersion=$RELEASE -DgenerateBackupPoms=false +git add . +git commit --message "Releasing Spring Session MongoDB v$RELEASE" + +# Tag the release +git tag -s v$RELEASE -m "v$RELEASE" + +# Bump up the version in pom.xml to the next snapshot +git checkout master +./mvnw versions:set -DnewVersion=$SNAPSHOT -DgenerateBackupPoms=false +git add . +git commit --message "Continue development on v$SNAPSHOT" + +