Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,41 @@ case "$choice" in
esac
export GODOT_VERSION_STATUS="${status}"

if [ "${skip_git_checkout}" == 0 ]; then
git clone https://github.com/godotengine/godot git || /bin/true
pushd git
git checkout -b ${git_treeish} origin/${git_treeish} || git checkout ${git_treeish}
git reset --hard
git clean -fdx
git pull origin ${git_treeish} || /bin/true
popd
fi

# Validate version.
pushd git
correct_version=$(python3 << EOF
import version;
if hasattr(version, "patch") and version.patch != 0:
git_version = f"{version.major}.{version.minor}.{version.patch}-{version.status}"
else:
git_version = f"{version.major}.{version.minor}-{version.status}"
stripped_version = "${godot_version}".rstrip("0123456789")
print(git_version == stripped_version)
EOF
)
if [[ "$correct_version" != "True" ]]; then
read -p "Version in version.py doesn't match the passed ${godot_version}. Continue anyway (y/n)? " choice
case "$choice" in
y|Y ) echo "yes";;
n|N ) echo "No, aborting."; exit 1;;
* ) echo "Invalid choice, aborting."; exit 1;;
esac
fi

# Generate tarball.
sh misc/scripts/make_tarball.sh -v ${godot_version} -g ${git_treeish}
popd

if [ "${status}" == "stable" ]; then
build_steam=1
fi
Expand Down Expand Up @@ -260,33 +295,6 @@ if [ ! -d "deps/steam" ]; then
popd
fi

if [ "${skip_git_checkout}" == 0 ]; then
git clone https://github.com/godotengine/godot git || /bin/true
pushd git
git checkout -b ${git_treeish} origin/${git_treeish} || git checkout ${git_treeish}
git reset --hard
git clean -fdx
git pull origin ${git_treeish} || /bin/true

# Validate version
correct_version=$(python3 << EOF
import version;
if hasattr(version, "patch") and version.patch != 0:
git_version = f"{version.major}.{version.minor}.{version.patch}"
else:
git_version = f"{version.major}.{version.minor}"
print(git_version == "${version}")
EOF
)
if [[ "$correct_version" != "True" ]]; then
echo "Version in version.py doesn't match the passed ${version}."
exit 1
fi

sh misc/scripts/make_tarball.sh -v ${godot_version} -g ${git_treeish}
popd
fi

export podman_run="${podman} run -it --rm --env BUILD_NAME=${BUILD_NAME} --env GODOT_VERSION_STATUS=${GODOT_VERSION_STATUS} --env NUM_CORES=${NUM_CORES} --env CLASSICAL=${build_classical} --env MONO=${build_mono} --env DOTNET=${build_dotnet} -v ${basedir}/godot-${godot_version}.tar.gz:/root/godot.tar.gz -v ${basedir}/mono-glue:/root/mono-glue -w /root/"
export img_version=$IMAGE_VERSION

Expand Down