Merge build-templates.sh into build-release.sh

Having the two separated was a bit redundant.
This commit is contained in:
Rémi Verschelde
2020-05-07 14:45:52 +02:00
parent ee823e5177
commit 4e6b7462b6
3 changed files with 27 additions and 79 deletions

View File

@@ -21,14 +21,11 @@ this in a simple and user-friendly interface.
containers.
- Build with `build.sh` (check `--help` for usage).
- Package binaries with `build-release.sh` (check `--help` for usage).
- Build templates .tpz with `build-templates.sh` (check `--help` for
usage).
Example that builds Godot 3.2-stable Classical (not Mono):
```
./build.sh -v 3.2-stable -g 3.2-stable -b classical
./build-release.sh -v 3.2-stable -b classical
./build-templates.sh -v 3.2-stable -t 3.2.stable -b classical
./build-release.sh -v 3.2-stable -t 3.2.stable -b classical
```
Again, this is intended for release managers and usability is not the

View File

@@ -23,15 +23,17 @@ function sign {
}
godot_version=""
templates_version=""
build_classical=1
build_mono=1
while getopts "h?v:b:" opt; do
while getopts "h?v:t:b:" opt; do
case "$opt" in
h|\?)
echo "Usage: $0 [OPTIONS...]"
echo
echo " -v godot version (e.g: 3.1-alpha5) [mandatory]"
echo " -v godot version (e.g: 3.2-stable) [mandatory]"
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
echo " -b all|classical|mono (default: all)"
echo
exit 1
@@ -39,6 +41,9 @@ while getopts "h?v:b:" opt; do
v)
godot_version=$OPTARG
;;
t)
templates_version=$OPTARG
;;
b)
if [ "$OPTARG" == "classical" ]; then
build_mono=0
@@ -49,6 +54,11 @@ while getopts "h?v:b:" opt; do
esac
done
if [ -z "${godot_version}" -o -z "${templates_version}" ]; then
echo "Mandatory argument -v or -t missing."
exit 1
fi
export basedir=$(pwd)
export reldir="${basedir}/releases/${godot_version}"
export reldir_mono="${reldir}/mono"
@@ -221,6 +231,13 @@ if [ "${build_classical}" == "1" ]; then
cd uwp_template_x64_debug && zip -q -9 -r "${templatesdir}/uwp_x64_debug.zip" * && cd ..
rm -rf uwp_template_x64*
## Templates TPZ (Classical) ##
echo "${templates_version}" > ${templatesdir}/version.txt
pushd ${templatesdir}/..
zip -q -9 -r -D "${reldir}/${godot_basename}_export_templates.tpz" templates/*
popd
fi
# Mono
@@ -386,6 +403,13 @@ if [ "${build_mono}" == "1" ]; then
# Not supported yet.
## Templates TPZ (Mono) ##
echo "${templates_version}.mono" > ${templatesdir_mono}/version.txt
pushd ${templatesdir_mono}/..
zip -q -9 -r -D "${reldir_mono}/${godot_basename}_mono_export_templates.tpz" templates/*
popd
fi
echo "All editor binaries and templates prepared successfully for release"

View File

@@ -1,73 +0,0 @@
#!/bin/bash
set -e
godot_version=""
templates_version=""
build_classical=1
build_mono=1
while getopts "h?v:t:b:" opt; do
case "$opt" in
h|\?)
echo "Usage: $0 [OPTIONS...]"
echo
echo " -v public version (e.g. 3.2-stable) [mandatory]"
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
echo " -b all|classical|mono (default: all)"
echo
exit 1
;;
v)
godot_version=$OPTARG
;;
t)
templates_version=$OPTARG
;;
b)
if [ "$OPTARG" == "classical" ]; then
build_mono=0
elif [ "$OPTARG" == "mono" ]; then
build_classical=0
fi
;;
esac
done
if [ -z "${godot_version}" -o -z "${templates_version}" ]; then
echo "Mandatory argument -v or -t missing."
exit 1
fi
export basedir=$(pwd)
export reldir="${basedir}/releases/${godot_version}"
export reldir_mono="${reldir}/mono"
export tmpdir="${basedir}/tmp"
export templatesdir="${tmpdir}/templates"
export templatesdir_mono="${tmpdir}/mono/templates"
export godot_basename="Godot_v${godot_version}"
# Classical
if [ "${build_classical}" == "1" ]; then
echo "${templates_version}" > ${templatesdir}/version.txt
mkdir -p ${reldir}
pushd ${templatesdir}/..
zip -q -9 -r -D "${reldir}/${godot_basename}_export_templates.tpz" templates/*
popd
fi
# Mono
if [ "${build_mono}" == "1" ]; then
echo "${templates_version}.mono" > ${templatesdir_mono}/version.txt
mkdir -p ${reldir_mono}
pushd ${templatesdir_mono}/..
zip -q -9 -r -D "${reldir_mono}/${godot_basename}_mono_export_templates.tpz" templates/*
popd
fi
echo "Templates archives generated successfully"