forked from bpodgursky/jbool_expressions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·51 lines (39 loc) · 1.24 KB
/
deploy
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
#!/bin/bash
set -eo pipefail
# Check the variables are set
if [ -z "$OSSRH_USERNAME" ]; then
echo "missing environment value: OSSRH_USERNAME" >&2
exit 1
fi
if [ -z "$OSSRH_PASSWORD" ]; then
echo "missing environment value: OSSRH_PASSWORD" >&2
exit 1
fi
if [ -z "$GPG_KEY_NAME" ]; then
echo "missing environment value: GPG_KEY_NAME" >&2
exit 1
fi
if [ -z "$OSSRH_GPG_SECRET_KEY_PASSWORD" ]; then
echo "missing environment value: OSSRH_GPG_SECRET_KEY_PASSWORD" >&2
exit 1
fi
if [ -z "$GITHUB_REF_TYPE" ]; then
echo "missing environment value: GITHUB_REF_TYPE" >&2
exit 1
fi
if [ -z "$GITHUB_REF_NAME" ]; then
echo "missing environment value: GITHUB_REF_NAME" >&2
exit 1
fi
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
echo "Setting pom.xml <version> to $GITHUB_REF_NAME"
release_tag="${GITHUB_REF_NAME##*-}"
echo "Publishing tag: ${release_tag}"
mvn --settings ".build/mvn-settings.xml" org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion="$release_tag" 1>/dev/null 2>/dev/null
else
echo "not on a tag -> keep snapshot version in pom.xml"
fi
echo "running deploy with modified pom"
export GPG_TTY=$(tty)
# Run the maven deploy steps
mvn deploy -P publish -DskipTests=true --settings ".build/mvn-settings.xml"