rewrote travis ci for 0.2.x

This commit is contained in:
itsmattkc
2019-09-10 14:03:27 +10:00
parent 601864c51d
commit f29b8ac3a4
5 changed files with 45 additions and 84 deletions
+1 -6
View File
@@ -7,11 +7,6 @@ matrix:
compiler: gcc
sudo: require
dist: trusty
- os: linux
env: ARCH=i386
compiler: gcc
sudo: require
dist: trusty
- os: osx
# Can't build on Windows - affected by https://travis-ci.community/t/current-known-issues-please-read-this-before-posting-a-new-topic/264/10
# - os: windows
@@ -31,4 +26,4 @@ after_success:
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/
- /^(?i:continuous)/
+22 -21
View File
@@ -5,39 +5,40 @@
GREP_PATH=grep
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
GREP_PATH=ggrep
GREP_PATH=ggrep
fi
if [ "$TRAVIS_TAG" != "" ]; then
fi
# Get current repo commit from GitHub (problems arose from trying to pipe cURL directly into grep, so we buffer it through a file)
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/olive-editor/olive/commits/master
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/olive-editor/olive/commits/master -o repo.txt
REMOTE=$($GREP_PATH -Po '(?<=: \")(([a-z0-9])\w+)(?=\")' -m 1 repo.txt)
REMOTE=$(curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/olive-editor/olive/commits/master | $GREP_PATH -Po '(?<=: \")(([a-z0-9])\w+)(?=\")' -m 1 --)
LOCAL=$(git rev-parse HEAD)
if [ "$REMOTE" == "$LOCAL" ]
if [ "$TRAVIS_TAG" != "" || "$REMOTE" == "$LOCAL" ]
then
echo "[INFO] Still current. Uploading..."
echo "[INFO] Still current. Uploading..."
# retrieve upload tool
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
# retrieve upload tool
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# upload final package
bash upload.sh Olive*.zip
# upload final package
bash upload.sh Olive*.zip
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# upload final package
bash upload.sh Olive*.AppImage*
fi
# upload final package
bash upload.sh Olive*.AppImage*
fi
else
echo "[INFO] No longer current. $REMOTE vs $LOCAL - aborting upload."
echo "[INFO] No longer current. $REMOTE vs $LOCAL - aborting upload."
fi
+6 -6
View File
@@ -2,10 +2,10 @@
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# install apt repos necessary for Olive
sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y
sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -y
sudo apt-get update -qq
# install apt repos necessary for Olive
sudo add-apt-repository ppa:beineri/opt-qt593-trusty -y
sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -y
sudo apt-get update -qq
fi
fi
+4 -11
View File
@@ -2,19 +2,12 @@
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install ffmpeg qt5 grep
export PATH="/usr/local/opt/qt/bin:/usr/local/opt/python@2/libexec/bin:$PATH"
brew install ffmpeg qt5 grep
export PATH="/usr/local/opt/qt/bin:/usr/local/opt/python@2/libexec/bin:$PATH"
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [ "$ARCH" == "x86_64" ]; then
sudo apt-get -y install qt59base qt59multimedia qt59svg libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev frei0r-plugins-dev fuse curl
fi
if [ "$ARCH" == "i386" ]; then
sudo apt-get -y install gcc-multilib g++-multilib qt59base:i386 qt59multimedia:i386 qt59svg:i386 libavformat-dev:i386 libavcodec-dev:i386 libavfilter-dev:i386 libavutil-dev:i386 libswscale-dev:i386 libswresample-dev:i386 frei0r-plugins-dev:i386 pkg-config:i386 libgl1-mesa-dev:i386 fuse:i386 curl
fi
source /opt/qt*/bin/qt*-env.sh
sudo apt-get -y install qt59base qt59multimedia qt59svg libavformat-dev libavcodec-dev libavfilter-dev libavutil-dev libswscale-dev libswresample-dev cmake
source /opt/qt*/bin/qt*-env.sh
fi
+12 -40
View File
@@ -2,53 +2,34 @@
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# generate translation files
lrelease olive.pro
# Generate Makefile
cmake .
# generate Makefile
qmake CONFIG+=release PREFIX=/usr
# run Makefile
# Make
make -j$(sysctl -n hw.ncpu)
# move Qt deps into bundle
# Move Qt deps into bundle
macdeployqt Olive.app
# fix other deps that macdeployqt missed
# Fix other deps that macdeployqt missed
wget -c -nv https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py
python2 macdeployqtfix.py Olive.app/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/
# move translations into bundle
mkdir Olive.app/Contents/Translations
mv ts/*.qm Olive.app/Contents/Translations
# move external effects into bundle
mkdir Olive.app/Contents/Effects
cp effects/shaders/* Olive.app/Contents/Effects
# distribute in zip
# Distribute in zip
zip -r Olive-$(git rev-parse --short HEAD)-macOS.zip Olive.app
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# generate translation files
lrelease olive.pro
# Generate Makefile
cmake .
# generate Makefile
if [ "$ARCH" == "i386" ]; then
# use extra compiler flags to force 32-bit build
qmake CONFIG+=release "QMAKE_CFLAGS+=-m32" "QMAKE_CXXFLAGS+=-m32" "QMAKE_LFLAGS+=-m32" PREFIX=/usr -spec linux-g++-32
else
qmake CONFIG+=release PREFIX=/usr
fi
# run Makefile
# Make
make -j$(nproc)
# use `make install` on `appdir` to place files in the correct place
# Use `make install` on `appdir` to place files in the correct place
make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/
# download linuxdeployqt
# Download linuxdeployqt
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
@@ -57,16 +38,7 @@ elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# linuxdeployqt uses this for naming the file
export VERSION=$(git rev-parse --short HEAD)
# use linuxdeployqt to set up dependencies
# Use linuxdeployqt to set up dependencies
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -extra-plugins=imageformats/libqsvg.so -appimage
# 64-bit linuxdeployqt can only generate a 64-bit AppImage
# to generate a 32-bit one, we need to download and run 32-bit AppImageTool
if [ "$ARCH" == "i386" ]; then
rm Olive*.AppImage
wget -c -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage"
chmod a+x appimagetool-i686.AppImage
./appimagetool-i686.AppImage "appdir" -n -g
fi
fi