Skip to content

Commit

Permalink
Add a release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dinowernli committed Jul 31, 2016
1 parent 241ff8b commit a47cfcf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,3 +3,5 @@ bazel-*
.project
.idea*
project.iml
output
*.swp
36 changes: 36 additions & 0 deletions src/tools/build-release.sh
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -e

if [ ! -f WORKSPACE ]; then
echo "This must be invoked from the WORKSPACE root"
exit 1
fi

if [ ! $# -eq 1 ]; then
echo "Expected exacly one argument <version>, e.g., <0.1.0>"
exit 1
fi

JARNAME=java-grpc-prometheus-$1.jar
SRCJARNAME=java-grpc-prometheus-$1-src.jar

rm -rf output && mkdir output && chmod +x output

echo "Running all tests..."
bazel test src/...

echo "Building jar..."
bazel build //src/main/java/me/dinowernli/grpc/prometheus
cp ./bazel-bin/src/main/java/me/dinowernli/grpc/prometheus/libprometheus.jar ./output/$JARNAME

echo "Building srcjar..."
bazel build src/main/java/me/dinowernli/grpc/prometheus:libprometheus-src.jar
cp ./bazel-bin/src/main/java/me/dinowernli/grpc/prometheus/libprometheus-src.jar ./output/$SRCJARNAME

echo "Generating checksums..."
(cd output && sha1sum $JARNAME > $JARNAME.sha1 && sha1sum -c $JARNAME.sha1)
(cd output && md5sum $JARNAME > $JARNAME.md5 && md5sum -c $JARNAME.md5)

echo "Done"

0 comments on commit a47cfcf

Please sign in to comment.