From b934aaccb67b8284d8a3bc0970aefab7764afb8f Mon Sep 17 00:00:00 2001 From: eternalcodes Date: Tue, 29 Mar 2016 18:28:25 -0500 Subject: [PATCH] Add releases for Linux and MacOSX --- .travis.yml | 49 +++++++++++++++++++++++++---------- tools/travis-build.sh | 57 +++++++++++++++++++++++++++++++++++++++-- tools/travis-install.sh | 12 +++++++++ 3 files changed, 102 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56aa2752c6..7045516101 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,44 @@ language: cpp sudo: required dist: trusty - install: - - ./tools/travis-install.sh "${host:-native}" "${flavour:-Release}" $opts - +- ./tools/travis-install.sh "${host:-native}" "${flavour:-Release}" $opts script: - - ./tools/travis-build.sh "${host:-native}" "${flavour:-Release}" $opts - +- ./tools/travis-build.sh "${host:-native}" "${flavour:-Release}" $opts compiler: gcc env: - - "" - - flavour=Debug - - host=i686-linux-gnu - - host=i686-w64-mingw32 - - host=x86_64-w64-mingw32 - -# One extra build with clang, its warnings are often better +- host=native deploy=true +- flavour=Debug +- host=i686-linux-gnu deploy=true +- host=i686-w64-mingw32 +- host=x86_64-w64-mingw32 matrix: include: - - compiler: clang - env: "" + - compiler: clang + env: '' + - os: osx + compiler: clang + env: host=macosx-universal-clang deploy=true +deploy: + - provider: releases + api_key: + secure: QSn2a8ihR2v15vVESJ6AkyV/WM4yLB1hLw7UoNG9DICce+Ge7Ih5jn9WWjXddeJX2cpKzIzNZDC2NVXejcahfuw2UTdaauQ60u6EOZ/C+TXH2cYLhpYzLNDu2pJY4LggcDt3xPTbvIHaNT4iYaFy3org40DmElMXpKz8qGaCC236oAV9zZbhLkWEz28rRNQF4yTxSg7kttLOTp+WdO0DxIJAraCbUgfXfabpCY5/m2sNAIUegpwz2oT8VNJ0Cg33kp2ND6341pQlN+fzv89hqw+vqzy2ZCvGcKSpZ6thEZGpxabULRqm8pDPClJNjnxwQ1P4MLNX76kkfXiPXiI932c/oOLHZP5VAyN1+Xhvrsbed+nPS8kwgXfN27aQ1IMSBMMfn2nyNvn0dV+wcbAU9T+GID/I8R+YRWfeyqr+v1fYrZlf4OP7ttNFXI0oFCObv4/TnxAsQodKJoudnSqEvh/yVQX2g+82oPrK6v/UjOlxQPEZQJK0bIPFwWA9vqBPLDUCf+ZIonGAFrDWSEwVRUGItdBjhMWFOau4vWlnZz6OwHT0TSV0DLQmFSWOXaV8An6Ss/1KdVOP13nG/ISJVhAVlpnuut8GIIOvzxupRgUG1YoqFGhJlp/2rGjl766TM/dmUN6CYmnAqi9YWlypuMbU2IzGFsg9uS46LI0GaKs= + file: ./eternaljk-linux-x86_64.tar.gz + on: + tags: true + condition: -n "${deploy}" && "${host}" = native + - provider: releases + api_key: + secure: QSn2a8ihR2v15vVESJ6AkyV/WM4yLB1hLw7UoNG9DICce+Ge7Ih5jn9WWjXddeJX2cpKzIzNZDC2NVXejcahfuw2UTdaauQ60u6EOZ/C+TXH2cYLhpYzLNDu2pJY4LggcDt3xPTbvIHaNT4iYaFy3org40DmElMXpKz8qGaCC236oAV9zZbhLkWEz28rRNQF4yTxSg7kttLOTp+WdO0DxIJAraCbUgfXfabpCY5/m2sNAIUegpwz2oT8VNJ0Cg33kp2ND6341pQlN+fzv89hqw+vqzy2ZCvGcKSpZ6thEZGpxabULRqm8pDPClJNjnxwQ1P4MLNX76kkfXiPXiI932c/oOLHZP5VAyN1+Xhvrsbed+nPS8kwgXfN27aQ1IMSBMMfn2nyNvn0dV+wcbAU9T+GID/I8R+YRWfeyqr+v1fYrZlf4OP7ttNFXI0oFCObv4/TnxAsQodKJoudnSqEvh/yVQX2g+82oPrK6v/UjOlxQPEZQJK0bIPFwWA9vqBPLDUCf+ZIonGAFrDWSEwVRUGItdBjhMWFOau4vWlnZz6OwHT0TSV0DLQmFSWOXaV8An6Ss/1KdVOP13nG/ISJVhAVlpnuut8GIIOvzxupRgUG1YoqFGhJlp/2rGjl766TM/dmUN6CYmnAqi9YWlypuMbU2IzGFsg9uS46LI0GaKs= + file: ./eternaljk-linux-i686.tar.gz + on: + tags: true + condition: -n "${deploy}" && "${host}" = i686-linux-gnu + - provider: releases + api_key: + secure: QSn2a8ihR2v15vVESJ6AkyV/WM4yLB1hLw7UoNG9DICce+Ge7Ih5jn9WWjXddeJX2cpKzIzNZDC2NVXejcahfuw2UTdaauQ60u6EOZ/C+TXH2cYLhpYzLNDu2pJY4LggcDt3xPTbvIHaNT4iYaFy3org40DmElMXpKz8qGaCC236oAV9zZbhLkWEz28rRNQF4yTxSg7kttLOTp+WdO0DxIJAraCbUgfXfabpCY5/m2sNAIUegpwz2oT8VNJ0Cg33kp2ND6341pQlN+fzv89hqw+vqzy2ZCvGcKSpZ6thEZGpxabULRqm8pDPClJNjnxwQ1P4MLNX76kkfXiPXiI932c/oOLHZP5VAyN1+Xhvrsbed+nPS8kwgXfN27aQ1IMSBMMfn2nyNvn0dV+wcbAU9T+GID/I8R+YRWfeyqr+v1fYrZlf4OP7ttNFXI0oFCObv4/TnxAsQodKJoudnSqEvh/yVQX2g+82oPrK6v/UjOlxQPEZQJK0bIPFwWA9vqBPLDUCf+ZIonGAFrDWSEwVRUGItdBjhMWFOau4vWlnZz6OwHT0TSV0DLQmFSWOXaV8An6Ss/1KdVOP13nG/ISJVhAVlpnuut8GIIOvzxupRgUG1YoqFGhJlp/2rGjl766TM/dmUN6CYmnAqi9YWlypuMbU2IzGFsg9uS46LI0GaKs= + file: ./eternaljk-macos-x86_64.tar.gz + skip_cleanup: true + on: + tags: true + condition: -n "${deploy}" && "${host}" = macosx-universal-clang \ No newline at end of file diff --git a/tools/travis-build.sh b/tools/travis-build.sh index b6b912b2cb..a27bd86eef 100755 --- a/tools/travis-build.sh +++ b/tools/travis-build.sh @@ -21,13 +21,27 @@ case "${host}" in (i?86-linux-gnu) set -- \ -D CMAKE_TOOLCHAIN_FILE=$(pwd)/CMakeModules/Toolchains/linux-i686.cmake \ + -D BuildMPGame=OFF \ + -D BuildMPDed=OFF \ + -D BuildMPCGame=OFF \ "$@" ;; (macosx-universal-clang) + set -- \ + -D BuildMPGame=OFF \ + -D BuildMPDed=OFF \ + -D BuildMPCGame=OFF \ + "$@" ;; (native) + if [ -n "${deploy}" ]; then + set -- \ + -D BuildMPGame=OFF \ + -D BuildMPDed=OFF \ + -D BuildMPCGame=OFF \ + "$@" + fi ;; - (*) set +x echo "Error: don't know how to cross-compile for ${host} host" @@ -42,4 +56,43 @@ set -- -D CMAKE_BUILD_TYPE="$flavour" "$@" "$@" .. ) make -C build make -C build install DESTDIR=$(pwd)/build/DESTDIR -( cd $(pwd)/build/DESTDIR && find . -ls ) + +if [ x"${host}" = xi686-linux-gnu ]; then + arch="i686" +else + arch="x86_64" +fi + +case "${host}" in + (macosx-universal-clang) + ( cd $(pwd)/assets && \ + zip -r japro3ui-assets.pk3 * && \ + mv japro3ui-assets.pk3 ../build/DESTDIR/prefix/JediAcademy/openjk.x86_64.app/Contents/MacOS/japro/ && \ + cd ../build/DESTDIR/prefix/JediAcademy/openjk.x86_64.app/Contents/MacOS/japro/ && \ + wget http://upsgaming.com/files/japro3.pk3 && \ + cd ../../../ && \ + tar czvf eternaljk-macos-"${arch}".tar.gz * && \ + mv eternaljk-macos-"${arch}".tar.gz /Users/travis/build/eternalcodes/EternalJK/ && \ + cd ../../../ && \ + find . -ls ) + ;; + (i?86-linux-gnu|native) + if [ -n "${deploy}" ]; then + ( cd $(pwd)/assets && \ + zip -r japro3ui-assets.pk3 * && \ + mv japro3ui-assets.pk3 ../build/DESTDIR/prefix/JediAcademy/japro/ && \ + cd ../build/DESTDIR/prefix/JediAcademy/japro && \ + wget http://upsgaming.com/files/japro3.pk3 && \ + cd ../ && \ + tar czvf eternaljk-linux-"${arch}".tar.gz * && \ + mv eternaljk-linux-"${arch}".tar.gz /home/travis/build/eternalcodes/EternalJK/ && \ + cd ../../ && \ + find . -ls ) + else + ( cd $(pwd)/build/DESTDIR && find . -ls ) + fi + ;; + (*) + ( cd $(pwd)/build/DESTDIR && find . -ls ) + ;; +esac \ No newline at end of file diff --git a/tools/travis-install.sh b/tools/travis-install.sh index d969eea271..efec0e4179 100755 --- a/tools/travis-install.sh +++ b/tools/travis-install.sh @@ -7,6 +7,17 @@ host="$1" flavour="$2" shift 2 +if [[ "${host}" == macosx-universal-clang ]]; then + cd ~ + curl -O https://www.libsdl.org/release/SDL2-2.0.4.tar.gz + tar xzf SDL2-2.0.4.tar.gz + cd SDL2-2.0.4/Xcode/SDL + sed -i -e 's/@rpath//g' SDL.xcodeproj/project.pbxproj + xcodebuild ARCHS="i386 x86_64" ONLY_ACTIVE_ARCH=NO -configuration Release + mkdir -p ~/Library/Frameworks/ + ln -s `pwd`/build/Release/SDL2.framework ~/Library/Frameworks/ +else + # travis-ci's Ubuntu 14.04 image provides an apt source for Chrome, # which breaks i386 multiarch. Disable it: we don't need it for any of # these builds anyway. @@ -50,3 +61,4 @@ case "${host}" in g++ g++-4.8 gcc gcc-4.8 cpp cpp-4.8 ;; esac +fi \ No newline at end of file