Introduce release-creating script

This commit is contained in:
Greg Turnquist
2018-11-27 11:04:47 -06:00
parent 131f41844e
commit c96b9b4934
2 changed files with 41 additions and 8 deletions

View File

@@ -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 <version>` (like v2.0.1.RELEASE)
. Run `ci/create-release.sh <release version> <snapshot version>` 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=<user> PASSWORD=<encrypted password> mvn -Pdistribute,milestone,docs clean deploy`
* For a release: `USERNAME=<user> PASSWORD=<encrypted password> mvn -Pdistribute,release,docs clean deploy`
* For a release to maven central: `USERNAME=<user> PASSWORD=<nexus 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=<user> PASSWORD=<encrypted password> ./mvnw -Pdistribute,milestone,docs clean deploy`
* For a release: `USERNAME=<user> PASSWORD=<encrypted password> ./mvnw -Pdistribute,release,docs clean deploy`
* For a release to maven central: `USERNAME=<user> PASSWORD=<nexus 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.

25
ci/create-release.sh Executable file
View File

@@ -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"