forked from Mirrors/openclonk
Travis: Build and upload AppImage snapshot
parent
8df71d3f32
commit
8aeef938fc
16
.travis.yml
16
.travis.yml
|
@ -23,13 +23,15 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'build-essential', 'cmake', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libgtest-dev']
|
||||
packages: ['g++-5', 'build-essential', 'cmake', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libgtest-dev', 'curl']
|
||||
env:
|
||||
- CCOMPILER=gcc-5
|
||||
- CXXCOMPILER=g++-5
|
||||
- TYPE=Debug
|
||||
- TYPE=RelWithDebInfo
|
||||
- CXX_FLAGS="-fdiagnostics-color"
|
||||
- BSYS="Ninja#ninja -k30" PCH=on
|
||||
- UPLOAD_SNAPSHOT=1
|
||||
- CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr -DWITH_AUTOMATIC_UPDATE=ON -DWITH_APPDIR_INSTALLATION=ON"
|
||||
|
||||
- os: linux
|
||||
compiler: clang
|
||||
|
@ -57,9 +59,19 @@ before_script:
|
|||
-DUSE_GCC_PCH=${PCH:-off}
|
||||
-DGTEST_ROOT=$PWD/googletest-release-1.7.0
|
||||
-DGMOCK_ROOT=$PWD/googlemock-release-1.7.0
|
||||
$CMAKE_FLAGS
|
||||
.
|
||||
|
||||
script:
|
||||
- ${BSYS/*#/} all netpuncher tests aul_test
|
||||
- ./tests/tests
|
||||
- ./tests/aul_test
|
||||
|
||||
after_success:
|
||||
- >
|
||||
[ "$UPLOAD_SNAPSHOT" = 1 ] &&
|
||||
echo "Creating AppImage..." &&
|
||||
tools/create_appimage.sh &&
|
||||
echo "Uploading snapshot..." &&
|
||||
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage ||
|
||||
echo "Snapshot creation has failed"
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
error() {
|
||||
echo error: "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ -f CMakeCache.txt ]] || error "this does not look like a build directory"
|
||||
|
||||
DESTDIR=appdir cmake --build . --target install || error "install failed"
|
||||
|
||||
linuxdeployqt=linuxdeployqt-continuous-x86_64.AppImage
|
||||
if [[ ! -x $linuxdeployqt ]]; then
|
||||
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$linuxdeployqt" \
|
||||
|| error "could not download linuxdeployqt"
|
||||
chmod a+x $linuxdeployqt
|
||||
fi
|
||||
|
||||
export ARCH=$(uname -m)
|
||||
|
||||
./$linuxdeployqt appdir/usr/share/applications/openclonk.desktop -appimage \
|
||||
|| error "AppImage creation has failed"
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
error() {
|
||||
echo error: "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
revision=$(git rev-parse --short=9 HEAD)
|
||||
[[ -n $revision ]] || error "could not get git revision"
|
||||
|
||||
branch=$(git symbolic-ref --short HEAD)
|
||||
# Travis checks out a concrete revision, so we have to get the branch name from
|
||||
# the environment instead.
|
||||
: ${branch:=$TRAVIS_BRANCH}
|
||||
[[ -n $branch ]] || error "could not get branch name"
|
||||
|
||||
date=$(date --date="$(git show -s --format=%ci)" -u -Is | sed 's/+00:\?00$/Z/')
|
||||
[[ -n $date ]] || error "could not get commit date"
|
||||
|
||||
file=${1:?no file to upload given}
|
||||
: ${OC_REL_URL:?target URL not set}
|
||||
|
||||
upload_path="/snapshots/$date-$branch-$revision/$(basename "$file")"
|
||||
echo "uploading $upload_path"
|
||||
|
||||
curl -XPOST "$OC_REL_URL$upload_path" --data-binary "@$file" \
|
||||
|| error "file upload failed"
|
Loading…
Reference in New Issue