From 2db19fef511a1189afb34460aca771428b3cd625 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Fri, 18 Dec 2015 20:06:17 +0100
Subject: [PATCH] Finally ?

---
 .travis.yml                 | 37 +++++++++++++++++++------------------
 ci/travis/before_install.sh |  5 +++--
 ci/travis/build.sh          |  9 +++++++++
 3 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6161593c..62d55ebc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,25 +1,26 @@
 os: osx
 env:
-  - PYENV_PYTHON_VERSION=3.5.0
+- PYENV_PYTHON_VERSION=3.5.0
+cache:
+  directories:
+  - "$HOME/.pyenv"
 before_install:
-  # Install and configure pyenv
-  - ci/travis/before_install.sh
-
+- alias enable_pyenv=eval "$(pyenv virtualenv-init -)"
+- ci/travis/before_install.sh
 install:
-  - pyenv activate sakia-env
-  - pip install coveralls cx_Freeze
-  - pip install -r requirements.txt
-  - python gen_resources.py
-  - python gen_translations.py
-  - python setup.py build
-
+- ci/travis/build.sh
 script:
-  - coverage run --source=sakia.core,sakia.gui,sakia.models run_tests.py
-
+- ci/travis/test.sh
 after_success:
-  - coverage -rm
-  - coveralls
+- ci/travis/after_success.sh
 
-cache:
-  directories:
-    - $HOME/.pyenv
\ No newline at end of file
+before_deploy: zip -r sakia-${TRAVIS_OS_NAME}.zip build/
+
+deploy:
+  provider: releases
+  api_key:
+    secure: MUdvTDBeCxO9d/EpzIhr+QYra/KxgYkXX6177SjqWCWDqw9xB3fwSUj8I9ht9DGtwVdadtveumtvLw3pbtVIR0GtIPC9pyvtNz4j6T4Ei3TSE6+StXdMK4NnInvPeTRlobGL+9sZt9MwheJwZ8YGewhBcR0F5UzVfxWeSSrxmyk=
+  file: sakia-${TRAVIS_OS_NAME}.zip
+  skip_cleanup: true
+  on:
+    tags: true
diff --git a/ci/travis/before_install.sh b/ci/travis/before_install.sh
index d2aa248f..9fe61b7d 100755
--- a/ci/travis/before_install.sh
+++ b/ci/travis/before_install.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 
 brew update
 brew install libsodium
@@ -12,7 +13,7 @@ eval "$(pyenv virtualenv-init -)"
 pyenv activate sakia-env
 if [ $? -ne 0 ]
 then
-    echo "Installing pyenv"
+    echo "Sakia env cache cleared, rebuilding it..."
     env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install $PYENV_PYTHON_VERSION
 
     pyenv shell $PYENV_PYTHON_VERSION
@@ -35,7 +36,7 @@ then
     cd PyQt-gpl-5.5.1/
     pyenv activate sakia-env
     python configure.py --verbose --confirm-license
-    make && make install
+    make -j 2 && make install
     pyenv rehash
 
     cd $HOME/sakia
diff --git a/ci/travis/build.sh b/ci/travis/build.sh
index e69de29b..07c77ae2 100755
--- a/ci/travis/build.sh
+++ b/ci/travis/build.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+eval "$(pyenv virtualenv-init -)"
+
+pyenv activate sakia-env
+pip install coveralls cx_Freeze
+pip install -r requirements.txt
+python gen_resources.py
+python gen_translations.py
+python setup.py bdist_dmg
\ No newline at end of file
-- 
GitLab