From f82fd1c39aa1db708c8a7d510b75aeffb3d6e39e Mon Sep 17 00:00:00 2001 From: Martijn Dashorst Date: Mon, 25 Apr 2016 11:37:30 +0200 Subject: [PATCH] Updated release scripts across all versions - Changelog generator auto-commits changelog. - Release script uses staging git repository for build artifacts - Removed old obsolete build scripts --- build-changelog.sh | 22 +- build-versions.py | 2 +- patch-dashorst.sh | 283 ------------------- release-dashorst.sh | 621 ----------------------------------------- release-igor.sh | 124 --------- release-milestone.sh | 408 --------------------------- release.sh | 646 +++++++++++++++++++++++++++++++++++++++---- revert-release.sh | 55 ---- 8 files changed, 605 insertions(+), 1556 deletions(-) delete mode 100755 patch-dashorst.sh delete mode 100755 release-dashorst.sh delete mode 100755 release-igor.sh delete mode 100755 release-milestone.sh delete mode 100755 revert-release.sh diff --git a/build-changelog.sh b/build-changelog.sh index 2c9c3d97045..cb3dfbf7a8a 100755 --- a/build-changelog.sh +++ b/build-changelog.sh @@ -117,7 +117,7 @@ echo "done" echo " - merging release notes into changelog: \c" -echo "This file contains all changes done in releases for Apache Wicket 7.x. +echo "This file contains all changes done in releases for Apache Wicket $major_version.x. ======================================================================= $(cat /tmp/release-notes-$version.txt) @@ -127,21 +127,21 @@ $(tail -n +4 CHANGELOG-$major_version.x) " > /tmp/changelog-$version.txt cp /tmp/changelog-$version.txt CHANGELOG-$major_version.x -echo "done" +echo "done +" +git diff -echo " -The CHANGELOG-$major_version.x file has been updated. Please check the contents -and commit the changes. +echo "" -To see the status: +git add CHANGELOG-$major_version.x +git commit -m "Added CHANGELOG for release $version" - git status - git diff +echo " +The CHANGELOG-$major_version.x file has been updated and committed. -To add and commit the CHANGELOG: +To revert the changes to the CHANGELOG: - git add CHANGELOG-$major_version.x - git commit -m \"Added CHANGELOG for release $version + git reset HEAD^ --hard Have fun! " diff --git a/build-versions.py b/build-versions.py index 3f6ae085d29..cc36e94a55f 100755 --- a/build-versions.py +++ b/build-versions.py @@ -43,7 +43,7 @@ def getModulesFromParent(parentPomFile): addVersions(groupId, module) addVersions(groupId, "wicket-parent") -addVersions("org.apache.wicket.experimental.wicket8", "wicket-experimental") +addVersions("org.apache.wicket.experimental.wicket7", "wicket-experimental") getModulesFromParent("pom.xml") getModulesFromParent("wicket-native-websocket/pom.xml") diff --git a/patch-dashorst.sh b/patch-dashorst.sh deleted file mode 100755 index c6c80b02212..00000000000 --- a/patch-dashorst.sh +++ /dev/null @@ -1,283 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -log=/tmp/wicketrelease.out - -function fail { - echo "$1" - if [ -f $log ] ; then - echo "" - cat $log - fi - exit -} - -function setup_gpg { - gpg --armor --detach-sign --use-agent --sign pom.xml >& $log - if [ $? -ne 0 ] ; then - fail "ERROR: Unable to run gpg properly" - fi - - gpg --verify pom.xml.asc >& $log - if [ $? -ne 0 ]; then - rm pom.xml.asc - fail "It appears that you fat-fingered your GPG passphrase" - fi - rm pom.xml.asc -} - -function getVersion { - cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= -setns pom=http://maven.apache.org/POM/4.0.0 -xpath /pom:project/pom:version/text() -EOF -} - -# set -e - -echo "Apache Wicket Release script" -echo "----------------------------" -echo "Building a release for Apache Wicket." -echo "" -echo "This script assumes you are running on OS X, it hasn't been tested on any other" -echo "operating systems, and you can bet it won't work on Windows..." -echo "" -echo "REQUIREMENTS:" -echo "" -echo " - a pure JDK 6 environment, JDK 7 or newer won't cut it" -echo " - Maven 3.0.4 (older releases are b0rked, just don't bother)" -echo " - gpg, gpg-agent and pinentry for signing" -echo "" - -agentcount=`ps aux|grep gpg-agent|wc -l` - -current_version=$(getVersion) -major_version=$(expr $current_version : '\(.*\)\..*\..*\-SNAPSHOT') -minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-SNAPSHOT') -bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-SNAPSHOT') -version="$major_version.$minor_version.$bugfix_version" -current_version="$major_version.$minor_version.$((bugfix_version - 1))" - -echo "This script will create a patch release: Apache Wicket $version from $current_version" -echo "" -echo "Press enter to continue or CTRL-C to abort \c" -read - -branch="build/wicket-$version" -tag="wicket-$version" - -if [ "$agentcount" -ne 1 ]; then - echo "Found gpg-agent running, killing all agents" - killall gpg-agent -fi - -echo "" -echo "You are asked twice for your passphrase, one for scripting purposes, and one " -echo "for gpg-agent using pinentry such that gpg and git are able to sign things." -echo "" -echo "Enter your GPG passphrase (input will be hidden) \c" -stty_orig=`stty -g` -stty -echo -read passphrase -stty $stty_orig - -# test the GPGP passphrase to fail-fast: -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output pom.xml.asc --detach-sig pom.xml -gpg --verify pom.xml.asc -if [ $? -ne 0 ]; then - echo "It appears that you fat-fingered your GPG passphrase" - rm pom.xml.asc - exit $? -fi -rm pom.xml.asc - -echo "Starting new gpg-agent" -eval $(gpg-agent --daemon --pinentry-program $(which pinentry)) -if [ $? -ne 0 ] ; then - fail "ERROR: Unable to start gpg-agent" -fi - -setup_gpg - -echo "Ensuring we are starting from builds/wicket-$current_version" -# otherwise we can't remove a previous release branch that failed -git checkout build/wicket-$current_version - -echo "Cleaning up any release artifacts that might linger" -mvn -q release:clean - -echo "Removing previous release tag $tag (if exists)" -oldtag=`git tag -l |grep -e "$tag"|wc -l` -[ "$oldtag" -ne 0 ] && git tag -d $tag - -echo "Removing previous build branch $branch (if exists)" -oldbranch=`git branch |grep -e "$branch"|wc -l` -[ "$oldbranch" -ne 0 ] && git branch -D $branch - -git checkout -b $branch - -# Clear the current NOTICE.txt file -echo "Creating notice file." - -NOTICE=NOTICE -> $NOTICE -echo "Apache Wicket" >> $NOTICE -echo "Copyright 2006-$(date +%Y) The Apache Software Foundation" >> $NOTICE -echo "" >> $NOTICE -echo "This product includes software developed at" >> $NOTICE -echo "The Apache Software Foundation (http://www.apache.org/)." >> $NOTICE -echo "" >> $NOTICE -echo "This is an aggregated NOTICE file for the Apache Wicket projects included" >> $NOTICE -echo "in this distribution." >> $NOTICE -echo "" >> $NOTICE -echo "NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE" >> $NOTICE -echo " NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL" >> $NOTICE -echo " AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE." >> $NOTICE -echo "" >> $NOTICE - -# next concatenate all NOTICE files from sub projects to the root file -for i in `find . -name "NOTICE" -not -regex ".*/target/.*" -not -regex "./NOTICE"` -do - echo "---------------------------------------------------------------------------" >> $NOTICE - echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE - echo "---------------------------------------------------------------------------" >> $NOTICE - cat $i >> $NOTICE - echo >> $NOTICE -done - -echo "Fixing the quickstart to use the correct wicket version" -sed -e "s/\.*\<\/wicket\.version\>/\$version\<\/wicket.version\>/g" -i "" archetypes/quickstart/src/main/resources/archetype-resources/pom.xml - -echo "Committing changes" -git commit -am "Changes to notice files and quickstart archetype" - -# clean all projects -echo "Clean all projects" -mvn -q clean -Pall - -# package and assemble the release -echo "Prepare the release" -mvn --batch-mode release:prepare -DpreparationGoals="clean" -Dtag=$tag -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:prepare was not successful" -fi - -# this needs to be done before signing the tag otherwise the snapshot version -# is tagged -#echo "Rollback the last commit of the release plugin" -#git reset HEAD^ --hard >> $log - -#echo "Sign the tag" -# TODO the git tag --sign doesn't utilize the gpg-agent for some reason -#git tag --sign --force --message "Signed release tag for Apache Wicket $version" $tag >> $log - -echo "Performing the release using Maven" -mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform -DlocalCheckout=true -Dtag=$tag -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:perform was not successful" -fi - -echo "Create and sign the source tarballs" - -mkdir -p target/dist/binaries - -git archive --format=tar.gz --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.tar.gz $tag -git archive --format=zip --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.zip $tag -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.tar.gz -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.zip -gpg --print-md SHA1 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.md5 -gpg --print-md SHA1 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.md5 - -echo "Create and sign the binaries" -mkdir target/apache-wicket-$version-bin -pushd target/apache-wicket-$version-bin -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar\.asc" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -cp ../../LICENSE . -cp ../../README . -cp ../../NOTICE . -cp ../../CHANGELOG* . -popd - -pushd target - -tar cfz dist/binaries/apache-wicket-$version-bin.tar.gz apache-wicket-$version-bin -zip -r dist/binaries/apache-wicket-$version-bin.zip apache-wicket-$version-bin -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.tar.gz -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.zip -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.md5 -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.md5 -popd - -echo "Uploading release" -pushd target/dist -svn mkdir https://dist.apache.org/repos/dist/dev/wicket/$version -m "Create $version release staging area" -svn co --force --depth=empty https://dist.apache.org/repos/dist/dev/wicket/$version . -cp ../../CHANGELOG* . -svn add * -svn commit -m "Upload wicket-$version to staging area" -popd - -echo "" -echo "The release has been created. It is up to you to check if the release is up" -echo "to par, and perform the following commands yourself when you start the vote" -echo "to enable future development during the vote and after." -echo "" -echo "You can find the distribution in target/dist" -echo "" -echo " cd target/dist" -echo "" -echo "To verify all signatures:" -echo "" -echo " find . -name \"*.asc\" -exec gpg --verify {} \; " -echo "" -echo "To push the release branch to ASF git servers" -echo "" -echo " git push origin $branch:refs/heads/$branch" -echo "" - -echo "To move the release from staging to the mirrors:" -echo "" -echo " svn mv https://dist.apache.org/repos/dist/dev/wicket/$version https://dist.apache.org/repos/dist/release/wicket -m \"Upload release to the mirrors\"" -echo "" - -echo "To sign the release tag issue the following three commands: " -echo "" -echo " git checkout $tag" -echo " git tag --sign --force --message \"Signed release tag for Apache Wicket $version\" $tag >> $log" -echo " git checkout $branch" -echo "" - -mvn_version_to_replace="$major_version.$minor_version.1-SNAPSHOT" -next_dev_version="$major_version.$(expr $minor_version + 1).0-SNAPSHOT" - -echo "To renumber the next development iteration $next_dev_version:" -echo "" -echo " git checkout wicket-6.x" -echo " mvn release:update-versions --batch-mode" -echo " find . ! \\( -type d -name \"target\" -prune \\) -name pom.xml -exec sed -i \"\" -E \"s/$mvn_version_to_replace/$next_dev_version/g\" {} \\;" -# do the same for the original snapshot version, as our maven release -# plugin friend doesn't do that for us in the dependency management section -mvn_version_to_replace="$major_version.$minor_version.0-SNAPSHOT" -echo " find . ! \\( -type d -name \"target\" -prune \\) -name pom.xml -exec sed -i \"\" -E \"s/$mvn_version_to_replace/$next_dev_version/g\" {} \\;" -echo " git add \`find . ! \\( -type d -name \"target\" -prune \\) -name pom.xml\`" -echo " git commit -m \"Start next development version\"" -echo " git push" -echo "" diff --git a/release-dashorst.sh b/release-dashorst.sh deleted file mode 100755 index 981a43ceb1a..00000000000 --- a/release-dashorst.sh +++ /dev/null @@ -1,621 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# set -e -# set -x - -function fail { - >&2 echo "\033[31m -FATAL ERROR ------------ -$1 -\033[0m" - exit 1 -} - -function getJavaVersionFromPom { - cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= -setns pom=http://maven.apache.org/POM/4.0.0 -xpath /pom:project/pom:properties/pom:maven.compiler.source/text() -EOF -} - -function getProjectVersionFromPom { - cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= -setns pom=http://maven.apache.org/POM/4.0.0 -xpath /pom:project/pom:version/text() -EOF -} - -function getJdkToolchain { - xmllint ~/.m2/toolchains.xml --xpath "/toolchains/toolchain[provides/version/text() = '$JAVA_VERSION']/configuration/jdkHome/text()" -} - -function generate_promotion_script { - echo "Generating release promotion script 'promote-$version.sh'" -read -d '' script <<- EOF -#!/bin/sh -echo -n "Promoting release $version - -Actions about to be performed: ------------------------------- - -$(cat \$0 | tail -n +14) - ------------------------------------------- -Press enter to continue or CTRL-C to abort" - -read - -# push the build branch to ASF git repo - -git push origin $branch:refs/heads/$branch - -# push the release tag to ASF git repo - -git push origin $tag - -# promote the source distribution by moving it from the staging area to the release area - -svn mv https://dist.apache.org/repos/dist/dev/wicket/$version https://dist.apache.org/repos/dist/release/wicket -m "Upload release to the mirrors" - -mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-release -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release vote has passed" - -# Renumber the next development iteration $next_version: - -git checkout $GIT_BRANCH -mvn release:update-versions --batch-mode -find . ! \( -type d -name "target" -prune \) -name pom.xml -exec sed -i "" -E "s/$mvn_version_to_replace/$next_version/g" {} \; -find . ! \( -type d -name "target" -prune \) -name pom.xml -exec sed -i "" -E "s/$mvn_version_to_replace/$next_version/g" {} \; -git add \` find . ! \( -type d -name "target" -prune \) -name pom.xml \` -git commit -m "Start next development version" -git push - -echo "Remove the previous version of Wicket using this command: - - svn rm https://dist.apache.org/repos/dist/release/wicket/$previous_version -m \"Remove previous version from mirrors\" - -" -EOF - -echo "$script" > promote-$version.sh - chmod +x promote-$version.sh - git add promote-$version.sh -} - -function generate_rollback_script { - echo "Generating release rollback script 'revert-$version.sh'" -read -d '' script <<- EOF -#!/bin/sh -echo -n "Reverting release $version - -Actions about to be performed: ------------------------------- - -$(cat $0 | tail -n +14) - ------------------------------------------- -Press enter to continue or CTRL-C to abort" - -read - -# clean up local repository -git checkout $GIT_BRANCH -git branch -D $branch -git tag -d $tag - -# clean up staging repository -git push staging --delete refs/heads/$branch -git push staging --delete $tag - -# clean up staging dist area -svn rm https://dist.apache.org/repos/dist/dev/wicket/$version -m "Release vote has failed" - -# clean up staging maven repository -mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-drop -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release vote has failed" - -# clean up remaining release files -find . -name "*.releaseBackup" -exec rm {} \; -[ -f release.properties ] && rm release.properties - -EOF -echo "$script" > revert-$version.sh - - chmod +x revert-$version.sh - git add revert-$version.sh -} - -function generate_signatures_from_release { - - echo "======================================================================== - - The signatures for the source release artefacts: - - " > /tmp/release-$version-sigs.txt - - pushd target/dist > /dev/null - for i in apache-wicket*{zip,tar.gz} - do - echo "Signature for $i: - - $(cat $i.asc) - " >> /tmp/release-$version-sigs.txt - done - popd > /dev/null - - echo "======================================================================== - - CHANGELOG for $version: - " >> /tmp/release-$version-sigs.txt - - if [ -f "/tmp/release-notes-$version.txt" ] ; then - tail -n +4 /tmp/release-notes-$version.txt >> /tmp/release-$version-sigs.txt - else - awk "/Release Notes - Wicket - Version $version/{flag=1;next} /==================/{flag=0} flag { print }" CHANGELOG-$major_version.x >> /tmp/release-$version-sigs.txt - fi -} - -function generate_release_vote_email { - - echo "Generating Vote email" - - echo "This is a vote to release Apache Wicket $version - - Please download the source distributions found in our staging area - linked below. - - I have included the signatures for both the source archives. This vote - lasts for 72 hours minimum. - - [ ] Yes, release Apache Wicket $version - [ ] No, don't release Apache Wicket $version, because ... - - Distributions, changelog, keys and signatures can be found at: - - https://dist.apache.org/repos/dist/dev/wicket/$version - - Staging repository: - - https://repository.apache.org/content/repositories/$stagingrepoid/ - - The binaries are available in the above link, as are a staging - repository for Maven. Typically the vote is on the source, but should - you find a problem with one of the binaries, please let me know, I can - re-roll them some way or the other. - - Staging git repository data: - - Repository: $(git config --get remote.staging.url) - Branch: $branch - Release tag: $tag - - " > release-vote.txt - - cat /tmp/release-$version-sigs.txt >> release-vote.txt - git add release-vote.txt -} - -function generate_announce_email { - echo "The Apache Wicket PMC is proud to announce Apache Wicket $version! - - This release marks another minor release of Wicket $major_version. We - use semantic versioning for the development of Wicket, and as such no - API breaks are present breaks are present in this release compared to - $major_version.0.0. - - New and noteworthy - ------------------ - - - - Using this release - ------------------ - - With Apache Maven update your dependency to (and don't forget to - update any other dependencies on Wicket projects to the same version): - - - org.apache.wicket - wicket-core - $version - - - Or download and build the distribution yourself, or use our - convenience binary package - - * Source: http://www.apache.org/dyn/closer.cgi/wicket/$version - * Binary: http://www.apache.org/dyn/closer.cgi/wicket/$version/binaries - - Upgrading from earlier versions - ------------------------------- - - If you upgrade from $major_version.y.z this release is a drop in replacement. If - you come from a version prior to $major_version.0.0, please read our Wicket $major_version - migration guide found at - - * http://s.apache.org/wicket${major_version}migrate - - Have fun! - - — The Wicket team - - " > release-announce.txt - - cat /tmp/release-$version-sigs.txt >> release-announce.txt - git add release-announce.txt -} - -# the branch on which the code base lives for this version (master is -# always current development version) -GIT_BRANCH=master - -JAVA_VERSION=$(getJavaVersionFromPom) - -echo " -Apache Wicket Release script ----------------------------- -Building a release for Apache Wicket. - -This script assumes you are running on OS X, it hasn't been tested on any other -operating systems, and you can bet it won't work on Windows... - -REQUIREMENTS: - - - A Java version $JAVA_VERSION configured through the Maven toolchain - - Maven 3.3.0 (older releases are b0rked, just don't bother) - - gpg, gpg-agent and pinentry for signing -" - -if [ ! $( git config --get remote.staging.url ) ] ; then - fail " -No staging remote git repository found. The staging repository is used to temporarily -publish the build artifacts during the voting process. Since no staging repository is -available at Apache, it is best to use a git mirror on your personal github account. - -First fork the github Apache Wicket mirror (https://github.com/apache/wicket) and then -add the remote staging repository with the following command: - - $ git remote add staging git@github.com:/wicket.git - $ git fetch staging - $ git push staging - -This will bring the staging area in sync with the origin and the release script can -push the build branch and the tag to the staging area. -" -fi - -if [ ! -f ~/.m2/toolchains.xml ] ; then - fail " -Maven will load the Java $JAVA_VERSION environment from the toolchain specified in -~/.m2/toolchains.xml - -You don't have a toolchains.xml file in your .m2 folder. Please specify your -JDK's in the toolchains.xml file. -" -fi - -grep -q "$JAVA_VERSION" ~/.m2/toolchains.xml - -if [ $? -ne 0 ] ; then - fail " -Your ~/.m2/toolchains.xml file doesn't provide a Java $JAVA_VERSION toolchain. -" -fi - -echo "Java version for running Maven is: $(java -version 2>&1 | tail -n 2 | head -n 1) -Java used to compile (from toolchain) is: $(getJdkToolchain) -" - -agentcount=`ps aux|grep gpg-agent|wc -l` - -current_version=$(getProjectVersionFromPom) -major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*') -minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*') -bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-.*') -version="$major_version.$minor_version.0" - -default_version="$version" - -version= - -while [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+)?$ ]] -do - read -p "Version to release (default is $default_version): " -e t1 - if [ -n "$t1" ] - then - version="$t1" - else - version="$default_version" - fi -done - -# recalculate the version coordinates for the current release -major_version=$(expr $version : '\(.*\)\..*\..*') -minor_version=$(expr $version : '.*\.\(.*\)\..*') -bugfix_version=$(expr $version : '.*\..*\.\(.*\)') - -if [[ $version =~ .+-M[0-9]+ ]] -then - milestone_version=$(expr $version : '.*\..*-M\(.*\)') -fi - -if [ ! -z "$milestone_version" ] ; then - next_version="$major_version.0.0-SNAPSHOT" - previous_version="$major_version.0.0-SNAPSHOT" -else - next_version="$major_version.$(expr $minor_version + 1).0-SNAPSHOT" - previous_minor_version=$(expr $minor_version - 1) - if [ $previous_minor_version -lt 0 ] ; then - previous_version="$major_version.0.0-SNAPSHOT" - else - previous_version="$major_version.$(expr $minor_version - 1).0" - fi -fi - -# work around for versions upgrade (TODO maybe no longer necessary?) -mvn_version_to_replace="$major_version.$minor_version.1-SNAPSHOT" -mvn_version_to_replace2="$major_version.$minor_version.0-SNAPSHOT" - -# Check if the changelog has the issues this release - -grep -q "$version\$" CHANGELOG-$major_version.x -if [ $? -ne 0 ] ; then - fail "You have forgotten to add the closed tickets for Wicket $version to the CHANGELOG-$major_version.x file - -Use build-changelog.sh to add the release notes to the changelog. -" -fi - -git status --porcelain CHANGELOG-$major_version.x | grep -q "M" -if [ $? -eq 0 ] ; then - fail "You have changes in your workspace that have not been committed. - -$(git status) -" -fi - -echo "Cleaning up any release artifacts that might linger" -mvn -q release:clean - -log=$(pwd)/release.out - -if [ -f $log ] ; then - rm $log -fi - -branch="build/wicket-$version" -tag="wicket-$version" - -echo "# Release configuration for Wicket-$version -scm.tag=${tag} -" > release.properties - -./build-versions.py $version $next_version >> release.properties - -echo "Contents of the release properties generated for Maven: -------------------------------------------------------------------------------- -$(cat ./release.properties) -------------------------------------------------------------------------------- - -Writing detailed log to $log - -This script will release version: Apache Wicket $version and continue -development with $next_version - -Press enter to continue or CTRL-C to abort \c" -read - -echo "Ensuring we are starting from wicket-$major_version.x" -# otherwise we can't remove a previous release branch that failed -git checkout $GIT_BRANCH - -echo "Removing previous release tag $tag (if exists)" -oldtag=`git tag -l |grep -e "$tag"|wc -l` >> release.out -[ "$oldtag" -ne 0 ] && git tag -d $tag >> release.out - -echo "Removing previous build branch $branch (if exists)" -oldbranch=`git branch |grep -e "$branch"|wc -l` >> release.out -[ "$oldbranch" -ne 0 ] && git branch -D $branch >> release.out - -echo "Removing previous staging branch (if exists)" -git push staging --delete refs/heads/$branch >> release.out -git push staging --delete $tag >> release.out - - -echo "Creating release branch" -git checkout -b $branch >> release.out - -# Clear the current NOTICE.txt file -echo "Creating notice file." - -NOTICE=NOTICE - -echo "Apache Wicket -Copyright 2006-$(date +%Y) The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -This is an aggregated NOTICE file for the Apache Wicket projects included -in this distribution. - -NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE - NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL - AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE. -" > $NOTICE - -# next concatenate all NOTICE files from sub projects to the root file -for i in `find . -name "NOTICE" -not -regex ".*/target/.*" -not -regex "./NOTICE"` -do - echo "---------------------------------------------------------------------------" >> $NOTICE - echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE - echo "---------------------------------------------------------------------------" >> $NOTICE - cat $i >> $NOTICE - echo >> $NOTICE -done - -echo "Fixing the quickstart to use the correct wicket version" -sed -e "s/\.*\<\/wicket\.version\>/\$version\<\/wicket.version\>/g" -i "" archetypes/quickstart/src/main/resources/archetype-resources/pom.xml - -echo "Committing changes" -git commit -am "Changes to notice files and quickstart archetype" - -# clean all projects -echo "Clean all projects" -mvn -q clean -Pall - -# package and assemble the release -echo "Prepare the release" -mvn --batch-mode release:prepare -l $log -DpreparationGoals="clean" -Dtag=$tag -Papache-release,release -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:prepare was not successful" -fi - -echo "Performing the release using Maven" -mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform -DlocalCheckout=true -Dtag=$tag -Papache-release,release -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:perform was not successful" -fi - -# Determine the staging repository and close it after deploying the release to the staging area -stagingrepoid=$(mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | grep -v "CLOSED" | grep -Eo "(orgapachewicket-\d+)";) - -echo "Closing staging repository with id $stagingrepoid" -mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release has been built, awaiting vote" - -generate_promotion_script -generate_rollback_script - -echo "Create and sign the source tarballs" - -mkdir -p target/dist/binaries - -git archive --format=tar.gz --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.tar.gz $tag -git archive --format=zip --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.zip $tag -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.tar.gz -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.zip -gpg --print-md SHA1 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.md5 -gpg --print-md SHA1 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.md5 - -echo "Create and sign the binaries" -mkdir target/apache-wicket-$version-bin -pushd target/apache-wicket-$version-bin -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar\.asc" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -cp ../../LICENSE . -cp ../../README . -cp ../../NOTICE . -cp ../../CHANGELOG* . -popd - -pushd target - -tar cfz dist/binaries/apache-wicket-$version-bin.tar.gz apache-wicket-$version-bin -zip -r dist/binaries/apache-wicket-$version-bin.zip apache-wicket-$version-bin -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.tar.gz -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.zip -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.md5 -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.md5 -popd - -echo "Uploading release to dist.apache.org" -pushd target/dist -svn mkdir https://dist.apache.org/repos/dist/dev/wicket/$version -m "Create $version release staging area" -svn co --force --depth=empty https://dist.apache.org/repos/dist/dev/wicket/$version . -cp ../../CHANGELOG* . -svn add * -svn commit -m "Upload wicket-$version to staging area" -popd - -generate_signatures_from_release -generate_release_vote_email -generate_announce_email - -# Done with the tasks, now print out the next things the release manager -# needs to do - -pushd target/dist -find . -name "*.asc" -exec gpg --verify {} \; -popd - -echo " -The release has been created. It is up to you to check if the release is up -to par, and perform the following commands yourself when you start the vote -to enable future development during the vote and after. - -A vote email has been generated in release-vote.txt, you can copy/paste it using: - - cat release-vote.txt | pbcopy - -You can find the distribution in target/dist. - - -Failed release --------------- - -To rollback a release due to a failed vote or some other complication use: - - $ ./revert-$version.sh - -This will clean up the artfifacts from the staging areas, including Nexus, -dist.apache.org and the release branch and tag. - - -Successful release ------------------- - -Congratulations on the successful release vote! - -Use the release-announce.txt as a starter for the release announcement: - - cat release-announce.txt | pbcopy - -To promote the release after a successful vote, run: - - $ ./promote-$version.sh - -This will promote the Nexus staging repository to Maven Central, and move -the release artifacts from the staging area to dist.apache.org. It will -also sign the release tag and push the release branch to git.apache.org - -You can read this message at a later time using: - - $ cat release.txt - -Happy voting! -" > release.txt - -git add release.txt - -echo "Adding post-release scripts and vote/release email templates to build branch" -git commit -m "Added post-release scripts and vote/release email templates" - -echo "Signing the release tag" -git checkout $tag -git tag --sign --force --message \"Signed release tag for Apache Wicket $version\" $tag >> $log -git checkout $branch - -echo "Pushing build artifacts to the staging repository" -git push staging $branch:refs/heads/$branch - -echo "Pushing release tag to the staging repository" -git push staging $tag - -cat release.txt diff --git a/release-igor.sh b/release-igor.sh deleted file mode 100755 index 660dc2e9bf3..00000000000 --- a/release-igor.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -echo "Apache Wicket Release script" -echo "----------------------------" -echo "Building a release for Apache Wicket. We will need the passphrase for" -echo "GPG to sign the release." -echo "This program assumes you use a jdk 1.5 explicitly configured when" -echo "invoking the 'mvn5' Maven 2 command." -echo "" - -echo "Enter release version:" -read version - -echo "Enter your GPG passphrase (input will be hidden)" -stty_orig=`stty -g` -stty -echo -read passphrase -stty $stty_orig - -# test the GPGP passphrase to fail-fast: -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output pom.xml.asc --detach-sig pom.xml -gpg --verify pom.xml.asc -if [ $? -ne 0 ]; then - echo "It appears that you fat-fingered your GPG passphrase" - exit $? -fi -rm pom.xml.asc - -branch="build/wicket-$version" - -echo "Removing previous build branch $branch (if exists)" -oldbranch=`git branch |grep -e "$branch"|wc -l` -[ "$oldbranch" -ne 0 ] && git branch -D $branch - -echo "Switching to branch $branch" -git checkout -b $branch - -echo "Modifying poms with the new version: $version" -mvn5 versions:set -DnewVersion=$version -mvn5 versions:commit -find . -name "pom.xml" | xargs sed -i -e "s/1.5-SNAPSHOT/$version/g" -find . -name "pom.xml" | xargs sed -i -e "s/wicket\/trunk/wicket\/releases\/$version/g" - -echo "Committing changes" -git commit -am "modified poms for release $version" - -# Clear the current NOTICE.txt file -echo "Creating notice file." - -NOTICE=NOTICE -> $NOTICE -echo "Apache Wicket" >> $NOTICE -echo "Copyright 2006-$(date +%Y) The Apache Software Foundation" >> $NOTICE -echo "" >> $NOTICE -echo "This product includes software developed at" >> $NOTICE -echo "The Apache Software Foundation (http://www.apache.org/)." >> $NOTICE -echo "" >> $NOTICE -echo "This is an aggregated NOTICE file for the Apache Wicket projects included" >> $NOTICE -echo "in this distribution." >> $NOTICE -echo "" >> $NOTICE -echo "NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE" >> $NOTICE -echo " NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL" >> $NOTICE -echo " AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE." >> $NOTICE -echo "" >> $NOTICE - -# next concatenate all NOTICE files from sub projects to the root file -for i in `find . -name "NOTICE" -not -regex ".*/target/.*" -not -regex "./NOTICE"` -do - echo "---------------------------------------------------------------------------" >> $NOTICE - echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE - echo "---------------------------------------------------------------------------" >> $NOTICE - cat $i >> $NOTICE - echo >> $NOTICE -done - -echo "Committing changes" -git commit -am "changes to notice files" - -# prebuilding to work around javadoc generation problem -mvn5 clean install -DskipTests=true -mvn5 javadoc:jar - -# clean all projects -echo "Clean all projects" -mvn5 clean -Pall - -# package and assemble the release -echo "Package and assemble the release" -mvn5 -ff -Dgpg.passphrase="$passphrase" -Prelease deploy javadoc:javadoc assembly:attached $1 - -filename=`ls target/dist/apache-wicket*gz` -gpg --print-md MD5 $filename > $filename.md5 -gpg --print-md SHA1 $filename > $filename.sha -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output $filename.asc --detach-sig $filename - -filename=`ls target/dist/apache-wicket*zip` -gpg --print-md MD5 $filename > $filename.md5 -gpg --print-md SHA1 $filename > $filename.sha -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output $filename.asc --detach-sig $filename - -echo "Publishing build branch" -git push origin $branch:refs/heads/$branch - -echo "Uploading release" -svn export http://svn.apache.org/repos/asf/wicket/common/KEYS target/dist/KEYS -ssh people.apache.org mkdir public_html/wicket-$version -scp -r target/dist people.apache.org:public_html/wicket-$version - diff --git a/release-milestone.sh b/release-milestone.sh deleted file mode 100755 index 1cc45d23e4d..00000000000 --- a/release-milestone.sh +++ /dev/null @@ -1,408 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function fail { - echo "$1" - if [ -f $log ] ; then - echo "" - cat $log - fi - exit -} - -function getVersion { - cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= -setns pom=http://maven.apache.org/POM/4.0.0 -xpath /pom:project/pom:version/text() -EOF -} - -# set -e - -echo " -Apache Wicket Release script ----------------------------- -Building a release for Apache Wicket. - -This script assumes you are running on OS X, it hasn't been tested on any other -operating systems, and you can bet it won't work on Windows... - -REQUIREMENTS: - - - a pure JDK 7 environment, JDK 8 or newer won't cut it - - Maven 3.2.3 - - gpg, gpg-agent and pinentry for signing" - -export JAVA_HOME=`/usr/libexec/java_home -v1.7` -echo " -Current Java version is: $(java -version 2>&1 | tail -n 2 | head -n 1) -" - -agentcount=`ps aux|grep gpg-agent|wc -l` - -current_version=$(getVersion) -major_version=$(expr $current_version : '\(.*\)\..*\..*\-SNAPSHOT') -minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-SNAPSHOT') -bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-SNAPSHOT') - -read -p "What is the version to be released? " version - -current_milestone_version=$(expr $version : '.*-M(\d+)') - -#previous_version="$major_version.$(expr $minor_version - 1).0" -previous_version="7.0.0-M$(expr $current_milestone_version - 1)" - -log=/tmp/wicketrelease-$version.out - -branch="build/wicket-$version" -tag="wicket-$version" - -grep -q "$version\$" CHANGELOG-7.x -if [ $? -ne 0 ] ; then - fail " -You have forgotten to add the closed tickets for Wicket $version to the CHANGELOG-7.x file - -Go to https://issues.apache.org/jira/secure/ConfigureReleaseNote.jspa?projectId=12310561 -and export the issues to the changelog. -" -fi - -read -p " -This script will release version: Apache Wicket $version and continue -development with 7.0.0-SNAPSHOT - -Press enter to continue or CTRL-C to abort" - -# setup_gpg - -echo "Ensuring we are starting from wicket-7.x" -# otherwise we can't remove a previous release branch that failed -git checkout master - -echo "Cleaning up any release artifacts that might linger" -mvn -q release:clean - -echo "Removing previous release tag $tag (if exists)" -oldtag=`git tag -l |grep -e "$tag"|wc -l` -[ "$oldtag" -ne 0 ] && git tag -d $tag - -echo "Removing previous build branch $branch (if exists)" -oldbranch=`git branch |grep -e "$branch"|wc -l` -[ "$oldbranch" -ne 0 ] && git branch -D $branch - -git checkout -b $branch - -echo "# Release configuration for Wicket-$version -scm.tag=${tag} -" > release.properties - -./build-versions.py $version 7.0.0-SNAPSHOT >> release.properties - -cat ./release.properties - -# Clear the current NOTICE.txt file -echo "Creating notice file." - -NOTICE=NOTICE - -echo "Apache Wicket -Copyright 2006-$(date +%Y) The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -This is an aggregated NOTICE file for the Apache Wicket projects included -in this distribution. - -NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE - NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL - AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE. - -" > $NOTICE - -# next concatenate all NOTICE files from sub projects to the root file -for i in `find . -name "NOTICE" -not -regex ".*/target/.*" -not -regex "./NOTICE"` -do - echo "---------------------------------------------------------------------------" >> $NOTICE - echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE - echo "---------------------------------------------------------------------------" >> $NOTICE - cat $i >> $NOTICE - echo >> $NOTICE -done - -echo "Fixing the quickstart to use the correct wicket version" -sed -e "s/\.*\<\/wicket\.version\>/\$version\<\/wicket.version\>/g" -i "" archetypes/quickstart/src/main/resources/archetype-resources/pom.xml - -echo "Committing changes" -git commit -am "Changes to notice files and quickstart archetype" - -# clean all projects -echo "Clean all projects" -mvn -q clean -Pall - -# package and assemble the release -echo "Prepare the release" -mvn --batch-mode release:prepare -l $log -DpreparationGoals="clean" -Dtag=$tag -Papache-release -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:prepare was not successful" -fi - -# this needs to be done before signing the tag otherwise the snapshot version -# is tagged -#echo "Rollback the last commit of the release plugin" -#git reset HEAD^ --hard >> $log - -#echo "Sign the tag" -# TODO the git tag --sign doesn't utilize the gpg-agent for some reason -#git tag --sign --force --message "Signed release tag for Apache Wicket $version" $tag >> $log - -echo "Performing the release using Maven" -mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform -DlocalCheckout=true -Dtag=$tag -Papache-release -if [ $? -ne 0 ] ; then - fail "ERROR: mvn release:perform was not successful" -fi -stagingrepoid=$(mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | grep -v "CLOSED" | grep -Eo "(orgapachewicket-\d+)";) - - -echo "Closing staging repository with id $stagingrepoid" - -mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release has been built, awaiting vote" - - -echo "Create and sign the source tarballs" - -mkdir -p target/dist/binaries - -git archive --format=tar.gz --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.tar.gz $tag -git archive --format=zip --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.zip $tag -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.tar.gz -gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.zip -gpg --print-md SHA1 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.md5 -gpg --print-md SHA1 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.sha -gpg --print-md MD5 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.md5 - -echo "Create and sign the binaries" -mkdir target/apache-wicket-$version-bin -pushd target/apache-wicket-$version-bin -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-.*.[jw]ar\.asc" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; -cp ../../LICENSE . -cp ../../README . -cp ../../NOTICE . -cp ../../CHANGELOG* . -popd - -pushd target - -tar cfz dist/binaries/apache-wicket-$version-bin.tar.gz apache-wicket-$version-bin -zip -r dist/binaries/apache-wicket-$version-bin.zip apache-wicket-$version-bin -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.tar.gz -gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.zip -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.md5 -gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.sha -gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.md5 -popd - -echo "Uploading release" -pushd target/dist -svn mkdir https://dist.apache.org/repos/dist/dev/wicket/$version -m "Create $version release staging area" -svn co --force --depth=empty https://dist.apache.org/repos/dist/dev/wicket/$version . -cp ../../CHANGELOG* . -svn add * -svn commit -m "Upload wicket-$version to staging area" -popd - -echo "======================================================================== - -The signatures for the source release artefacts: - -" > /tmp/release-$version-sigs.txt - -pushd target/dist > /dev/null -for i in apache-wicket*{zip,tar.gz} -do - echo "Signature for $i: - -$(cat $i.asc) -" >> /tmp/release-$version-sigs.txt -done -popd > /dev/null - -echo "======================================================================== - -CHANGELOG for $version: -" >> /tmp/release-$version-sigs.txt - -awk "/Release Notes - Wicket - Version $version/{flag=1;next} /==================/{flag=0} flag { print }" CHANGELOG-7.x >> /tmp/release-$version-sigs.txt - - -echo "Generating Vote email" - -echo "This is a vote to release Apache Wicket $version - -Please download the source distributions found in our staging area -linked below. - -I have included the signatures for both the source archives. This vote -lasts for 72 hours minimum. - -[ ] Yes, release Apache Wicket $version -[ ] No, don't release Apache Wicket $version, because ... - -Distributions, changelog, keys and signatures can be found at: - - https://dist.apache.org/repos/dist/dev/wicket/$version - -Staging repository: - - https://repository.apache.org/content/repositories/$stagingrepoid/ - -The binaries are available in the above link, as are a staging -repository for Maven. Typically the vote is on the source, but should -you find a problem with one of the binaries, please let me know, I can -re-roll them some way or the other. - -" > release-vote.txt - -cat /tmp/release-$version-sigs.txt >> release-vote.txt - -echo "The Apache Wicket PMC is proud to announce Apache Wicket $version! - -We have released another milestone release for Apache Wicket 7. We aim -to finalise Wicket 7 over the coming months and request your help in -testing the new major version. - -Caveats -------- - -It is still a development version so expect API breaks to happen over -the course of the coming milestone releases. - -New and noteworthy ------------------- - - - -Semantic versioning -------------------- - -As we adopted semver Wicket 7 will be the first release since 6.0 where -we are able to refactor the API. We will continue to use semver when we -have made Wicket 7 final and maintain api compatibility between minor -versions of Wicket 7. - -Requirements ------------- - -Wicket 7 requires the following: - - - Java 7 - - Servlet 3 compatible container - -You can't mix wicket libraries from prior Wicket versions with Wicket 7. - -Migration guide ---------------- - -As usual we have a migration guide available online for people -migrating their applications to Wicket 7. We will continue to update -the guide as development progresses. If you find something that is not -in the guide, please update the guide, or let us know so we can update -the guide. - -You can find the guide here: http://s.apache.org/wicket7migrate - -Using this release ------------------- - -With Apache Maven update your dependency to (and don't forget to -update any other dependencies on Wicket projects to the same version): - - - org.apache.wicket - wicket-core - $version - - -Or download and build the distribution yourself, or use our -convenience binary package - - * Source: http://www.apache.org/dyn/closer.cgi/wicket/$version - * Binary: http://www.apache.org/dyn/closer.cgi/wicket/$version/binaries - -" > release-announce.txt - -cat /tmp/release-$version-sigs.txt >> release-announce.txt - -echo " -Have fun! - -— The Wicket team - -" >> release-announce.txt - -echo " -The release has been created. It is up to you to check if the release is up -to par, and perform the following commands yourself when you start the vote -to enable future development during the vote and after. - -A vote email has been generated in release-vote.txt, you can copy/paste it using: - - cat release-vote.txt | pbcopy - -An announce email has been generated in release-announce.txt, you can copy/paste it using: - - cat release-announce.txt | pbcopy - -You can find the distribution in target/dist - - cd target/dist - -To verify all signatures: - - find . -name \"*.asc\" -exec gpg --verify {} \; - -To push the release branch to ASF git servers - - git push origin $branch:refs/heads/$branch - -To move the release from staging to the mirrors: - - svn mv https://dist.apache.org/repos/dist/dev/wicket/$version https://dist.apache.org/repos/dist/release/wicket -m \"Upload release to the mirrors\" - -Remove previous version $previous_version from the mirrors - - svn rm https://dist.apache.org/repos/dist/release/wicket/$previous_version -m \"Remove previous version from mirrors\" - -To sign the release tag issue the following three commands: - - git checkout $tag - git tag --sign --force --message \"Signed release tag for Apache Wicket $version\" $tag >> $log - git checkout $branch - -To release the Maven artefacts: - - mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-release -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription=\"Release vote has passed\" - -Or in case of a failed vote, to drop the staging repository: - - mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-drop -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription=\"Release vote has failed\" -" > release.txt - -cat release.txt - diff --git a/release.sh b/release.sh index bfa7f651025..7c8e721c25c 100755 --- a/release.sh +++ b/release.sh @@ -13,72 +13,612 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -echo "Apache Wicket Release script" -echo "----------------------------" -echo "Building a release for Apache Wicket. We will need the passphrase for" -echo "GPG to sign the release." -echo "This program assumes you use a jdk 1.5 explicitly configured when" -echo "invoking the 'mvn5' Maven 2 command." -echo "" - -echo "Enter your GPG passphrase (input will be hidden)" -stty_orig=`stty -g` -stty -echo -read passphrase -stty $stty_orig - -# test the GPGP passphrase to fail-fast: -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output pom.xml.asc --detach-sig pom.xml -gpg --verify pom.xml.asc -if [ $? -ne 0 ]; then - echo "It appears that you fat-fingered your GPG passphrase" - exit $? + +# set -e +# set -x + +function fail { + >&2 echo "\033[31m +FATAL ERROR +----------- +$1 +\033[0m" + exit 1 +} + +function getJavaVersionFromPom { + cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= +setns pom=http://maven.apache.org/POM/4.0.0 +xpath /pom:project/pom:properties/pom:maven.compiler.source/text() +EOF +} + +function getProjectVersionFromPom { + cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= +setns pom=http://maven.apache.org/POM/4.0.0 +xpath /pom:project/pom:version/text() +EOF +} + +function getJdkToolchain { + xmllint ~/.m2/toolchains.xml --xpath "/toolchains/toolchain[provides/version/text() = '$JAVA_VERSION']/configuration/jdkHome/text()" +} + +function generate_promotion_script { + echo "Generating release promotion script 'promote-$version.sh'" +read -d '' script <<- EOF +#!/bin/sh +echo "Promoting release $version + +Actions about to be performed: +------------------------------ + +\$(cat \$0 | tail -n +14) + +------------------------------------------" + +read --prompt "Press enter to continue or CTRL-C to abort" + +# push the release tag to ASF git repo + +git push origin $tag + +# promote the source distribution by moving it from the staging area to the release area + +svn mv https://dist.apache.org/repos/dist/dev/wicket/$version https://dist.apache.org/repos/dist/release/wicket -m "Upload release to the mirrors" + +mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-release -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release vote has passed" + +# Renumber the next development iteration $next_version: + +git checkout $GIT_BRANCH +mvn release:update-versions --batch-mode +mvn versions:set versions:commit -DnewVersion=$next_version +git add \` find . ! \( -type d -name "target" -prune \) -name pom.xml \` + +echo " +Check the new versions and commit and push them to origin: + + git commit -m \"Start next development version\" + git push + +Remove the previous version of Wicket using this command: + + svn rm https://dist.apache.org/repos/dist/release/wicket/$previous_version -m \\\"Remove previous version from mirrors\\\" + +" +EOF + +echo "$script" > promote-$version.sh + chmod +x promote-$version.sh + git add promote-$version.sh +} + +function generate_rollback_script { + echo "Generating release rollback script 'revert-$version.sh'" +read -d '' script <<- EOF +#!/bin/sh +echo -n "Reverting release $version + +Actions about to be performed: +------------------------------ + +\$(cat \$0 | tail -n +14) + +------------------------------------------ +Press enter to continue or CTRL-C to abort" + +read + +# clean up local repository +git checkout $GIT_BRANCH +git branch -D $branch +git tag -d $tag + +# clean up staging repository +git push staging --delete refs/heads/$branch +git push staging --delete $tag + +# clean up staging dist area +svn rm https://dist.apache.org/repos/dist/dev/wicket/$version -m "Release vote has failed" + +# clean up staging maven repository +mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-drop -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release vote has failed" + +# clean up remaining release files +find . -name "*.releaseBackup" -exec rm {} \\; +[ -f release.properties ] && rm release.properties + +EOF +echo "$script" > revert-$version.sh + + chmod +x revert-$version.sh + git add revert-$version.sh +} + +function generate_signatures_from_release { + + echo "======================================================================== + + The signatures for the source release artefacts: + + " > /tmp/release-$version-sigs.txt + + pushd target/dist > /dev/null + for i in apache-wicket*{zip,tar.gz} + do + echo "Signature for $i: + + $(cat $i.asc) + " >> /tmp/release-$version-sigs.txt + done + popd > /dev/null + + echo "======================================================================== + + CHANGELOG for $version: + " >> /tmp/release-$version-sigs.txt + + if [ -f "/tmp/release-notes-$version.txt" ] ; then + tail -n +4 /tmp/release-notes-$version.txt >> /tmp/release-$version-sigs.txt + else + awk "/Release Notes - Wicket - Version $version/{flag=1;next} /==================/{flag=0} flag { print }" CHANGELOG-$major_version.x >> /tmp/release-$version-sigs.txt + fi +} + +function generate_release_vote_email { + + echo "Generating Vote email" + + echo " +This is a vote to release Apache Wicket $version + +Please download the source distributions found in our staging area +linked below. + +I have included the signatures for both the source archives. This vote +lasts for 72 hours minimum. + +[ ] Yes, release Apache Wicket $version +[ ] No, don't release Apache Wicket $version, because ... + +Distributions, changelog, keys and signatures can be found at: + + https://dist.apache.org/repos/dist/dev/wicket/$version + +Staging repository: + + https://repository.apache.org/content/repositories/$stagingrepoid/ + +The binaries are available in the above link, as are a staging +repository for Maven. Typically the vote is on the source, but should +you find a problem with one of the binaries, please let me know, I can +re-roll them some way or the other. + +Staging git repository data: + + Repository: $(git config --get remote.staging.url) + Branch: $branch + Release tag: $tag + +" | tail -n+2 > release-vote.txt + + cat /tmp/release-$version-sigs.txt >> release-vote.txt + git add release-vote.txt +} + +function generate_announce_email { + echo " +The Apache Wicket PMC is proud to announce Apache Wicket $version! + +Apache Wicket is an open source Java component oriented web application +framework that powers thousands of web applications and web sites for +governments, stores, universities, cities, banks, email providers, and +more. You can find more about Apache Wicket at https://wicket.apache.org + +This release marks another minor release of Wicket $major_version. We +use semantic versioning for the development of Wicket, and as such no +API breaks are present breaks are present in this release compared to +$major_version.0.0. + + New and noteworthy + ------------------ + +Using this release +------------------ + +With Apache Maven update your dependency to (and don't forget to +update any other dependencies on Wicket projects to the same version): + + + org.apache.wicket + wicket-core + $version + + +Or download and build the distribution yourself, or use our +convenience binary package + + * Source: http://www.apache.org/dyn/closer.cgi/wicket/$version + * Binary: http://www.apache.org/dyn/closer.cgi/wicket/$version/binaries + +Upgrading from earlier versions +------------------------------- + +If you upgrade from $major_version.y.z this release is a drop in replacement. If +you come from a version prior to $major_version.0.0, please read our Wicket $major_version +migration guide found at + + * http://s.apache.org/wicket${major_version}migrate + +Have fun! + +— The Wicket team + +" | tail -n+2 > release-announce.txt + + cat /tmp/release-$version-sigs.txt >> release-announce.txt + git add release-announce.txt +} + +# the branch on which the code base lives for this version (master is +# always current development version) +GIT_BRANCH=wicket-7.x + +JAVA_VERSION=$(getJavaVersionFromPom) + +echo " +Apache Wicket Release script +---------------------------- +Building a release for Apache Wicket. + +This script assumes you are running on OS X, it hasn't been tested on any other +operating systems, and you can bet it won't work on Windows... + +REQUIREMENTS: + + - A Java version $JAVA_VERSION configured through the Maven toolchain + - Maven 3.3.0 (older releases are b0rked, just don't bother) + - gpg, gpg-agent and pinentry for signing +" + +if [ ! $( git config --get remote.staging.url ) ] ; then + fail " +No staging remote git repository found. The staging repository is used to temporarily +publish the build artifacts during the voting process. Since no staging repository is +available at Apache, it is best to use a git mirror on your personal github account. + +First fork the github Apache Wicket mirror (https://github.com/apache/wicket) and then +add the remote staging repository with the following command: + + $ git remote add staging git@github.com:/wicket.git + $ git fetch staging + $ git push staging + +This will bring the staging area in sync with the origin and the release script can +push the build branch and the tag to the staging area. +" +fi + +if [ ! -f ~/.m2/toolchains.xml ] ; then + fail " +Maven will load the Java $JAVA_VERSION environment from the toolchain specified in +~/.m2/toolchains.xml + +You don't have a toolchains.xml file in your .m2 folder. Please specify your +JDK's in the toolchains.xml file. +" fi -rm pom.xml.asc + +grep -q "$JAVA_VERSION" ~/.m2/toolchains.xml + +if [ $? -ne 0 ] ; then + fail " +Your ~/.m2/toolchains.xml file doesn't provide a Java $JAVA_VERSION toolchain. +" +fi + +echo "Java version for running Maven is: $(java -version 2>&1 | tail -n 2 | head -n 1) +Java used to compile (from toolchain) is: $(getJdkToolchain) +" + +agentcount=`ps aux|grep gpg-agent|wc -l` + +current_version=$(getProjectVersionFromPom) +major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*') +minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*') +bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-.*') +version="$major_version.$minor_version.0" + +default_version="$version" + +version= + +while [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-M[0-9]+)?$ ]] +do + read -p "Version to release (default is $default_version): " -e t1 + if [ -n "$t1" ] + then + version="$t1" + else + version="$default_version" + fi +done + +# recalculate the version coordinates for the current release +major_version=$(expr $version : '\(.*\)\..*\..*') +minor_version=$(expr $version : '.*\.\(.*\)\..*') +bugfix_version=$(expr $version : '.*\..*\.\(.*\)') + +if [[ $version =~ .+-M[0-9]+ ]] +then + milestone_version=$(expr $version : '.*\..*-M\(.*\)') +fi + +if [ ! -z "$milestone_version" ] ; then + next_version="$major_version.0.0-SNAPSHOT" + previous_version="$major_version.0.0-SNAPSHOT" +else + next_version="$major_version.$(expr $minor_version + 1).0-SNAPSHOT" + previous_minor_version=$(expr $minor_version - 1) + if [ $previous_minor_version -lt 0 ] ; then + previous_version="$major_version.0.0-SNAPSHOT" + else + previous_version="$major_version.$(expr $minor_version - 1).0" + fi +fi + +# work around for versions upgrade (TODO maybe no longer necessary?) +mvn_version_to_replace="$major_version.$minor_version.1-SNAPSHOT" +mvn_version_to_replace2="$major_version.$minor_version.0-SNAPSHOT" + +# Check if the changelog has the issues this release + +grep -q "$version\$" CHANGELOG-$major_version.x +if [ $? -ne 0 ] ; then + fail "You have forgotten to add the closed tickets for Wicket $version to the CHANGELOG-$major_version.x file + +Use build-changelog.sh to add the release notes to the changelog. +" +fi + +git status --porcelain CHANGELOG-$major_version.x | grep -q "M" +if [ $? -eq 0 ] ; then + fail "You have changes in your workspace that have not been committed. + +$(git status) +" +fi + +echo "Cleaning up any release artifacts that might linger" +mvn -q release:clean + +log=$(pwd)/release.out + +if [ -f $log ] ; then + rm $log +fi + +branch="build/wicket-$version" +tag="rel/wicket-$version" + +echo "# Release configuration for Wicket-$version +scm.tag=${tag} +" > release.properties + +./build-versions.py $version $next_version >> release.properties + +echo "Contents of the release properties generated for Maven: +------------------------------------------------------------------------------- +$(cat ./release.properties) +------------------------------------------------------------------------------- + +Writing detailed log to $log + +This script will release version: Apache Wicket $version and continue +development with $next_version + +Press enter to continue or CTRL-C to abort \c" +read + +echo "Ensuring we are starting from wicket-$major_version.x" +# otherwise we can't remove a previous release branch that failed +git checkout $GIT_BRANCH + +echo "Removing previous release tag $tag (if exists)" +oldtag=`git tag -l |grep -e "$tag"|wc -l` >> release.out +[ "$oldtag" -ne 0 ] && git tag -d $tag >> release.out + +echo "Removing previous build branch $branch (if exists)" +oldbranch=`git branch |grep -e "$branch"|wc -l` >> release.out +[ "$oldbranch" -ne 0 ] && git branch -D $branch >> release.out + +echo "Removing previous staging branch (if exists)" +git push staging --delete refs/heads/$branch >> release.out +git push staging --delete $tag >> release.out + + +echo "Creating release branch" +git checkout -b $branch >> release.out # Clear the current NOTICE.txt file echo "Creating notice file." NOTICE=NOTICE -> $NOTICE -echo "Apache Wicket" >> $NOTICE -echo "Copyright 2006-$(date +%Y) The Apache Software Foundation" >> $NOTICE -echo "" >> $NOTICE -echo "This product includes software developed at" >> $NOTICE -echo "The Apache Software Foundation (http://www.apache.org/)." >> $NOTICE -echo "" >> $NOTICE -echo "This is an aggregated NOTICE file for the Apache Wicket projects included" >> $NOTICE -echo "in this distribution." >> $NOTICE -echo "" >> $NOTICE -echo "NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE" >> $NOTICE -echo " NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL" >> $NOTICE -echo " AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE." >> $NOTICE -echo "" >> $NOTICE + +echo "Apache Wicket +Copyright 2006-$(date +%Y) The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This is an aggregated NOTICE file for the Apache Wicket projects included +in this distribution. + +NB: DO NOT ADD LICENSES/NOTICES/ATTRIBUTIONS TO THIS FILE, BUT IN THE + NOTICE FILE OF THE CORRESPONDING PROJECT. THE RELEASE PROCEDURE WILL + AUTOMATICALLY INCLUDE THE NOTICE IN THIS FILE. +" > $NOTICE # next concatenate all NOTICE files from sub projects to the root file for i in `find . -name "NOTICE" -not -regex ".*/target/.*" -not -regex "./NOTICE"` do - echo "---------------------------------------------------------------------------" >> $NOTICE - echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE - echo "---------------------------------------------------------------------------" >> $NOTICE - cat $i >> $NOTICE - echo >> $NOTICE + echo "---------------------------------------------------------------------------" >> $NOTICE + echo "src/"$i | sed -e "s/\/src.*//g" >> $NOTICE + echo "---------------------------------------------------------------------------" >> $NOTICE + cat $i >> $NOTICE + echo >> $NOTICE done +echo "Fixing the quickstart to use the correct wicket version" +sed -e "s/\.*\<\/wicket\.version\>/\$version\<\/wicket.version\>/g" -i "" archetypes/quickstart/src/main/resources/archetype-resources/pom.xml + +echo "Committing changes" +git commit -am "Changes to notice files and quickstart archetype" + # clean all projects echo "Clean all projects" -mvn5 clean -Pall +mvn -q clean -Pall # package and assemble the release -echo "Package and assemble the release" -mvn5 -ff -Dgpg.passphrase="$passphrase" -Prelease deploy javadoc:javadoc assembly:attached $1 - -filename=`ls target/dist/apache-wicket*gz` -gpg --print-md MD5 $filename > $filename.md5 -gpg --print-md SHA1 $filename > $filename.sha -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output $filename.asc --detach-sig $filename - -filename=`ls target/dist/apache-wicket*zip` -gpg --print-md MD5 $filename > $filename.md5 -gpg --print-md SHA1 $filename > $filename.sha -echo "$passphrase" | gpg --passphrase-fd 0 --armor --output $filename.asc --detach-sig $filename +echo "Prepare the release" +mvn --batch-mode release:prepare -X -l $log -DpreparationGoals="clean" -Dtag=$tag -Papache-release,release +if [ $? -ne 0 ] ; then + fail "ERROR: mvn release:prepare was not successful" +fi + +echo "Performing the release using Maven" +mvn -Dgpg.passphrase="$passphrase" -ff -l $log release:perform -DlocalCheckout=true -Dtag=$tag -Papache-release,release +if [ $? -ne 0 ] ; then + fail "ERROR: mvn release:perform was not successful" +fi + +# Determine the staging repository and close it after deploying the release to the staging area +stagingrepoid=$(mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-list -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https | grep -v "CLOSED" | grep -Eo "(orgapachewicket-\d+)";) + +echo "Closing staging repository with id $stagingrepoid" +mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-close -DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org -DserverId=apache.releases.https -Ddescription="Release has been built, awaiting vote" + +generate_promotion_script +generate_rollback_script + +echo "Create and sign the source tarballs" + +mkdir -p target/dist/binaries + +git archive --format=tar.gz --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.tar.gz $tag +git archive --format=zip --prefix=apache-wicket-$version/ -o target/dist/apache-wicket-$version.zip $tag +gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.tar.gz +gpg --armor --detach-sign --use-agent --sign target/dist/apache-wicket-$version.zip +gpg --print-md SHA1 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.sha +gpg --print-md MD5 target/dist/apache-wicket-$version.tar.gz > target/dist/apache-wicket-$version.tar.gz.md5 +gpg --print-md SHA1 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.sha +gpg --print-md MD5 target/dist/apache-wicket-$version.zip > target/dist/apache-wicket-$version.zip.md5 + +echo "Create and sign the binaries" +mkdir target/apache-wicket-$version-bin +pushd target/apache-wicket-$version-bin +find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-[^/]*.[j]ar" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; +find ../checkout ! \( -type d -name "WEB-INF" -prune \) -regex ".*wicket-[^/]*.[j]ar\.asc" ! -name "*-sources*" ! -name "*-javadoc*" ! -name "*wicket-archetype-quickstart*" ! -name "wicket-common-tests*" -type f -exec cp {} . \; +cp ../../LICENSE . +cp ../../README . +cp ../../NOTICE . +cp ../../CHANGELOG* . +popd + +pushd target + +tar cfz dist/binaries/apache-wicket-$version-bin.tar.gz apache-wicket-$version-bin +zip -r dist/binaries/apache-wicket-$version-bin.zip apache-wicket-$version-bin +gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.tar.gz +gpg --armor --detach-sign --use-agent --sign dist/binaries/apache-wicket-$version-bin.zip +gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.sha +gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.tar.gz > dist/binaries/apache-wicket-$version-bin.tar.gz.md5 +gpg --print-md SHA1 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.sha +gpg --print-md MD5 dist/binaries/apache-wicket-$version-bin.zip > dist/binaries/apache-wicket-$version-bin.zip.md5 +popd + +echo "Uploading release to dist.apache.org" +pushd target/dist +svn mkdir https://dist.apache.org/repos/dist/dev/wicket/$version -m "Create $version release staging area" +svn co --force --depth=empty https://dist.apache.org/repos/dist/dev/wicket/$version . +cp ../../CHANGELOG* . +svn add * +svn commit -m "Upload wicket-$version to staging area" +popd + +generate_signatures_from_release +generate_release_vote_email +generate_announce_email + +# Done with the tasks, now print out the next things the release manager +# needs to do + +pushd target/dist +find . -name "*.asc" -exec gpg --verify {} \; +popd + +echo " +The release has been created. It is up to you to check if the release is up +to par, and perform the following commands yourself when you start the vote +to enable future development during the vote and after. + +A vote email has been generated in release-vote.txt, you can copy/paste it using: + + cat release-vote.txt | pbcopy + +You can find the distribution in target/dist. + + +Failed release +-------------- + +To rollback a release due to a failed vote or some other complication use: + + $ ./revert-$version.sh + +This will clean up the artfifacts from the staging areas, including Nexus, +dist.apache.org and the release branch and tag. + + +Successful release +------------------ + +Congratulations on the successful release vote! + +Use the release-announce.txt as a starter for the release announcement: + + cat release-announce.txt | pbcopy + +To promote the release after a successful vote, run: + + $ ./promote-$version.sh + +This will promote the Nexus staging repository to Maven Central, and move +the release artifacts from the staging area to dist.apache.org. It will +also sign the release tag and push the release branch to git.apache.org + +You can read this message at a later time using: + + $ cat release.txt + +Happy voting! +" > release.txt + +git add release.txt + +echo "Adding post-release scripts and vote/release email templates to build branch" +git commit -m "Added post-release scripts and vote/release email templates" + +echo "Signing the release tag" +git checkout $tag +git tag --sign --force --message \"Signed release tag for Apache Wicket $version\" $tag >> $log +git checkout $branch + +echo "Pushing build artifacts to the staging repository" +git push staging $branch:refs/heads/$branch + +echo "Pushing release tag to the staging repository" +git push staging $tag + +cat release.txt diff --git a/revert-release.sh b/revert-release.sh deleted file mode 100755 index c45def2470f..00000000000 --- a/revert-release.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function getVersion { - cat << EOF | xmllint --noent --shell pom.xml | grep content | cut -f2 -d= -setns pom=http://maven.apache.org/POM/4.0.0 -xpath /pom:project/pom:version/text() -EOF -} - -# current_version=$(getVersion) -# major_version=$(expr $current_version : '\(.*\)\..*\..*\-SNAPSHOT') -# minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-SNAPSHOT') -# bugfix_version=$(expr $current_version : '.*\..*\.\(.*\)-SNAPSHOT') -# version="$major_version.$minor_version.0" - -read -p "Revert which version? " version - -echo "" -echo "Revert the current in-progress release for apache-wicket-$version" - -echo "" -echo "Press enter to continue or CTRL-C to abort \c" -read - -branch="build/wicket-$version" -tag="wicket-$version" - -git checkout master -git branch -D $branch -git tag -d $tag - -svn rm https://dist.apache.org/repos/dist/dev/wicket/$version -m "Reverting release $version" - -find . -name "*.releaseBackup" -exec rm {} \; -rm release.properties release.txt > /dev/null - -echo "" -echo "Cleaned up the release" -echo "" -echo "Don't forget to drop the Maven staging repository" -echo ""