Skip to content

Commit 9d40b39

Browse files
committed
Publish Android library from the main build-release script
1 parent 02e092c commit 9d40b39

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

build-release.sh

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
set -e
4+
export basedir=$(pwd)
45

56
# Config
67

@@ -104,23 +105,39 @@ publish_nuget_packages() {
104105
done
105106
}
106107

108+
can_publish_maven=0
109+
if [ ! -d "${basedir}/deps/keystore" ]; then
110+
echo "Disabling Android library publishing as ${basedir}/deps/keystore doesn't exist."
111+
else
112+
can_publish_maven=1
113+
fi
114+
115+
publish_maven_library() {
116+
if [ $can_publish_maven == 0 ]; then
117+
return
118+
fi
119+
# FIXME: Might be worth reworking the script to make it all sudo-safe and use appropriate users throughout.
120+
sudo sh build-android/upload-mavencentral.sh
121+
}
122+
107123
godot_version=""
108124
templates_version=""
109125
do_cleanup=1
110126
make_tarball=1
111127
build_classical=1
112128
build_mono=1
113129
publish_nuget=0
130+
publish_maven=0
114131

115-
while getopts "h?v:t:b:n-:" opt; do
132+
while getopts "h?v:t:b:p:n-:" opt; do
116133
case "$opt" in
117134
h|\?)
118135
echo "Usage: $0 [OPTIONS...]"
119136
echo
120137
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
121138
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
122139
echo " -b build target: all|classical|mono|none (default: all)"
123-
echo " -n publish nuget packages (default: false)"
140+
echo " -p publish target: all|nuget|maven|none (default: none)"
124141
echo " --no-cleanup disable deleting pre-existing output folders (default: false)"
125142
echo " --no-tarball disable generating source tarball (default: false)"
126143
echo
@@ -142,8 +159,15 @@ while getopts "h?v:t:b:n-:" opt; do
142159
build_mono=0
143160
fi
144161
;;
145-
n)
146-
publish_nuget=1
162+
p)
163+
if [ "$OPTARG" == "nuget" ]; then
164+
publish_nuget=1
165+
elif [ "$OPTARG" == "maven" ]; then
166+
publish_maven=1
167+
elif [ "$OPTARG" == "all" ]; then
168+
publish_nuget=1
169+
publish_maven=1
170+
fi
147171
;;
148172
-)
149173
case "${OPTARG}" in
@@ -172,7 +196,6 @@ elif [[ "{$templates_version}" == *"-"* ]]; then
172196
exit 1
173197
fi
174198

175-
export basedir=$(pwd)
176199
export webdir="${basedir}/web/${templates_version}"
177200
export reldir="${basedir}/releases/${godot_version}"
178201
export reldir_mono="${reldir}/mono"
@@ -515,4 +538,13 @@ if [ "${publish_nuget}" == "1" ]; then
515538

516539
fi
517540

541+
# Godot Android library
542+
543+
if [ "${publish_maven}" == "1" ]; then
544+
545+
echo "Publishing Android library to MavenCentral..."
546+
publish_maven_library
547+
548+
fi
549+
518550
echo "All editor binaries and templates prepared successfully for release"

clean-release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
rm -rf releases tmp web
1+
#!/bin/bash
22

3+
rm -rf releases tmp web

clean.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
#!/bin/bash
2+
13
rm -rf godot*.tar.gz mono-glue out releases tmp web
24
git status

0 commit comments

Comments
 (0)