amogusspecialsauce/build.sh

39 lines
1.1 KiB
Bash
Raw Normal View History

2023-08-20 16:28:06 +00:00
#!/bin/bash
2023-08-19 22:57:04 +00:00
base=xonotic-data.pk3dir
2023-08-19 21:01:22 +00:00
2023-08-20 14:02:21 +00:00
# Apply specialsauce
cp -R xonoticspecialsauce/* xonotic-data.pk3dir
2023-08-19 21:01:22 +00:00
: ${PROGS_OUT:=$PWD}
export PROGS_OUT
stamp=$(date +"%s")
: ${QCC:=$PWD/gmqcc/gmqcc}
export QCC
export QCCFLAGS_WATERMARK="xonotic-$stamp"
export XONOTIC=1
make -C ${base}
2023-08-19 22:42:06 +00:00
echo "Compiled successfully!";
2023-08-19 21:01:22 +00:00
mkdir -vp $(dirname "$0")/compiled
2023-08-19 22:57:04 +00:00
mv -v *.dat $(dirname "$0")/compiled
rm *.lno
2024-10-06 10:18:40 +00:00
# Check if build is successful
if [ ! -f "compiled/csprogs.dat" ] || [ ! -f "compiled/progs.dat" ] || [ ! -f "compiled/menu.dat" ]; then
echo "Build was not successful. Please check for compiler errors."
exit 1
fi
2023-08-20 14:06:52 +00:00
mkdir dist
2024-10-05 22:12:34 +00:00
if [[ -n "${CI_COMMIT_TAG}" ]]
2023-08-20 16:28:06 +00:00
then
2024-10-05 22:12:34 +00:00
echo "Making ready for Tag: ${CI_COMMIT_TAG}"
zip -9 dist/compiled-${CI_COMMIT_TAG}.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
2023-08-20 16:28:06 +00:00
elif [[ -n "${DRONE_COMMIT_SHA}" ]]
then
2024-10-05 22:12:34 +00:00
echo "Making ready for Commit: ${CI_COMMIT_SHA:0:10}"
zip -9 dist/compiled-${CI_COMMIT_SHA:0:10}.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
2023-08-20 14:02:21 +00:00
else
2023-08-20 16:28:06 +00:00
zip -9 dist/compiled.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
2023-08-20 14:02:21 +00:00
fi