-
Notifications
You must be signed in to change notification settings - Fork 330
/
release.sh
executable file
·53 lines (47 loc) · 1.05 KB
/
release.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
main() {
echo "start config"
set -e
case $1 in
"config_maven") config_maven "$@" ;;
esac
}
config_maven(){
if [[ -z "${OSSRH_USERNAME}" || -z "${OSSRH_TOKEN}" ]]; then
die "ERROR: Variables OSSRH_USERNAME or OSSRH_TOKEN not defined"
exit 201
fi
if [[ -z "${GPG_KEYNAME}" || -z "${GPG_PASSPHRASE}" ]]; then
die "ERROR: Variables GPG_KEYNAME or GPG_PASSPHRASE not defined"
exit 201
fi
cat <<EOF> ./.github/workflows/settings.xml
<settings>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${GPG_KEYNAME}</gpg.keyname>
<gpg.passphrase>${GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
<servers>
<server>
<id>ossrh</id>
<username>${OSSRH_USERNAME}</username>
<password>${OSSRH_TOKEN}</password>
</server>
</servers>
</settings>
EOF
}
die() {
echo ""
echo "FATAL: $*" >&2
exit 1
}
main "$@"