2018-01-06 23:03:37 +00:00
|
|
|
language: python
|
2018-01-14 01:18:50 +00:00
|
|
|
virtualenv:
|
|
|
|
# We need this for PyGObject.
|
|
|
|
system_site_packages: true
|
2018-01-06 23:03:37 +00:00
|
|
|
matrix:
|
2018-01-24 03:15:09 +00:00
|
|
|
# only pass/fail the build based on the lint run, since the build takes
|
|
|
|
# a long time and its failure doesn't depend on the code anyway
|
|
|
|
fast_finish: true
|
|
|
|
allow_failures:
|
|
|
|
env: BUILD=true
|
|
|
|
|
2018-01-14 01:18:50 +00:00
|
|
|
include:
|
|
|
|
# always lint on every commit
|
|
|
|
- python: 2.7
|
|
|
|
env: LINT=true
|
|
|
|
sudo: false
|
2018-08-21 01:21:21 +00:00
|
|
|
if: type != cron
|
2018-01-14 01:18:50 +00:00
|
|
|
|
|
|
|
- python: 2.7
|
|
|
|
sudo: required
|
2018-02-20 02:43:39 +00:00
|
|
|
env: BUILD=linux
|
2018-08-21 01:21:21 +00:00
|
|
|
if: type != cron AND (tag =~ ^v[0-9.]+$ OR branch != master)
|
2018-02-20 02:43:39 +00:00
|
|
|
- python: 2.7
|
|
|
|
sudo: required
|
|
|
|
env: BUILD=windows
|
2019-04-12 05:41:14 +00:00
|
|
|
services: docker
|
2018-08-21 01:21:21 +00:00
|
|
|
if: type != cron AND (tag =~ ^v[0-9.]+$ OR branch != master)
|
2018-06-03 00:38:38 +00:00
|
|
|
- language: generic
|
|
|
|
os: osx
|
|
|
|
sudo: required
|
|
|
|
env: BUILD=osx
|
2018-08-21 01:21:21 +00:00
|
|
|
if: type != cron AND (tag =~ ^v[0-9.]+$ OR branch != master)
|
|
|
|
|
2018-09-18 00:20:38 +00:00
|
|
|
- language: python
|
2018-08-21 01:21:21 +00:00
|
|
|
sudo: false
|
|
|
|
env: CROWDIN=true
|
|
|
|
if: type = cron
|
2018-01-24 03:06:24 +00:00
|
|
|
branches:
|
|
|
|
except:
|
|
|
|
- /^dev-build-/
|
2019-04-11 03:38:43 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.cache/pip
|
|
|
|
- electron/node_modules
|
|
|
|
- $HOME/.cache/electron
|
2019-04-11 05:18:40 +00:00
|
|
|
- /var/cache/apt/archives
|
2018-01-06 23:03:37 +00:00
|
|
|
install:
|
2018-01-14 01:18:50 +00:00
|
|
|
- |
|
2018-04-28 14:34:18 +00:00
|
|
|
set -e
|
2018-01-14 01:18:50 +00:00
|
|
|
if [ -n "$BUILD" ]; then
|
2018-02-20 02:43:39 +00:00
|
|
|
# Need this for inkex.py and friends
|
2018-07-04 09:18:26 +00:00
|
|
|
wget -q https://inkscape.org/en/gallery/item/12187/inkscape-0.92.3.tar.bz2
|
2018-08-21 01:59:49 +00:00
|
|
|
tar -jxf inkscape-0.92.3.tar.bz2
|
2018-07-04 09:18:26 +00:00
|
|
|
rm inkscape-0.92.3.tar.bz2
|
2018-08-21 01:59:49 +00:00
|
|
|
mv inkscape-0.92.3 inkscape
|
2018-02-20 02:43:39 +00:00
|
|
|
fi
|
|
|
|
if [ "$BUILD" = "linux" ]; then
|
2018-01-14 01:18:50 +00:00
|
|
|
# For some bizarre reason, this build has been failing due to the
|
|
|
|
# key for the mongodb repo expiring. Maybe Travis includes the
|
|
|
|
# mongodb repo by default...?
|
2018-04-28 14:34:18 +00:00
|
|
|
sudo rm -f /etc/apt/sources.list.d/mongodb*.list
|
2018-01-14 01:18:50 +00:00
|
|
|
|
|
|
|
# for shapely
|
|
|
|
sudo apt-get install libgeos-dev
|
|
|
|
|
|
|
|
# for wxPython
|
|
|
|
sudo apt-get install glib-networking
|
|
|
|
|
|
|
|
# This is the same as the pypi module PyGObject. We can't just do
|
|
|
|
# "pip install PyGObject" because it depends on a version of
|
|
|
|
# libgirepository1.0-dev that doesn't exist in Trusty.
|
|
|
|
sudo apt-get install python-gi python-gi-cairo libgirepository1.0-dev
|
2018-07-14 00:03:26 +00:00
|
|
|
|
2018-01-14 01:18:50 +00:00
|
|
|
# wxPython doen't publish linux wheels in pypi
|
2018-07-04 09:18:26 +00:00
|
|
|
wget -q https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/wxPython-4.0.3-cp27-cp27mu-linux_x86_64.whl
|
|
|
|
pip install wxPython-4.0.3-cp27-cp27mu-linux_x86_64.whl
|
2018-07-14 00:03:26 +00:00
|
|
|
|
2018-01-14 01:18:50 +00:00
|
|
|
# We can't use the shapely wheel because it includes the geos
|
|
|
|
# library but with a weird file name. Details:
|
|
|
|
# https://github.com/pyinstaller/pyinstaller/blob/61b1c75c2b0469b32d114298a63bf60b8d597e37/PyInstaller/hooks/hook-shapely.py#L34
|
|
|
|
pip install --no-binary shapely -r requirements.txt
|
2018-07-14 00:03:26 +00:00
|
|
|
|
2018-09-11 21:58:32 +00:00
|
|
|
pip install pyinstaller==3.3.1
|
2018-02-20 02:43:39 +00:00
|
|
|
elif [ "$BUILD" = "windows" ]; then
|
|
|
|
set -x
|
|
|
|
|
|
|
|
sudo add-apt-repository ppa:ubuntu-wine/ppa -y
|
|
|
|
sudo apt-get update -qq
|
|
|
|
export DISPLAY=:99.0
|
|
|
|
sh -e /etc/init.d/xvfb start
|
|
|
|
sleep 3
|
2018-04-28 14:34:18 +00:00
|
|
|
sudo apt-get -q install -y wine
|
2018-02-20 02:43:39 +00:00
|
|
|
|
|
|
|
export WINEDEBUG=-all
|
|
|
|
|
|
|
|
wget -q http://download.microsoft.com/download/1/1/1/1116b75a-9ec3-481a-a3c8-1777b5381140/vcredist_x86.exe
|
|
|
|
wine vcredist_x86.exe /q
|
|
|
|
|
|
|
|
wget -q https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi --output-document=python.msi
|
|
|
|
wine msiexec /i python.msi /qn TARGETDIR=C:\\Python
|
|
|
|
|
2018-09-22 00:18:22 +00:00
|
|
|
wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install --upgrade pyinstaller==3.3.1
|
|
|
|
wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install --upgrade setuptools
|
2018-02-20 02:43:39 +00:00
|
|
|
|
|
|
|
wget -q https://github.com/lexelby/inkstitch-build-objects/releases/download/v1.0.0/Shapely-1.6.3-cp27-cp27m-win32.whl
|
|
|
|
wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install Shapely-1.6.3-cp27-cp27m-win32.whl
|
|
|
|
|
|
|
|
wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install -r requirements.txt
|
|
|
|
|
|
|
|
set +x
|
2018-06-03 00:38:38 +00:00
|
|
|
elif [ "$BUILD" = "osx" ]; then
|
2018-06-03 15:35:36 +00:00
|
|
|
set -x
|
2018-06-03 00:38:38 +00:00
|
|
|
brew update
|
2018-06-03 13:59:41 +00:00
|
|
|
#brew outdated python || brew upgrade python
|
2018-06-03 00:38:38 +00:00
|
|
|
|
|
|
|
# brew told me to do this
|
|
|
|
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages
|
|
|
|
|
|
|
|
# the 3 in pygobject3 signifies gtk3, not python3
|
|
|
|
brew install pygobject3 gtk+3
|
|
|
|
|
|
|
|
# for msgfmt
|
|
|
|
brew link gettext --force
|
|
|
|
|
|
|
|
export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/
|
|
|
|
|
2018-06-03 13:59:41 +00:00
|
|
|
pip install virtualenv
|
2018-06-03 03:04:31 +00:00
|
|
|
virtualenv -p python2 --system-site-packages venv
|
2018-06-03 00:38:38 +00:00
|
|
|
|
2018-08-01 09:30:59 +00:00
|
|
|
# activate virtual environment
|
2018-06-03 00:38:38 +00:00
|
|
|
source venv/bin/activate
|
|
|
|
|
|
|
|
pip install -r requirements.txt
|
2018-09-22 00:18:22 +00:00
|
|
|
pip install pyinstaller==3.3.1
|
2019-04-12 20:34:36 +00:00
|
|
|
|
2019-04-12 20:48:16 +00:00
|
|
|
set +x
|
|
|
|
|
2019-04-12 20:34:36 +00:00
|
|
|
nvm install node
|
|
|
|
nvm use node
|
2018-02-20 02:43:39 +00:00
|
|
|
elif [ -n "$LINT" ]; then
|
2018-01-14 01:18:50 +00:00
|
|
|
pip install flake8
|
|
|
|
fi
|
2018-01-06 23:03:37 +00:00
|
|
|
before_script:
|
2018-01-14 01:18:50 +00:00
|
|
|
- "echo LINT: $LINT BUILD: $BUILD"
|
2018-01-06 23:03:37 +00:00
|
|
|
script:
|
2018-01-14 01:18:50 +00:00
|
|
|
- |
|
2018-06-03 19:29:48 +00:00
|
|
|
if [ -n "$BUILD" -a "$DEBUG_BUILD" = "$BUILD" ]; then
|
2018-06-03 15:35:36 +00:00
|
|
|
mkdir .ssh
|
|
|
|
echo -e "${SSH_KEY}" > .ssh/id_rsa
|
|
|
|
chmod -R go-rwx .ssh
|
|
|
|
mkfifo fifo
|
|
|
|
( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) &
|
|
|
|
echo "opening debuging connection"
|
|
|
|
travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd
|
|
|
|
fi
|
2018-01-14 01:18:50 +00:00
|
|
|
if [ -n "$LINT" ]; then
|
2018-08-22 18:54:14 +00:00
|
|
|
make style
|
2018-06-03 00:38:38 +00:00
|
|
|
elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then
|
2018-06-03 19:17:45 +00:00
|
|
|
make dist
|
2018-02-20 02:43:39 +00:00
|
|
|
elif [ "$BUILD" = "windows" ]; then
|
|
|
|
# work around some bug... pyinstaller? shapely? not sure.
|
|
|
|
cp $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos_c.dll') $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos.dll')
|
|
|
|
make dist
|
2018-08-21 01:21:21 +00:00
|
|
|
elif [ -n "$CROWDIN" ]; then
|
|
|
|
git config --global user.email "inkstitch-crowdin@lex.gd"
|
|
|
|
git config --global user.name "Ink/Stitch Crowdin integration"
|
2018-08-22 00:14:29 +00:00
|
|
|
git checkout master
|
2018-08-21 01:21:21 +00:00
|
|
|
|
2018-08-22 00:07:00 +00:00
|
|
|
wget https://downloads.crowdin.com/cli/v2/crowdin-cli.zip
|
|
|
|
unzip -j crowdin-cli.zip
|
2018-09-15 17:01:58 +00:00
|
|
|
|
2018-09-18 00:43:23 +00:00
|
|
|
pip install flask==0.* jinja2 Babel ./pyembroidery
|
2018-09-15 17:01:58 +00:00
|
|
|
make messages.po
|
2018-09-18 01:08:22 +00:00
|
|
|
echo "uploading messages.po to crowdin"
|
|
|
|
java -jar crowdin-cli.jar -v upload -b master
|
2018-08-21 01:21:21 +00:00
|
|
|
|
2018-09-18 01:08:22 +00:00
|
|
|
|
|
|
|
echo "downloading new translations"
|
|
|
|
java -jar crowdin-cli.jar -v pull -b master
|
2018-08-21 01:21:21 +00:00
|
|
|
# Try to only commit if translations changed. Crowdin will update all
|
|
|
|
# files when a new translation string is added but we don't need to
|
|
|
|
# commit those until folks actually translate the new strings.
|
|
|
|
if git diff translations | grep -qE '^[-+]msgstr ".+"$'; then
|
|
|
|
git add translations
|
|
|
|
git commit -m "new translations from Crowdin"
|
|
|
|
git push https://${TRAVIS_REPO_SLUG%/*}:${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git master
|
|
|
|
fi
|
2018-01-14 01:18:50 +00:00
|
|
|
else
|
|
|
|
true
|
|
|
|
fi
|
2018-01-06 23:03:37 +00:00
|
|
|
notifications:
|
2018-01-14 01:18:50 +00:00
|
|
|
on_success: never
|
|
|
|
on_failure: never
|
2018-01-24 02:56:48 +00:00
|
|
|
before_deploy:
|
2018-08-17 19:47:25 +00:00
|
|
|
- |
|
|
|
|
if [[ !("$TRAVIS_TAG" =~ ^v[0-9.]+$) ]]; then
|
2018-08-17 19:52:55 +00:00
|
|
|
git tag -f dev-build-${TRAVIS_BRANCH//\//-}
|
|
|
|
git push -f https://${TRAVIS_REPO_SLUG%/*}:${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git dev-build-${TRAVIS_BRANCH//\//-}
|
2018-08-17 19:47:25 +00:00
|
|
|
fi
|
2018-01-14 01:18:50 +00:00
|
|
|
deploy:
|
|
|
|
- provider: releases
|
|
|
|
api_key:
|
|
|
|
secure: pYORXHcn0hPcMIo6+brVE+wYce272H4COp1iXmPvBUz64MAX0Bdm5UX6cTAvzwNd9Hhi2nnWebaoS5AiPelbZgQoZJXsy4whrp7+ZrkQZkhGcqsSqXN6j5k5xdGeFX4k37T7eGkFyajTAdIWB3locHcikKN6N6PnyCPxGD/xuxiD1fJSVKGqBOptBYsqFtMddKy3aT0nmRG/2pMElq2Fcxozo+rR00j2/3npVoh2VTRt2L0S/DrX3zKT4vi2+AQ1MmKEAfF/YxCPybJGPe+wHz4egs0+PIJYb7pSZL8Ja81IS4v5cmmy/r2la815amyRyXwZXbJwBX8h9wPa7dwGStMvJdUidlqaXjKMsWba3QbD6YHOi0+UOFvWeubCDqXKhqxVAvZyCvXCx2WPlBfGWsJDHK/j2pU5Iul5Jz2Zsa3PLYA3UeGWVy081SZNuklNdccKGTokntFnR3pGM/jDN/JK7RkvuPM5qQqn3gludQnrdo/Kw0I77hAEDasgUyO8cweSfyqOXBN0dkbLjfBVRslRRRuC5fV9MIqFvLclaPfMlxsSTdDO4MGJRsF7VvFySBdh0xK7Rm+Vb9jYjCR3FV+b8TRsnY0eD2eFM+rmQt/OYdNIs6emVrTXCcAIzq4JoKZdFDIDDRsiztGSjIBB0+rSXmiUMtCiUo5GS/7zxGs=
|
|
|
|
file:
|
|
|
|
- '*.tar.gz'
|
2018-02-23 05:00:33 +00:00
|
|
|
- '*.zip'
|
2018-01-14 01:18:50 +00:00
|
|
|
file_glob: true
|
|
|
|
skip_cleanup: true
|
|
|
|
on:
|
2018-01-14 02:04:41 +00:00
|
|
|
tags: true
|
|
|
|
all_branches: true
|
2018-01-14 03:46:44 +00:00
|
|
|
condition: '(-n $BUILD) && ($TRAVIS_TAG =~ ^v[0-9.]+$)'
|
2018-01-14 01:18:50 +00:00
|
|
|
- provider: releases
|
|
|
|
api_key:
|
|
|
|
secure: pYORXHcn0hPcMIo6+brVE+wYce272H4COp1iXmPvBUz64MAX0Bdm5UX6cTAvzwNd9Hhi2nnWebaoS5AiPelbZgQoZJXsy4whrp7+ZrkQZkhGcqsSqXN6j5k5xdGeFX4k37T7eGkFyajTAdIWB3locHcikKN6N6PnyCPxGD/xuxiD1fJSVKGqBOptBYsqFtMddKy3aT0nmRG/2pMElq2Fcxozo+rR00j2/3npVoh2VTRt2L0S/DrX3zKT4vi2+AQ1MmKEAfF/YxCPybJGPe+wHz4egs0+PIJYb7pSZL8Ja81IS4v5cmmy/r2la815amyRyXwZXbJwBX8h9wPa7dwGStMvJdUidlqaXjKMsWba3QbD6YHOi0+UOFvWeubCDqXKhqxVAvZyCvXCx2WPlBfGWsJDHK/j2pU5Iul5Jz2Zsa3PLYA3UeGWVy081SZNuklNdccKGTokntFnR3pGM/jDN/JK7RkvuPM5qQqn3gludQnrdo/Kw0I77hAEDasgUyO8cweSfyqOXBN0dkbLjfBVRslRRRuC5fV9MIqFvLclaPfMlxsSTdDO4MGJRsF7VvFySBdh0xK7Rm+Vb9jYjCR3FV+b8TRsnY0eD2eFM+rmQt/OYdNIs6emVrTXCcAIzq4JoKZdFDIDDRsiztGSjIBB0+rSXmiUMtCiUo5GS/7zxGs=
|
|
|
|
file:
|
|
|
|
- '*.tar.gz'
|
2018-02-20 02:43:39 +00:00
|
|
|
- '*.zip'
|
2018-01-14 01:18:50 +00:00
|
|
|
file_glob: true
|
|
|
|
skip_cleanup: true
|
|
|
|
prerelease: true
|
2018-01-24 02:56:48 +00:00
|
|
|
overwrite: true
|
|
|
|
target_commitish: $TRAVIS_COMMIT
|
|
|
|
name: "development build of '$TRAVIS_BRANCH'"
|
|
|
|
body: Automatic development build of $TRAVIS_BRANCH ($TRAVIS_COMMIT) built on $(date +'%F %T %Z').
|
2018-01-14 01:18:50 +00:00
|
|
|
on:
|
|
|
|
all_branches: true
|
2018-01-24 02:56:48 +00:00
|
|
|
condition: '(-n $BUILD) && ! ("$TRAVIS_TAG" =~ ^v[0-9.]+$) && ! ("$TRAVIS_BRANCH" = master)'
|