add support for CI for Linux on Travis CI (just for status)

NOTE: it is not as easy as Windows to package an app on Linux. The
portable package could NOT run on Linux. Just for reference here.
This commit is contained in:
Le Tan 2017-03-09 21:51:52 +08:00
parent 733786fbb0
commit c714c28be3
5 changed files with 132 additions and 1 deletions

30
.linux_bintray.json Normal file
View File

@ -0,0 +1,30 @@
{
"package": {
"name": "vnote",
"repo": "vnote",
"subject": "tamlok",
"desc": "Continuous deployment by Travis-CI",
"website_url": "https://github.com/tamlok/vnote",
"issue_tracker_url": "https://github.com/tamlok/vnote/issues",
"vcs_url": "https://github.com/tamlok/vnote.git",
"github_use_tag_release_notes": false,
"github_release_notes_file": "",
"licenses": ["MIT"],
"labels": ["Markdown", "Note-Taking", "Office", "Utils", "Efficiency"],
"public_download_numbers": true,
"public_stats": true
},
"version": {
"name": "1.0",
"desc": "VNote v1.0",
"released": "2017-01-25",
"vcs_tag": "1.0",
"gpgSign": false
},
"files":
[{"includePattern": "build/distrib/(VNote_.*_linux_x86_64_portable.tar.gz)", "uploadPattern": "$1"}],
"publish": true
}

38
.travis.yml Normal file
View File

@ -0,0 +1,38 @@
dist: trusty
sudo: required
git:
depth: 1
language: cpp
compiler: g++
env:
- version="1.0"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
before_install:
- sudo apt-get -qq update
install:
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
p7zip-full
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
chrpath
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install
tree
before_script:
- chmod +x .travis_linux.sh
script:
- TAG_NAME=${TRAVIS_TAG} CXX="g++-6" CC="gcc-6" ./.travis_linux.sh
deploy:
provider: bintray
file: "./.linux_bintray.json"
user: tamlok
key:
secure: vADlrYSusARnHxK3NTT3r1r6I/lrxyEuFKLOO73KXl6rvDywrrDDi6YsFekL14/o3clZKLOC8LbvA+4BKPVSoGTO4Dpx/i51fXphf+mMFB3QXSGnbqHm4+2ZnhCl62vfVlFeOPBLDO0KUBI8DCP0I+QogOUickXv3zYx69z6AudSxgjY7nPoN5jGSPgyId4r3o8Shrj1Fk1WtN6qciKyPne57v+jmvRlJTkoEfYkvwTRNMBlmaKy8Vj/CSoIvB8TH8bv3rhHLrN4o1QCwePdaX9G7xlImSpXqgRgzQVU3SRFN2bYTj5DZc1aFyA7iNOhmwgCLAN6OrqXyyJCbyywNhylfgad2rQANcfXiZw9ywooKEYafLDRuiK2G6Pk8m+R6Ded9JBoX9MSz/ZDxxfk4NmLO991wS7IK5aFTQfHZz5W8Tmh1rCphFwlDI/Rxs7ExbXu7INA8IhoLpOSmLIA5lfdC4fD8rv8mjy5gfpMkWlP8XATfi2eMH9uGj89aJa6xp7Bc2mfW3M71YHtYP/pyE/7Bk5vVonP8Cq9rK6OruMIUYtNmXoJnpte20ecSXj9yw7oTR27dhSx3XuAKOXiNpIau0CPxtXA5cSm5X0OS1Lt8RWrms0jp9Ch2dgxlNMpr0soF9DmwekhfHnVoOLyFBWBMDwvkx5TWij9FNAAJb4=
dry-run: true
on: master

59
.travis_linux.sh Normal file
View File

@ -0,0 +1,59 @@
#!/bin/bash
project_dir=$(pwd)
qt_install_dir=/opt
version="${version}.${TRAVIS_BUILD_NUMBER}"
cd ${qt_install_dir}
sudo wget https://github.com/adolby/qt-more-builds/releases/download/5.7/qt-opensource-5.7.0-linux-x86_64.7z
sudo 7z x qt-opensource-5.7.0-linux-x86_64.7z &> /dev/null
PATH=${qt_install_dir}/Qt/5.7/gcc_64/bin/:${PATH}
cd ${project_dir}
mkdir build
cd build
qmake -v
qmake -config release -spec linux-g++-64 ../VNote.pro
make
mkdir -p distrib/VNote
cd distrib/VNote
# Copy VNote executable
cp ../../src/VNote ./
# Copy ICU libraries
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicui18n.so.56.1" "libicui18n.so.56"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicuuc.so.56.1" "libicuuc.so.56"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libicudata.so.56.1" "libicudata.so.56"
mkdir platforms
cp "${qt_install_dir}/Qt/5.7/gcc_64/plugins/platforms/libqxcb.so" "platforms/libqxcb.so"
cp "${qt_install_dir}/Qt/5.7/gcc_64/plugins/platforms/libqminimal.so" "platforms/libqminimal.so"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebEngineWidgets.so.5.7.0" "libQt5WebEngineWidgets.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebEngineCore.so.5.7.0" "libQt5WebEngineCore.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Widgets.so.5.7.0" "libQt5Widgets.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5WebChannel.so.5.7.0" "libQt5WebChannel.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Core.so.5.7.0" "libQt5Core.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Gui.so.5.7.0" "libQt5Gui.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5DBus.so.5.7.0" "libQt5DBus.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5XcbQpa.so.5.7.0" "libQt5XcbQpa.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Qml.so.5.7.0" "libQt5Qml.so.5"
cp "${qt_install_dir}/Qt/5.7/gcc_64/lib/libQt5Network.so.5.7.0" "libQt5Network.so.5"
# Use chrpath to set up rpaths for Qt's libraries so they can find
# each other
chrpath -r \$ORIGIN/.. platforms/libqxcb.so
chrpath -r \$ORIGIN/.. platforms/libqminimal.so
# Copy other project files
cp "${project_dir}/README.md" "README.md"
cp "${project_dir}/LICENSE" "LICENSE"
echo ${version} > version
echo "${TRAVIS_COMMIT}" >> version
# Package portable executable
cd ..
tar -czvf VNote_${version}_linux_x86_64_portable.tar.gz VNote
exit 0

View File

@ -23,6 +23,9 @@ VNote提供定期释出的稳定版本以及总是保持最新的滚(wen)动(
## Linux
[![Build Status](https://travis-ci.org/tamlok/vnote.svg?branch=master)](https://travis-ci.org/tamlok/vnote)
**NOT** ready yet! Please help yourself to compile and build it from sources.
## MacOS

View File

@ -38,7 +38,8 @@ after_build:
- copy "%APPVEYOR_BUILD_FOLDER%\build\src\release\VNote.exe" "distrib\VNote\VNote.exe"
- copy "%APPVEYOR_BUILD_FOLDER%\README.md" "distrib\VNote\README.md"
- copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" "distrib\VNote\LICENSE.txt"
- echo %APPVEYOR_REPO_COMMIT% > "distrib\VNote\version.txt"
- echo %APPVEYOR_BUILD_VERSION% > "distrib\VNote\version.txt"
- echo %APPVEYOR_REPO_COMMIT% >> "distrib\VNote\version.txt"
- cd distrib
- 7z a vnote_win_x86_64_portable_%APPVEYOR_BUILD_VERSION%.zip VNote