forked from cashapp/zipline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.sh
executable file
·57 lines (48 loc) · 1.31 KB
/
upload.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
AAR=duktape/build/outputs/aar/duktape-release.aar
SOURCES=duktape/build/libs/duktape-sources.jar
JAVADOC=duktape/build/libs/duktape-javadoc.jar
set -e
CLEAN=1
while [ $# -ne 0 ]; do
case "$1" in
"--no-clean" )
CLEAN=0
;;
* )
echo "Unknown command line argument '$1'."
exit 1
;;
esac
shift
done
if [ $CLEAN -ne 0 ]; then
./gradlew clean
fi
./gradlew build
if [ ! -f $AAR -o ! -f $SOURCES -o ! -f $JAVADOC ]; then
echo "Missing one of:\n* $AAR\n* $SOURCES\n* $JAVADOC"
exit 1
fi
POM=`cat upload-pom.xml`
if [[ "$POM" == *"-SNAPSHOT"* ]]; then
echo "Deploying to Sonatype OSS snapshots repo..."
TASK=org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file
REPO_URL=https://oss.sonatype.org/content/repositories/snapshots/
REPO_ID=sonatype-nexus-snapshots
EXTRAS="--settings=\".buildscript/settings.xml\""
else
echo "Deploying to Sonatype OSS release staging repo..."
TASK=org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file
REPO_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
REPO_ID=sonatype-nexus-staging
EXTRAS=""
fi
mvn $TASK $EXTRAS \
-DgeneratePom=false \
-DrepositoryId=$REPO_ID \
-Durl=$REPO_URL \
-DpomFile=upload-pom.xml \
-Dfile=$AAR \
-Djavadoc=$JAVADOC \
-Dsources=$SOURCES