Skip to content

Commit eecf436

Browse files
committed
build_release: Allow -b none --publish-nuget --no-cleanup --no-tarball
Useful when I forget to add `--publish-nuget` the first time and want to bypass the builds already packaged, and only publish the nupkgs.
1 parent 872c9bf commit eecf436

File tree

1 file changed

+40
-18
lines changed

1 file changed

+40
-18
lines changed

build-release.sh

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ publish_nuget_packages() {
106106

107107
godot_version=""
108108
templates_version=""
109+
do_cleanup=1
110+
make_tarball=1
109111
build_classical=1
110112
build_mono=1
111113
publish_nuget=0
@@ -117,7 +119,7 @@ while getopts "h?v:t:b:-:" opt; do
117119
echo
118120
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
119121
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
120-
echo " -b all|classical|mono (default: all)"
122+
echo " -b all|classical|mono|none (default: all)"
121123
echo " --publish-nuget (default: false)"
122124
echo
123125
exit 1
@@ -133,10 +135,19 @@ while getopts "h?v:t:b:-:" opt; do
133135
build_mono=0
134136
elif [ "$OPTARG" == "mono" ]; then
135137
build_classical=0
138+
elif [ "$OPTARG" == "none" ]; then
139+
build_classical=0
140+
build_mono=0
136141
fi
137142
;;
138143
-)
139144
case "${OPTARG}" in
145+
no-cleanup)
146+
do_cleanup=0
147+
;;
148+
no-tarball)
149+
make_tarball=0
150+
;;
140151
publish-nuget)
141152
publish_nuget=1
142153
;;
@@ -171,22 +182,30 @@ export godot_basename="Godot_v${godot_version}"
171182

172183
# Cleanup and setup
173184

174-
rm -rf ${webdir}
175-
rm -rf ${reldir}
176-
rm -rf ${tmpdir}
185+
if [ "${do_cleanup}" == "1" ]; then
186+
187+
rm -rf ${webdir}
188+
rm -rf ${reldir}
189+
rm -rf ${tmpdir}
177190

178-
mkdir -p ${webdir}
179-
mkdir -p ${reldir}
180-
mkdir -p ${reldir_mono}
181-
mkdir -p ${templatesdir}
182-
mkdir -p ${templatesdir_mono}
191+
mkdir -p ${webdir}
192+
mkdir -p ${reldir}
193+
mkdir -p ${reldir_mono}
194+
mkdir -p ${templatesdir}
195+
mkdir -p ${templatesdir_mono}
196+
197+
fi
183198

184199
# Tarball
185200

186-
zcat godot-${godot_version}.tar.gz | xz -c > ${reldir}/godot-${godot_version}.tar.xz
187-
pushd ${reldir}
188-
sha256sum godot-${godot_version}.tar.xz > godot-${godot_version}.tar.xz.sha256
189-
popd
201+
if [ "${make_tarball}" == "1" ]; then
202+
203+
zcat godot-${godot_version}.tar.gz | xz -c > ${reldir}/godot-${godot_version}.tar.xz
204+
pushd ${reldir}
205+
sha256sum godot-${godot_version}.tar.xz > godot-${godot_version}.tar.xz.sha256
206+
popd
207+
208+
fi
190209

191210
# Classical
192211

@@ -512,11 +531,14 @@ if [ "${build_mono}" == "1" ]; then
512531
cp SHA512-SUMS.txt ${basedir}/sha512sums/${godot_version}/mono/
513532
popd
514533

515-
# NuGet packages
516-
if [ "${publish_nuget}" == "1" ]; then
517-
echo "Publishing NuGet packages..."
518-
publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/*.nupkg
519-
fi
534+
fi
535+
536+
# NuGet packages
537+
538+
if [ "${publish_nuget}" == "1" ]; then
539+
540+
echo "Publishing NuGet packages..."
541+
publish_nuget_packages out/linux/x86_64/tools-mono/GodotSharp/Tools/nupkgs/*.nupkg
520542

521543
fi
522544

0 commit comments

Comments
 (0)