forked from killbill/killbill-cybersource-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
41 lines (34 loc) · 1.11 KB
/
release.sh
File metadata and controls
41 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set -e
if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
echo 'Unable to release: make sure to use GNU tar'
exit 1
fi
if $(ruby -e'require "java"'); then
# Good
echo 'Detected JRuby'
else
echo 'Unable to release: make sure to use JRuby'
exit 1
fi
VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
exit 1
fi
echo 'Cleaning up'
rake killbill:clean ; rake build
echo 'Pushing the gem to Rubygems'
rake release
echo 'Building artifact'
rake killbill:package
ARTIFACT="$PWD/pkg/killbill-cybersource-$VERSION.tar.gz"
echo "Pushing $ARTIFACT to Maven Central"
mvn gpg:sign-and-deploy-file \
-DgroupId=org.kill-bill.billing.plugin.ruby \
-DartifactId=cybersource-plugin \
-Dversion=$VERSION \
-Dpackaging=tar.gz \
-DrepositoryId=ossrh-releases \
-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
-Dfile=$ARTIFACT \
-DpomFile=pom.xml