11#! /bin/bash
22
33set -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+
107123godot_version=" "
108124templates_version=" "
109125do_cleanup=1
110126make_tarball=1
111127build_classical=1
112128build_mono=1
113129publish_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
173197fi
174198
175- export basedir=$( pwd)
176199export webdir=" ${basedir} /web/${templates_version} "
177200export reldir=" ${basedir} /releases/${godot_version} "
178201export reldir_mono=" ${reldir} /mono"
@@ -515,4 +538,13 @@ if [ "${publish_nuget}" == "1" ]; then
515538
516539fi
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+
518550echo " All editor binaries and templates prepared successfully for release"
0 commit comments