@@ -88,19 +88,35 @@ sign_macos_template() {
88
88
ssh " ${OSX_HOST} " " rm -rf ${_macos_tmpdir} "
89
89
}
90
90
91
+ can_publish_nuget=0
92
+ if [ ! -z " ${NUGET_SOURCE} " ] && [ ! -z " ${NUGET_API_KEY} " ] && [[ $( type -P " dotnet" ) ]]; then
93
+ can_publish_nuget=1
94
+ else
95
+ echo " Disabling NuGet package publishing as config.sh does not define the required data (NUGET_SOURCE, NUGET_API_KEY), or dotnet can't be found in PATH."
96
+ fi
97
+
98
+ publish_nuget_packages () {
99
+ if [ $can_publish_nuget == 0 ]; then
100
+ return
101
+ fi
102
+ dotnet nuget push $1 --source " ${NUGET_SOURCE} " --api-key " ${NUGET_API_KEY} " --skip-duplicate
103
+ }
104
+
91
105
godot_version=" "
92
106
templates_version=" "
93
107
build_classical=1
94
108
build_mono=1
109
+ publish_nuget=0
95
110
96
- while getopts " h?v:t:b:" opt; do
111
+ while getopts " h?v:t:b:-: " opt; do
97
112
case " $opt " in
98
113
h|\? )
99
114
echo " Usage: $0 [OPTIONS...]"
100
115
echo
101
116
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
102
117
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
103
118
echo " -b all|classical|mono (default: all)"
119
+ echo " --publish-nuget (default: false)"
104
120
echo
105
121
exit 1
106
122
;;
@@ -117,6 +133,19 @@ while getopts "h?v:t:b:" opt; do
117
133
build_classical=0
118
134
fi
119
135
;;
136
+ -)
137
+ case " ${OPTARG} " in
138
+ publish-nuget)
139
+ publish_nuget=1
140
+ ;;
141
+ * )
142
+ if [ " $OPTERR " == 1 ] && [ " ${optspec: 0: 1} " != " :" ]; then
143
+ echo " Unknown option --${OPTARG} ."
144
+ exit 1
145
+ fi
146
+ ;;
147
+ esac
148
+ ;;
120
149
esac
121
150
done
122
151
@@ -481,6 +510,12 @@ if [ "${build_mono}" == "1" ]; then
481
510
cp SHA512-SUMS.txt ${basedir} /sha512sums/${godot_version} /mono/
482
511
popd
483
512
513
+ # NuGet packages
514
+ if [ " ${publish_nuget} " == " 1" ]; then
515
+ echo " Publishing NuGet packages..."
516
+ publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/* .nupkg
517
+ fi
518
+
484
519
fi
485
520
486
521
echo " All editor binaries and templates prepared successfully for release"
0 commit comments