Skip to content

Commit

Permalink
Add releases for Linux and MacOSX
Browse files Browse the repository at this point in the history
  • Loading branch information
eternalcodes committed Mar 29, 2016
1 parent d8f6bb5 commit b934aac
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 16 deletions.
49 changes: 35 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
57 changes: 55 additions & 2 deletions tools/travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
12 changes: 12 additions & 0 deletions tools/travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -50,3 +61,4 @@ case "${host}" in
g++ g++-4.8 gcc gcc-4.8 cpp cpp-4.8
;;
esac
fi

0 comments on commit b934aac

Please sign in to comment.