update CI scripts

This commit is contained in:
Syping 2018-06-22 17:11:18 +02:00
parent 99f3c22ab0
commit e2b7062e26
16 changed files with 30 additions and 27 deletions

10
.ci/ci.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
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
export PACKAGE_VERSION=$(grep -oE '^[^\-]*' <<< $APPLICATION_VERSION)
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
export EXECUTABLE_VERSION=${PACKAGE_VERSION}${PACKAGE_BUILD}${EXECUTABLE_TAG}
if [[ ! ${PACKAGE_BUILD} ]]; then export PACKAGE_BUILD=1; fi
export PROJECT_DIR=$(pwd)
.ci/${BUILD_SCRIPT}

View file

@ -12,4 +12,4 @@ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .travis/debian_install.sh && .travis/debian_build.sh" /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Install packages # Install packages
.travis/osx_install.sh && \ .ci/osx_install.sh && \
# Build gta5view # Build gta5view
.travis/osx_build.sh && \ .ci/osx_build.sh && \
cd ${PROJECT_DIR} cd ${PROJECT_DIR}

View file

@ -9,18 +9,18 @@ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .travis/windows_build.sh" && \ /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
# Prepare environment variable # Prepare environment variable
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \ export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \
# Upload Assets to Dropbox # Upload Assets to Dropbox
if [ "${PACKAGE_CODE}" == "Dropbox" ]; then if [ "${PACKAGE_CODE}" == "Dropbox" ]; then
${PROJECT_DIR}/.travis/dropbox_uploader.sh mkdir gta5view-builds/${PACKAGE_VERSION} ${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5view-builds/${PACKAGE_VERSION}
${PROJECT_DIR}/.travis/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5view-builds/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \ ${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5view-builds/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE} rm -rf ${GTA5VIEW_EXECUTABLE}
elif [ "${PACKAGE_CODE}" == "gta5-mods" ]; then elif [ "${PACKAGE_CODE}" == "gta5-mods" ]; then
${PROJECT_DIR}/.travis/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION} ${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
${PROJECT_DIR}/.travis/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \ ${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE} rm -rf ${GTA5VIEW_EXECUTABLE}
fi fi

View file

@ -15,5 +15,5 @@ qmake ${QMAKE_FLAGS} DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_BUILDCOD
make depend && \ make depend && \
make -j 4 && \ make -j 4 && \
cd ${PROJECT_DIR}/assets && \ cd ${PROJECT_DIR}/assets && \
makensis -NOCD ${PROJECT_DIR}/.travis/gta5view.nsi && \ makensis -NOCD ${PROJECT_DIR}/.ci/gta5view.nsi && \
mv -f gta5view_setup.exe gta5view-${EXECUTABLE_VERSION}_setup.exe mv -f gta5view_setup.exe gta5view-${EXECUTABLE_VERSION}_setup.exe

View file

@ -9,4 +9,4 @@ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .travis/wininstall_build.sh" /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"

View file

@ -9,37 +9,37 @@ service:
matrix: matrix:
include: include:
- env: - env:
- BUILD_SCRIPT=debian_travis.sh - BUILD_SCRIPT=debian_ci.sh
- RELEASE_LABEL="Debian 32-Bit Package" - RELEASE_LABEL="Debian 32-Bit Package"
- DEBIAN_VERSION=stretch - DEBIAN_VERSION=stretch
- DOCKER_USER=i386 - DOCKER_USER=i386
- APT_INSTALL=clang - APT_INSTALL=clang
- env: - env:
- BUILD_SCRIPT=debian_travis.sh - BUILD_SCRIPT=debian_ci.sh
- RELEASE_LABEL="Debian 64-Bit Package" - RELEASE_LABEL="Debian 64-Bit Package"
- DEBIAN_VERSION=stretch - DEBIAN_VERSION=stretch
- DOCKER_USER=amd64 - DOCKER_USER=amd64
- APT_INSTALL=clang - APT_INSTALL=clang
- env: - env:
- BUILD_SCRIPT=windows_travis.sh - BUILD_SCRIPT=windows_ci.sh
- QT_SELECT=qt5-i686-w64-mingw32 - QT_SELECT=qt5-i686-w64-mingw32
- RELEASE_LABEL="Windows 32-Bit Portable" - RELEASE_LABEL="Windows 32-Bit Portable"
- env: - env:
- BUILD_SCRIPT=windows_travis.sh - BUILD_SCRIPT=windows_ci.sh
- QT_SELECT=qt5-x86_64-w64-mingw32 - QT_SELECT=qt5-x86_64-w64-mingw32
- RELEASE_LABEL="Windows 64-Bit Portable" - RELEASE_LABEL="Windows 64-Bit Portable"
- EXECUTABLE_ARCH=_x64 - EXECUTABLE_ARCH=_x64
- env: - env:
- BUILD_SCRIPT=windows_travis.sh - BUILD_SCRIPT=windows_ci.sh
- QT_SELECT=qt5-x86_64-w64-mingw32 - QT_SELECT=qt5-x86_64-w64-mingw32
- PACKAGE_CODE=Dropbox - PACKAGE_CODE=Dropbox
- env: - env:
- BUILD_SCRIPT=wininstall_travis.sh - BUILD_SCRIPT=wininstall_ci.sh
- QT_SELECT=qt5-x86_64-w64-mingw32 - QT_SELECT=qt5-x86_64-w64-mingw32
- RELEASE_LABEL="Windows 64-Bit Installer" - RELEASE_LABEL="Windows 64-Bit Installer"
- os: osx - os: osx
env: env:
- BUILD_SCRIPT=osx_travis.sh - BUILD_SCRIPT=osx_ci.sh
- RELEASE_LABEL="Mac OS X 64-Bit Disk Image" - RELEASE_LABEL="Mac OS X 64-Bit Disk Image"
before_install: before_install:

View file

@ -20,11 +20,4 @@ if [ "${PACKAGE_CODE}" == "" ]; then
export PACKAGE_CODE=GitHub export PACKAGE_CODE=GitHub
fi fi
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 .ci/ci.sh
export PACKAGE_VERSION=$(grep -oE '^[^\-]*' <<< $APPLICATION_VERSION)
export PACKAGE_BUILD=$(grep -oP '\-\K.+' <<< $APPLICATION_VERSION)
export EXECUTABLE_VERSION=${PACKAGE_VERSION}${PACKAGE_BUILD}${EXECUTABLE_TAG}
if [[ ! ${PACKAGE_BUILD} ]]; then export PACKAGE_BUILD=1; fi
export PROJECT_DIR=$(pwd)
.travis/${BUILD_SCRIPT}

View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Install packages # Install packages
sudo .travis/debian_install.sh && \ sudo .ci/debian_install.sh && \
# Build gta5view # Build gta5view
sudo .travis/debian_build.sh && \ sudo .ci/debian_build.sh && \
cd ${PROJECT_DIR} cd ${PROJECT_DIR}