aboutsummaryrefslogtreecommitdiff
path: root/admin/build.sh
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-12-18 15:48:09 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-12-18 16:48:21 +1000
commiteeeb5fcfe3440b126680b0c54bd33e79cacd7724 (patch)
treef512709c4682ad6355c950770e9f8ec29a6977f5 /admin/build.sh
parent41ae70758a8c5b841a8b63445f82bd056a0a964f (diff)
downloadscala-async-eeeb5fcfe3440b126680b0c54bd33e79cacd7724.tar.gz
scala-async-eeeb5fcfe3440b126680b0c54bd33e79cacd7724.tar.bz2
scala-async-eeeb5fcfe3440b126680b0c54bd33e79cacd7724.zip
Support tag driven publishing
I started with: https://github.com/scala/scala-swing/commit/a6a8e1d77e#diff-3acefdae08499733e855dd23e1af933dR8 And: - modified the regex that derives the version from the tag to handle the fact we have the scala binary version appended to our tags - Removed unnessary cross building with Scala 2.11 (as this is on the 2.10.x branch) - generated a key pair for the async repository - added passphrase for that key, and sonatype credentials, to sensitive.sbt - encrypted the secrets with the travis key.
Diffstat (limited to 'admin/build.sh')
-rwxr-xr-xadmin/build.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/admin/build.sh b/admin/build.sh
new file mode 100755
index 0000000..f0692c6
--- /dev/null
+++ b/admin/build.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# prep environment for publish to sonatype staging if the HEAD commit is tagged
+
+# git on travis does not fetch tags, but we have TRAVIS_TAG
+# headTag=$(git describe --exact-match ||:)
+
+if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then
+ echo "Going to release from tag $TRAVIS_TAG!"
+ myVer=$(echo $TRAVIS_TAG | sed -e s/^v// | sed -e 's/_[0-9]*\.[0-9]*//')
+ publishVersion='set every version := "'$myVer'"'
+ extraTarget="publish-signed"
+
+ cat admin/gpg.sbt >> project/plugins.sbt
+ admin/decrypt.sh sensitive.sbt
+ (cd admin/ && ./decrypt.sh secring.asc)
+fi
+
+sbt ++$TRAVIS_SCALA_VERSION "$publishVersion" clean update compile test $extraTarget