Skip to content

Commit 1642a3b

Browse files
committed
add travis CI
1 parent 5e8ad47 commit 1642a3b

File tree

4 files changed

+224
-0
lines changed

4 files changed

+224
-0
lines changed

.travis.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
language: c++
2+
3+
branches:
4+
except:
5+
- automatic
6+
7+
cache:
8+
directories:
9+
- download
10+
11+
matrix:
12+
include:
13+
- os: linux
14+
sudo: required
15+
dist: bionic
16+
env:
17+
- _BUILD=win32
18+
- _MINGW=mingw32
19+
- _HOST=i686-w64-mingw32
20+
before_install:
21+
- docker pull jpcima/arch-mingw
22+
install:
23+
- container=$(docker run -d -i -t -v /home:/home jpcima/arch-mingw /bin/bash)
24+
- |
25+
cross() {
26+
docker exec -w "$(pwd)" -e "_BUILD=$_BUILD" -e "_MINGW=$_MINGW" -e "_HOST=$_HOST" -i -t "$container" "$@"
27+
}
28+
script:
29+
- cross bash .travis/script-mingw.sh
30+
- cp -drfv bin string-machine-"$_BUILD"
31+
- rm -f string-machine-"$_BUILD"/README
32+
- install -d release
33+
- zip -9 -r release/string-machine-"$_BUILD".zip string-machine-"$_BUILD"
34+
- os: linux
35+
sudo: required
36+
dist: bionic
37+
env:
38+
- _BUILD=win64
39+
- _MINGW=mingw64
40+
- _HOST=x86_64-w64-mingw32
41+
before_install:
42+
- docker pull jpcima/arch-mingw
43+
install:
44+
- container=$(docker run -d -i -t -v /home:/home jpcima/arch-mingw /bin/bash)
45+
- |
46+
cross() {
47+
docker exec -w "$(pwd)" -e "_BUILD=$_BUILD" -e "_MINGW=$_MINGW" -e "_HOST=$_HOST" -i -t "$container" "$@"
48+
}
49+
script:
50+
- cross bash .travis/script-mingw.sh
51+
- cp -drfv bin string-machine-"$_BUILD"
52+
- rm -f string-machine-"$_BUILD"/README
53+
- install -d release
54+
- zip -9 -r release/string-machine-"$_BUILD".zip string-machine-"$_BUILD"
55+
# - os: osx
56+
# sudo: required
57+
# env:
58+
# - _BUILD=macos
59+
# script:
60+
# - bash .travis/script-macos.sh
61+
# - cp -av bin string-machine-"$_BUILD"
62+
# - rm -f string-machine-"$_BUILD"/README
63+
# - install -d release
64+
# - zip -9 -r release/string-machine-"$_BUILD".zip string-machine-"$_BUILD"
65+
- os: linux
66+
sudo: required
67+
dist: trusty
68+
env:
69+
- _BITS=64
70+
- _BUILD=linux64
71+
before_install:
72+
- sudo apt-get update -qq
73+
install:
74+
- sudo apt-get install checkinstall libcairo2-dev libboost-dev
75+
script:
76+
- bash .travis/script-linux.sh
77+
- cp -drfv bin string-machine-"$_BUILD"
78+
- rm -f string-machine-"$_BUILD"/README
79+
- install -d release
80+
- zip -9 -r release/string-machine-"$_BUILD".zip string-machine-"$_BUILD"
81+
- echo "Digital model of electronic string ensemble instrument" > description-pak
82+
- sudo checkinstall --type=debian --install=no --default --pkgname=string-machine --pkgversion="`git describe --abbrev=0 | sed 's/^v//'``git log -n 1 --pretty=format:"+%cd~git%h" --date=short master | sed 's/-//g'`" --pkgarch=amd64 --pkgrelease=0jpc1 --pkglicense=BSL-1.0 --pkggroup=sound --maintainer="[email protected]" --nodoc
83+
- sudo mv -f *.deb release/string-machine-"$_BUILD".deb
84+
85+
before_script:
86+
- sed -i~ 's%/usr/local%/usr%g' plugins/*/Makefile
87+
88+
before_deploy:
89+
- |
90+
if test "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false"; then
91+
export TRAVIS_TAG=automatic
92+
git tag -f "$TRAVIS_TAG"
93+
fi
94+
95+
deploy:
96+
provider: releases
97+
api_key: "$GITHUB_TOKEN"
98+
file: release/*
99+
file_glob: true
100+
skip_cleanup: true
101+
prerelease: true
102+
overwrite: true
103+
on:
104+
branch: master
105+
106+
env:
107+
global:
108+
secure: BzrfWX+zI9Ww+T1Dj1k04tomPVoMucUYwIOeaG3NkwL3CDEo98/s3GDSGRa6CQMRz9R2oT/ljXecNShb0jaueToTPA+MpbRg93WjhbeETyc0tLmttIswHjwsAZ8gDx1gfhFJ5cdxxpmoWGmT+mO5f72HxH5PT1icTdnmPFbxAq6abSR9VMV5+hVNwS9OdMTVxow4JLbVwx9w//JmWDpWP752SiNayPAoMZp5pELszqPsUawZH+AMY3X/1m69T6MU+wsWX5pdChHOlSl6jWBobetd3tojOrCamV8XNQsyeu8WMhd9hjIJU786AzwcY2S2XXpR1Qjrngo8L0mCSbDs0szwJtPgec/R2myxdJV/u2+howqNbhBuKzbJwsEL4kqhCEKvasuL9I2rG2tGc3p7Z/2YFNiisZW4TcEC23Eu02aAR3Emv/2JooIhzJfm9X4nMCz/tTpvOKrPltgiI9dQiH+JQ/53QCpGYFhlBYkmnngICrdpum9U1yjyHL4tL/a++UYXkBaezC0eU8TjtNtVR2l25Tjc5IQsiGHFiwK5IYe0yDeTEKd+EGgxfubtWpAdL4oKjRBDzaaaMaTAH5w+/8lT1+E6E3USVOWDA+RHKnAUTx0uLUuGWCojHcJ+PilrMKelaY4YDuGmFd7zfiTuqMM7cK6KYIrgLGz7cExEgTc=

.travis/script-linux.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# ---------------------------------------------------------------------------------------------------------------------
4+
# stop on error
5+
6+
set -e
7+
8+
# ---------------------------------------------------------------------------------------------------------------------
9+
# print shell commands
10+
11+
set -x
12+
13+
# ---------------------------------------------------------------------------------------------------------------------
14+
# set variables
15+
16+
test ! -z "$_BITS"
17+
18+
# ---------------------------------------------------------------------------------------------------------------------
19+
# setup
20+
21+
export PKG_CONFIG="pkg-config"
22+
23+
case "$_BITS" in
24+
32)
25+
export PKG_CONFIG_LIBDIR="/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
26+
;;
27+
64)
28+
export PKG_CONFIG_LIBDIR="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig"
29+
;;
30+
esac
31+
32+
export CFLAGS="-m$_BITS"
33+
export CXXFLAGS="-m$_BITS"
34+
export LDFLAGS="-m$_BITS"
35+
36+
# ---------------------------------------------------------------------------------------------------------------------
37+
# build the plugin
38+
39+
LINUX=true make $MAKE_ARGS

.travis/script-macos.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# ---------------------------------------------------------------------------------------------------------------------
4+
# stop on error
5+
6+
set -e
7+
8+
# ---------------------------------------------------------------------------------------------------------------------
9+
# print shell commands
10+
11+
set -x
12+
13+
# ---------------------------------------------------------------------------------------------------------------------
14+
# setup
15+
16+
export PKG_CONFIG="pkg-config --static"
17+
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"
18+
19+
export PATH=/opt/local/bin:"$PATH"
20+
21+
export CFLAGS="-I/opt/local/include"
22+
export CXXFLAGS="-I/opt/local/include"
23+
export LDFLAGS="-L/opt/local/lib"
24+
25+
# ---------------------------------------------------------------------------------------------------------------------
26+
# build the plugin
27+
28+
# TODO setup cairo UI build...
29+
MACOS=true make $MAKE_ARGS

.travis/script-mingw.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
# ---------------------------------------------------------------------------------------------------------------------
4+
# stop on error
5+
6+
set -e
7+
8+
# ---------------------------------------------------------------------------------------------------------------------
9+
# print shell commands
10+
11+
set -x
12+
13+
# ---------------------------------------------------------------------------------------------------------------------
14+
# set variables
15+
16+
test ! -z "$_MINGW"
17+
test ! -z "$_HOST"
18+
19+
# ---------------------------------------------------------------------------------------------------------------------
20+
# setup
21+
22+
export AR="$_HOST"-ar
23+
export RANLIB="$_HOST"-ranlib
24+
export CC="$_HOST"-gcc
25+
export CXX="$_HOST"-g++
26+
export STRIP="$_HOST"-strip
27+
export WINDRES="$_HOST"-windres
28+
export PKG_CONFIG="$_HOST"-pkg-config
29+
30+
export PKG_CONFIG="$PKG_CONFIG --static"
31+
32+
export PATH=/opt/"$_MINGW"/"$_HOST"/bin:/opt/"$_MINGW"/bin:"$PATH"
33+
34+
export CFLAGS="-I/opt/$_MINGW/include"
35+
export CXXFLAGS="-I/opt/$_MINGW/include"
36+
export LDFLAGS="-L/opt/$_MINGW/lib"
37+
38+
# ---------------------------------------------------------------------------------------------------------------------
39+
# prepare
40+
41+
# invoke the Windows ttl generator using wine
42+
sed -i 's/"$GEN"/wine "$GEN"/g' dpf/utils/generate-ttl.sh
43+
44+
# ---------------------------------------------------------------------------------------------------------------------
45+
# build the plugin
46+
47+
# TODO setup cairo UI build...
48+
CROSS_COMPILING=true WINDOWS=true make $MAKE_ARGS

0 commit comments

Comments
 (0)