forked from akka/akka-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-maven.sh
executable file
·71 lines (65 loc) · 1.74 KB
/
publish-maven.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
set -e
if [ -z "${SDK_VERSION}" ];
then
echo "expected SDK_VERSION to be set"
exit 1
fi
if [ -z "${SONATYPE_USERNAME}" ];
then
echo "expected SONATYPE_USERNAME to be set"
exit 1
fi
if [ -z "${SONATYPE_PASSWORD}" ];
then
echo "expected SONATYPE_PASSWORD to be set"
exit 1
fi
if [ -z "${PGP_PASSPHRASE}" ];
then
echo "expected PGP_PASSPHRASE to be set"
exit 1
fi
if [ -z "${PGP_SECRET}" ];
then
echo "expected PGP_SECRET to be set"
exit 1
fi
if [[ $SDK_VERSION == *SNAPSHOT* ]]
then
echo "This version ["$SDK_VERSION"] is a snapshot. Not publishing to Maven Central Portal"
exit 0
fi
cd akka-javasdk-maven
../.github/patch-maven-versions.sh
# create Maven settings.xml with credentials for repository publishing
# info
mkdir -p ~/.m2
cat <<EOF >~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>central</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>central</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.passphrase><![CDATA[${PGP_PASSPHRASE}]]></gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
EOF
# import the artefact signing key
echo "${PGP_SECRET}" | base64 -d | gpg --import --batch
# Maven deploy with profile `release`
# mvn --quiet --batch-mode --activate-profiles release deploy
mvn --batch-mode --activate-profiles release -Dskip.docker=true -Dskip.deploy=false deploy