gta5view/.travis/travis.sh

31 lines
1.1 KiB
Bash
Raw Normal View History

2017-12-21 19:36:56 +01:00
#!/bin/bash
# Install lua
2018-01-17 22:19:27 +01:00
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo apt-get update -qq && \
sudo apt-get install -qq lua5.2
elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
brew install lua
fi
2017-12-21 19:36:56 +01:00
2018-06-02 07:26:56 +02:00
# Check if build is not tagged
if [ "${TRAVIS_TAG}" == "" ]; then
export EXECUTABLE_TAG=-$(git rev-parse --short HEAD)
else
export EXECUTABLE_TAG=
fi
# Check if package code is not set
if [ "${PACKAGE_CODE}" == "" ]; then
export PACKAGE_CODE=GitHub
fi
2018-01-17 22:19:27 +01:00
if [ `git name-rev --tags --name-only $(git rev-parse HEAD)` == "undefined" ]; then export APPLICATION_VERSION=`lua -e 'for line in io.lines("config.h") do local m = string.match(line, "#define GTA5SYNC_APPVER \"(.+)\"$"); if m then print(m); os.exit(0) end end'`; else export APPLICATION_VERSION=`git name-rev --tags --name-only $(git rev-parse HEAD)`; fi
2017-12-21 19:36:56 +01:00
export PACKAGE_VERSION=$(grep -oE '^[^\-]*' <<< $APPLICATION_VERSION)
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
2018-06-02 07:26:56 +02:00
export EXECUTABLE_VERSION=${PACKAGE_VERSION}${PACKAGE_BUILD}${EXECUTABLE_TAG}
2018-02-08 12:39:57 +01:00
if [[ ! ${PACKAGE_BUILD} ]]; then export PACKAGE_BUILD=1; fi
2017-12-21 19:36:56 +01:00
export PROJECT_DIR=$(pwd)
.travis/${BUILD_SCRIPT}