Init
This commit is contained in:
16
scripts/clean_deps_n_build.sh
Executable file
16
scripts/clean_deps_n_build.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
pushd "$SCRIPT_DIR"/..
|
||||
|
||||
rm -rf /spacegame_deps build* assets/shaders/*.spv 3rdparty/glfw 3rdparty/bx 3rdparty/bimg 3rdparty/bgfx 3rdparty/bgfx.cmake
|
||||
|
||||
popd
|
||||
53
scripts/release_game.sh
Executable file
53
scripts/release_game.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Construct base version: '1.2.3-123+20230527T195630.811d543'
|
||||
# Platform specific versions may add extra info: '1.2.3-123+20230527T195630.811d543.linux.x11'
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
pushd "$SCRIPT_DIR"/.. 2>&1 1>/dev/null
|
||||
|
||||
# Fetch all tags from remote (if something changed)
|
||||
git fetch --tags
|
||||
|
||||
# Get current version from latest tag
|
||||
VERSION_SHORT=$(git describe --tags --abbrev=0)
|
||||
|
||||
echo "Current Version: $VERSION_SHORT"
|
||||
|
||||
# Advance by one revision
|
||||
# check if revision present
|
||||
if [[ $VERSION_SHORT != *"-"* ]]; then
|
||||
VERSION_SHORT="$VERSION_SHORT-0"
|
||||
fi
|
||||
# seperate base version from revision
|
||||
BASE_VERSION=$(echo $VERSION_SHORT | sed -E 's~^(.*[.].*[.].*)-([0-9]+)~\1~I')
|
||||
REVISION=$(echo $VERSION_SHORT | sed -E 's~^(.*[.].*[.].*)-([0-9]+)~\2~I')
|
||||
# +1
|
||||
REVISION=$(($REVISION+1)) || $(echo 1)
|
||||
# Assemble new version
|
||||
VERSION_SHORT="$BASE_VERSION-$REVISION"
|
||||
|
||||
read -p "Enter New Version [$VERSION_SHORT]: " VERSION_SHORT_INPUT
|
||||
VERSION_SHORT=${VERSION_SHORT_INPUT:-$VERSION_SHORT}
|
||||
|
||||
# Collect extra build information
|
||||
# CMAKE_VERSION=$(grep CMAKE_PROJECT_VERSION:STATIC build/CMakeCache.txt | cut -d "=" -f2)
|
||||
TIME=$(date -u +"%Y%m%dT%H%M%S")
|
||||
COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
VERSION_LONG="$VERSION_SHORT+$TIME.$COMMIT"
|
||||
|
||||
# Push any outstanding commits
|
||||
git commit --allow-empty -m "Release $VERSION_SHORT" -m "[CI SKIP]"
|
||||
git push
|
||||
|
||||
# Create annotated tag named named after short version and annotated with long version
|
||||
git tag -a -m "$VERSION_LONG" "$VERSION_SHORT"
|
||||
|
||||
# push the new tag
|
||||
git push origin "$VERSION_SHORT"
|
||||
|
||||
popd 2>&1 1>/dev/null
|
||||
58
scripts/setup_llvm_links.sh
Executable file
58
scripts/setup_llvm_links.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This cript creates default links to a set of llvm binaries
|
||||
# ex. /usr/bin/clang -> /usr/bin/clang-18
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Detect clang version
|
||||
# Command Breakdown:
|
||||
# Get all installed packages
|
||||
# | Detect clang version
|
||||
# | | Sort available versions
|
||||
# | | | Pick highest version
|
||||
# | | | | Remove "clang-" to extract the version only
|
||||
# v v v v v
|
||||
VER=$(dpkg --list | grep -o "clang-[0-9][0-9]*" | sort -r | head -n 1 | sed "s#clang-##")
|
||||
#echo Detected Tool-Version: $VER
|
||||
|
||||
# Ensure all tools are installed
|
||||
TOOLS=(
|
||||
clang
|
||||
clang++
|
||||
llvm-windres
|
||||
llvm-ranlib
|
||||
llvm-ar
|
||||
llvm-strip
|
||||
)
|
||||
|
||||
for TOOL in "${TOOLS[@]}"
|
||||
do
|
||||
|
||||
set +e
|
||||
OUTPUT=$($TOOL-$VER --version 2>&1)
|
||||
EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
# on error (ex. no ground truth file) just print nothing
|
||||
if [ $EXIT_CODE -ne 0 ]
|
||||
then
|
||||
echo $TOOL-$VER must be installed!
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#echo Found $TOOL-$VER
|
||||
|
||||
# Get full path
|
||||
TOOL_PATH=$(which $TOOL-$VER)
|
||||
|
||||
# Create links
|
||||
ln -sf $TOOL_PATH /usr/bin/$TOOL
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user