Skip to content

Commit

Permalink
Split the release script to reusable steps
Browse files Browse the repository at this point in the history
  • Loading branch information
luontola committed Jul 10, 2013
1 parent fbcd35c commit 5147f27
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 30 deletions.
18 changes: 11 additions & 7 deletions BUILDING.txt
Expand Up @@ -32,17 +32,21 @@ http://www.scala-sbt.org/release/docs/Detailed-Topics/Cross-Build.html#publishin

Releasing a module for a new language version:

1. Edit specsy-scala_2.9/pom.xml and change the scala.version property to "2.9.3"
1. Checkout a branch from the original release's tag

2. Commit as "Release for Scala 2.9.3", but do NOT create a tag
git checkout -b v2.1.x v2.1.0

2. Edit specsy-scala_2.9/pom.xml and change the scala.version property to "2.9.3"

3. Commit as "Release for Scala 2.9.3", but do NOT create a tag

git commit -am "Release for Scala 2.9.3"
git push
git push origin HEAD

3. Deploy only that module:
4. Deploy only that module

cd specsy-scala_2.9
mvn clean deploy -Psonatype-oss-release
mvn nexus:staging-close -Dnexus.description="`git log --format=format:%s -1`"
../scripts/stage.sh "`git log --format=format:%s -1`"
../scripts/publish.sh "`git log --format=format:%s -1`"

4. Release the staging repository through https://oss.sonatype.org/
5. Release the staging repository through https://oss.sonatype.org/
18 changes: 18 additions & 0 deletions scripts/publish.sh
@@ -0,0 +1,18 @@
#!/bin/bash
set -eu
: ${1:? Usage: $0 DESCRIPTION}
DESCRIPTION="$1"
set -x

# TODO: release OSSRH and push to GitHub automatically
#mvn nexus-staging:release \
# --errors \
# -DaltStagingDirectory=staging \
# -DstagingDescription="$DESCRIPTION"

set +x
echo ""
echo "Done. Next steps:"
echo " open https://oss.sonatype.org/"
echo " git push origin HEAD"
echo " git push origin --tags"
27 changes: 4 additions & 23 deletions scripts/release-all.sh
@@ -1,6 +1,7 @@
#!/bin/bash
set -eu
: ${1:? Usage: $0 RELEASE_VERSION}
SCRIPTS=`dirname "$0"`

RELEASE_VERSION="$1"
if [[ ! "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
Expand All @@ -24,35 +25,15 @@ mvn versions:set \
--file parent/pom.xml
git add -u
git commit -m "Release $RELEASE_VERSION"

mvn clean deploy \
--errors \
-Psonatype-oss-release \
-DaltDeploymentRepository="staging::default::file:staging"

mvn nexus-staging:deploy-staged-repository \
--errors \
-DrepositoryDirectory=staging \
-DstagingDescription="Specsy $RELEASE_VERSION"

# TODO: release OSSRH and push to GitHub automatically
#mvn nexus-staging:release \
# --errors \
# -DaltStagingDirectory=staging \
# -DstagingDescription="Specsy $RELEASE_VERSION"

git tag -s -m "Specsy $RELEASE_VERSION" "v$RELEASE_VERSION"

$SCRIPTS/stage.sh "Specsy $RELEASE_VERSION"

mvn versions:set \
-DgenerateBackupPoms=false \
-DnewVersion="$NEXT_VERSION" \
--file parent/pom.xml
git add -u
git commit -m "Prepare for next development iteration"

set +x
echo ""
echo "Done. Next steps:"
echo " open https://oss.sonatype.org/"
echo " git push"
echo " git push --tags"
$SCRIPTS/publish.sh "Specsy $RELEASE_VERSION"
15 changes: 15 additions & 0 deletions scripts/stage.sh
@@ -0,0 +1,15 @@
#!/bin/bash
set -eu
: ${1:? Usage: $0 DESCRIPTION}
DESCRIPTION="$1"
set -x

mvn clean deploy \
--errors \
-Psonatype-oss-release \
-DaltDeploymentRepository="staging::default::file:staging"

mvn nexus-staging:deploy-staged-repository \
--errors \
-DrepositoryDirectory=staging \
-DstagingDescription="$DESCRIPTION"

0 comments on commit 5147f27

Please sign in to comment.