Skip to content

Commit

Permalink
Set up Travis-CI build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
codewarrior0 committed Aug 24, 2016
1 parent 9b60287 commit 9a92ebb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
43 changes: 29 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
language: python
os:
- osx

osx_image: xcode8

language: generic

# Use new container-based Travis infrastructure.
sudo: false

# Cache pip packages. `cache: pip` does not work with custom install steps.
cache:
directories:
- $HOME/.cache/pip

os:
- linux

python:
- "2.7"

- $HOME/Library/Caches/pip
- $HOME/.pip-accel

install:
# Install wheel, upgrade pip to use wheel-cache
Expand All @@ -20,14 +21,28 @@ install:
# Download-progress bars break Travis's log view. Disable them by piping output
# through another program (if output is not a tty, no progress bars)
# Install dependencies.
- pip install -r requirements-mceditlib.txt | cat
- pip install -r requirements.txt | cat

# Install dependencies for tests.
- pip install -r tests/requirements.txt | cat

# Install mceditlib.
- python setup_mceditlib.py develop
- pip install git+http://github.com/pyinstaller/pyinstaller

script:
- py.test -n 5 tests
- brew install pyside pyside-tools
# Install mcedit.
- python setup.py develop

script:
- if [ "${TRAVIS_TAG}x" = "x" ]; then return 0; fi
- export MCEDIT_BUILD_VERSION=${TRAVIS_TAG}
- pyinstaller mcedit2.spec

# Deploy to GitHub Releases
deploy:
provider: releases
api_key: $GITHUB_AUTH_TOKEN
file: dist/mcedit2-*.zip
file_glob: true
skip_cleanup: true
on:
tags: true
9 changes: 8 additions & 1 deletion mcedit2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if 'APPVEYOR_BUILD_FOLDER' in os.environ:
arch_plat = os.environ.get('PYTHON_ARCH_PLAT')
if arch_plat is None:
_arch = platform.architecture()[0][:2]
_plat = "win" if sys.platform == 'win32' else os.name
_plat = "win" if sys.platform == 'win32' else "macosx" if sys.platform == 'darwin' else sys.platform

arch_plat = _plat + _arch

Expand Down Expand Up @@ -70,6 +70,7 @@ with file("src/mcedit2/_version.py", "w") as f:

dist_folder_name = "mcedit2-%s-%s" % (arch_plat, build_version)
sfx_exe_name = dist_folder_name + ".exe"
dist_zip_name = dist_folder_name + ".zip"

# --- Install mcedit2 in develop-mode and rebuild extensions ---

Expand Down Expand Up @@ -219,3 +220,9 @@ if is_win:
],
cwd="dist")

if is_osx:
dist_zip_path = path.join("dist", dist_zip_name)
subprocess.check_call(
["zip", "-r", dist_zip_name, dist_folder_name],
cwd="dist"
)

0 comments on commit 9a92ebb

Please sign in to comment.