1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00
Files
OpenRCT2/scripts/build-portable
Ted John 3ba8369f22 Do major clean up of Windows CI workflow (#10581)
- Move many of the post build operations in openrc2.proj to bash scripts, some of which can be shared with the macOS and Linux CIs.
- Improve performance of NSIS stage by grabbing a pre-packaged portable zip from GitHub. This typically saves the CI a minute and is more reliable.
2020-01-19 14:04:59 +00:00

59 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
set -e
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
# Create a Windows symbols archive for OpenRCT2
basedir="$(readlink -f `dirname $0`/..)"
cd $basedir/bin
destination=../artifacts/openrct2-portable-$CONFIGURATION-$PLATFORM.zip
# Check 7z is available
if ! [ -x "$(command -v 7z)" ]; then
echo -e >&2 "\033[0;7z not found\033[0m"
exit 1
fi
echo -e "\033[0;36mCreating portable zip for Windows OpenRCT2...\033[0m"
if [[ -f $destination ]]; then
rm $destination
fi
7z a -r $destination \
openrct2.exe openrct2.com openrct2.dll data \
../distribution/changelog.txt \
../distribution/contributors.md \
../distribution/licence.txt \
../distribution/readme.txt \
destination=$(cygpath -w $(readlink -f $destination))
printf '\033[0;32m%s\033[0m\n' "${destination} created successfully"
else
if [[ "$#" -ne 2 ]]; then
echo 'Turn an OpenRCT2 cmake install into a portable tar.gz.'
echo ''
echo 'Usage: create-portable-build <output-file> <install-path>'
exit 1
fi
output=$1
install=$2
echo -e "\033[0;36mCreating $output..."
workdir=$output-temp
if [[ -d "$workdir" ]]
then
rm -rf $workdir
fi
mkdir -p $workdir/OpenRCT2
cp -r $install/bin/* $workdir/OpenRCT2
cp -r $install/share/doc $workdir/OpenRCT2
cp -r $install/share/openrct2 $workdir/OpenRCT2/data
pushd $workdir > /dev/null
tar -czf output.tar.gz OpenRCT2
popd > /dev/null
mv $workdir/output.tar.gz $output
rm -rf $workdir
echo -e "\033[0;32m$output created successfully"
fi