diff --git a/.travis.yml b/.travis.yml index 603152e..1064c63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 + + - brew install pyside pyside-tools + # Install mcedit. + - python setup.py develop 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 \ No newline at end of file diff --git a/mcedit2.spec b/mcedit2.spec index 4a6fbdb..873268f 100644 --- a/mcedit2.spec +++ b/mcedit2.spec @@ -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 @@ -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 --- @@ -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" + )