Set up Travis-CI build scripts

This commit is contained in:
David Vierra 2016-08-20 23:29:24 -10:00
parent 9b60287eb2
commit 9a92ebbcde
2 changed files with 36 additions and 14 deletions

View File

@ -1,17 +1,18 @@
language: python os:
- osx
osx_image: xcode8
language: generic
# Use new container-based Travis infrastructure. # Use new container-based Travis infrastructure.
sudo: false sudo: false
# Cache pip packages. `cache: pip` does not work with custom install steps. # Cache pip packages. `cache: pip` does not work with custom install steps.
cache: cache:
directories: directories:
- $HOME/.cache/pip - $HOME/Library/Caches/pip
- $HOME/.pip-accel
os:
- linux
python:
- "2.7"
install: install:
# Install wheel, upgrade pip to use wheel-cache # Install wheel, upgrade pip to use wheel-cache
@ -20,14 +21,28 @@ install:
# Download-progress bars break Travis's log view. Disable them by piping output # 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) # through another program (if output is not a tty, no progress bars)
# Install dependencies. # Install dependencies.
- pip install -r requirements-mceditlib.txt | cat - pip install -r requirements.txt | cat
# Install dependencies for tests. # Install dependencies for tests.
- pip install -r tests/requirements.txt | cat - pip install -r tests/requirements.txt | cat
# Install mceditlib. - pip install git+http://github.com/pyinstaller/pyinstaller
- python setup_mceditlib.py develop
- brew install pyside pyside-tools
# Install mcedit.
- python setup.py develop
script: script:
- py.test -n 5 tests - 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

View File

@ -33,7 +33,7 @@ if 'APPVEYOR_BUILD_FOLDER' in os.environ:
arch_plat = os.environ.get('PYTHON_ARCH_PLAT') arch_plat = os.environ.get('PYTHON_ARCH_PLAT')
if arch_plat is None: if arch_plat is None:
_arch = platform.architecture()[0][:2] _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 arch_plat = _plat + _arch
@ -70,6 +70,7 @@ with file("src/mcedit2/_version.py", "w") as f:
dist_folder_name = "mcedit2-%s-%s" % (arch_plat, build_version) dist_folder_name = "mcedit2-%s-%s" % (arch_plat, build_version)
sfx_exe_name = dist_folder_name + ".exe" sfx_exe_name = dist_folder_name + ".exe"
dist_zip_name = dist_folder_name + ".zip"
# --- Install mcedit2 in develop-mode and rebuild extensions --- # --- Install mcedit2 in develop-mode and rebuild extensions ---
@ -219,3 +220,9 @@ if is_win:
], ],
cwd="dist") 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"
)