travis script update

This commit is contained in:
Syping 2017-12-21 19:36:56 +01:00
parent 30b2dce0bf
commit a44ee9ea44
6 changed files with 95 additions and 36 deletions

View file

@ -3,51 +3,30 @@ sudo: required
language: cpp
env:
- PACKAGE_VERSION="1.5.0"
service:
- docker
before_install:
- test -n $CC && unset CC
- test -n $CXX && unset CXX
install:
- sudo apt-get update -qq
- sudo apt-get install -qq checkinstall dpkg-dev g++ gcc qtbase5-dev qt5-qmake qttranslations5-l10n libqt4-dev
before_script:
- if [ `git name-rev --tags --name-only $(git rev-parse HEAD)` == "undefined" ]; then export APPLICATION_VERSION="$PACKAGE_VERSION.$TRAVIS_BUILD_NUMBER"; else export APPLICATION_VERSION=`git name-rev --tags --name-only $(git rev-parse HEAD)`; fi
- echo "gta5view build version is $APPLICATION_VERSION"
- mkdir build
- mkdir package
- chmod -x res/gta5sync_*.qm res/gta5view.desktop res/gta5view.png
- cd build
- mkdir qt4
- cd qt4
- echo "Grand Theft Auto V Snapmatic and Savegame viewer" > ./description-pak
- cd ..
- mkdir qt5
- cd qt5
- echo "Grand Theft Auto V Snapmatic and Savegame viewer" > ./description-pak
- cd ..
matrix:
include:
- env:
- BUILD_SCRIPT=linux_travis.sh
- env:
- BUILD_SCRIPT=windows_travis.sh
- QT_SELECT=qt5-i686-w64-mingw32
- env:
- BUILD_SCRIPT=windows_travis.sh
- QT_SELECT=qt5-x86_64-w64-mingw32
- EXECUTABLE_ARCH=_x64
script:
- cd qt5
- qmake -qt=5 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev7\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro
- make -j 4
- sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev7 --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=../../package
- cd ..
- cd qt4
- qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$PACKAGE_VERSION-dev7\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro
- make -j 4
- sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=$PACKAGE_VERSION --pkgrelease=dev7 --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqtcore4,libqtgui4,libqt4-network,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=../../package
- cd ..
- .travis/travis.sh
deploy:
provider: releases
api_key:
secure: "o7VneEz1aHfdVwZvOZLfopf6uJWNrFsZaBvunTmXFzpmNFhlNS1qwqgMUkIA2yBRbZ3wIzVs4vfwIHv7W9yE/PqK+AYL+R8+AwKGrwlgT4HqJNuk6VM/LNJ6GwT/qkQuaoOVw29bUjmzzgIRdHmw53SlJv6Hh1VE8HphlTT//aex6nCfcFhUZ0BETdZDWz5FSHwL3NalUoqfKfQrJeky5RXzCyCANQC2tKt0bV46GaWIgWrDo2KCTNqPtRWWf5GDmnkXE5IYRMQ3mXvO9iYh0v5Y2jo4PiXGUiFUU6Z3aAWFAiPdGclrBO697cf3lCTzDMhuCETR153qFYsLShUlFf61ITAmCeHAWETjZDri0lmPONo3GoNB6alGfYEA51qw14kXakrTpICtTJj7gw/gtUYOabW6hrzmieNzMBIy62RikDPjyakFnuwW2qNHRlD65e0jYv+6nCpb6E+OV16Ysh1zhV2vTfpfzVmSuyu2J+ELqXD3OZCXRSPpDIih9UQ8335p8FBji6jHORcgym/TRgdgRmENibh8tLzWp+UjpWHuWfcpvZgOskjfwU0iDMCayMJ7tDpOhXHcAhDRnd6XRIiOJ5YZCzflj2nEwmt3YUd7DwXS/AU+WHOmcNQBjXBxF/FJa35XXcy3HKJM5TTKqtph3medo30us5yXHeG6NNg="
file_glob: true
file: "../package/gta5view*.deb"
file: "assets/*"
skip_cleanup: true
on:
tags: true

28
.travis/linux_build.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/bash
# Creating folders
cd $PROJECT_DIR && \
echo "gta5view build version is $APPLICATION_VERSION" && \
mkdir build && \
mkdir assets && \
chmod -x res/gta5sync_*.qm res/gta5view.desktop res/gta5view.png && \
cd build && \
mkdir qt4 && \
cd qt4 && \
echo "Grand Theft Auto V Snapmatic and Savegame viewer" > ./description-pak && \
cd .. && \
mkdir qt5 && \
cd qt5 && \
echo "Grand Theft Auto V Snapmatic and Savegame viewer" > ./description-pak && \
cd .. && \
# Starting build
cd qt5 && \
qmake -qt=5 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$APPLICATION_VERSION\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro && \
make -j 4 && \
sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=$PACKAGE_VERSION --pkgrelease=$PACKAGE_BUILD --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=$PROJECT_DIR/assets && \
cd .. && \
cd qt4 && \
qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=c++11 DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$APPLICATION_VERSION\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro && \
make -j 4 && \
sudo checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=$PACKAGE_VERSION --pkgrelease=$PACKAGE_BUILD --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqtcore4,libqtgui4,libqt4-network,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=$PROJECT_DIR/assets

8
.travis/linux_travis.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
# Install packages
sudo apt-get update -qq && \
sudo apt-get install -qq checkinstall dpkg-dev g++ gcc qtbase5-dev qt5-qmake qttranslations5-l10n libqt4-dev && \
.travis/linux_build.sh && \
cd $PROJECT_DIR

14
.travis/travis.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
# Install lua
sudo apt-get update -qq && \
sudo apt-get install -qq lua5.2
if [ `git name-rev --tags --name-only $(git rev-parse HEAD)` == "undefined" ]; then export APPLICATION_VERSION=`lua5.2 -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
export PACKAGE_VERSION=$(grep -oE '^[^\-]*' <<< $APPLICATION_VERSION)
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
export EXECUTABLE_VERSION=$PACKAGE_VERSION$PACKAGE_BUILD
if [ "$PACKAGE_BUILD" == "" ]; then export PACKAGE_BUILD=$TRAVIS_BUILD_NUMBER; fi
export PROJECT_DIR=$(pwd)
.travis/$BUILD_SCRIPT

18
.travis/windows_build.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe
# Creating folders
cd $PROJECT_DIR && \
echo "gta5view build version is $APPLICATION_VERSION" && \
echo "gta5view executable is $GTA5VIEW_EXECUTABLE" && \
mkdir build && \
mkdir assets && \
# Starting build
cd build && \
qmake-static DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"$APPLICATION_VERSION\\\\\\\"" ../gta5view.pro && \
make -j 4 && \
cp -Rf release/*.exe $PROJECT_DIR/assets/$GTA5VIEW_EXECUTABLE && \
cd $PROJECT_DIR/assets && \
upx --best $GTA5VIEW_EXECUTABLE

12
.travis/windows_travis.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
QT_VERSION=5.6.3
DOCKER_IMAGE=syping/qt5-static-mingw:$QT_VERSION
PROJECT_DIR_DOCKER=/gta5view/
cd $PROJECT_DIR && \
docker pull $DOCKER_IMAGE && \
docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
$DOCKER_IMAGE \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .travis/windows_build.sh"