#!/bin/bash base=xonotic-data.pk3dir # Apply specialsauce cp -R xonoticspecialsauce/* xonotic-data.pk3dir : ${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} echo "Compiled successfully!"; mkdir -vp $(dirname "$0")/compiled mv -v *.dat $(dirname "$0")/compiled rm *.lno # 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 mkdir dist if [[ -n "${CI_COMMIT_TAG}" ]] then 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 elif [[ -n "${DRONE_COMMIT_SHA}" ]] then 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 else zip -9 dist/compiled.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat fi