"tests/regression/benchmarks/utils.py" did not exist on "d2e1cfced0cdba7198755d4fbd58b8fac1d39856"
Commit 282fd4e6 authored by Guolin Ke's avatar Guolin Ke
Browse files

support release by CI

parent 30aa3cf2
import os
import sys
import distutils
from distutils import file_util
if not os.path.exists("lib"):
os.makedirs("lib")
if not os.path.exists("lib/native"):
os.makedirs("lib/native")
if not os.path.exists("lib/net40"):
os.makedirs("lib/net40")
if not os.path.exists("lib/net45"):
os.makedirs("lib/net45")
distutils.file_util.copy_file("../Release/lightgbm.exe", "./lib/")
distutils.file_util.copy_file("../Release/lib_lightgbm.dll", "./lib/")
version = open('../VERSION.txt').read().strip()
nuget_str = '''<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>LightGBM</id>
<version>%s</version>
<authors>Guolin Ke</authors>
<owners>Guolin Ke</owners>
<licenseUrl>https://github.com/Microsoft/LightGBM/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Microsoft/LightGBM</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A fast, distributed, high performance gradient boosting framework</description>
<copyright>Copyright 2017 @ Microsoft</copyright>
<tags>machine-learning data-mining distributed native boosting gbdt</tags>
<dependencies> </dependencies>
</metadata>
<files>
<file src="lib\**" target="lib"/>
</files>
</package>
''' % (version)
nuget_file = open("LightGBM.nuspec", "w")
nuget_file.write(nuget_str)
nuget_file.close()
...@@ -42,3 +42,17 @@ script: ...@@ -42,3 +42,17 @@ script:
notifications: notifications:
email: false email: false
deploy:
provider: releases
api-key:
secure: "idU9Fb/yUz7VsVOEb0vGR8qqxcvXr4eh1tMzkKiMWLRx5XNeq7RCUzfKAPMIizFkML9zdMh/5vPtZ1Zs++3oWPpbZE2/o4CURoE+BvwDUyEDrKTdNSGoWgWZq0QLjfahj/PR8ObWlU+XCHqRQzKXlwbynwwUGRpOJrlEY0To5Kt9gTV5W8MxSlW7xFU2TTmMa499IZut38OuenJ3Nm9mTe6MCHFW4Y5uGp/gwNuBYfqzwUXDi6h/cJiJJD5drwtNnSneFZ2PZplrKxJxSJdSQ2aHttU+Wr8xogi9hLI/H6OA4UYCF69HrWOLSggplkZt6qUzaG7UfYyid4m6YbeKMUQRNBuGXhYVGr5qkyAzqXiOesGAef550346pWEZNGPLfNnKAwqPgkp8Q8tV9i0srjzyttqFAlLqhA76yST3kuX+QS0VGepSUTV+kkfxCaHZagxtX9Xve5RNybu4B44UmHWIGJnS6ijYpxWKwvWnMmBCIezFbZYyqsiXYC+9d5RfBgNFQ4PlRfmY0vnJlwUhx1AnyL9jsxnthwl9CNczo4mgBqnCSXxlhXNHz6ToMQuhgdhnqm5+qqJzI5/eUugxh8CW18qZTZBkrnL4DxEMm+bQ2QT8O07ZHrEDPKPXxQw7tBsphWvECetJ4DxXfNaf59GrY+eD6TFZuxurB5Vvo6s="
file_glob: true
file: python-package/dist/*.whl
skip_cleanup: true
draft: true
tag_name: $TRAVIS_TAG
on:
condition: "$TASK = pip"
tags: true
all_branches: true
...@@ -39,6 +39,12 @@ if [[ ${TASK} == "pip" ]]; then ...@@ -39,6 +39,12 @@ if [[ ${TASK} == "pip" ]]; then
cd $TRAVIS_BUILD_DIR/python-package && python setup.py sdist || exit -1 cd $TRAVIS_BUILD_DIR/python-package && python setup.py sdist || exit -1
cd $TRAVIS_BUILD_DIR/python-package/dist && pip install lightgbm-$LGB_VER.tar.gz -v || exit -1 cd $TRAVIS_BUILD_DIR/python-package/dist && pip install lightgbm-$LGB_VER.tar.gz -v || exit -1
cd $TRAVIS_BUILD_DIR && pytest tests/python_package_test || exit -1 cd $TRAVIS_BUILD_DIR && pytest tests/python_package_test || exit -1
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
cd $TRAVIS_BUILD_DIR/python-package && python setup.py bdist_wheel --plat-name=macosx --universal || exit -1
mv dist/lightgbm-${LGB_VER}-py2.py3-none-macosx.whl dist/lightgbm-${LGB_VER}-py2.py3-none-macosx_10_9_x86_64.macosx_10_10_x86_64.macosx_10_11_x86_64.macosx_10_12_x86_64.whl
else
cd $TRAVIS_BUILD_DIR/python-package && python setup.py bdist_wheel --plat-name=manylinux1_x86_64 --universal || exit -1
fi
exit 0 exit 0
fi fi
......
...@@ -23,21 +23,38 @@ test_script: ...@@ -23,21 +23,38 @@ test_script:
- conda info -a - conda info -a
- conda install --yes numpy scipy scikit-learn pandas matplotlib - conda install --yes numpy scipy scikit-learn pandas matplotlib
- pip install pep8 pytest - pip install pep8 pytest
- cd python-package && python setup.py install --precompile && cd ..
- pytest tests/c_api_test/test.py - pytest tests/c_api_test/test.py
- pytest tests/python_package_test
- pep8 --ignore=E501 --exclude=./compute,./docs .
- "set /p LGB_VER=< VERSION.txt" - "set /p LGB_VER=< VERSION.txt"
- cd python-package && python setup.py sdist --formats gztar - cd python-package && python setup.py sdist --formats gztar
- cd dist - cd dist
- "pip install lightgbm-%LGB_VER%.tar.gz -v" - "pip install lightgbm-%LGB_VER%.tar.gz -v"
- cd ../.. - cd ../..
- pytest tests/python_package_test - pytest tests/python_package_test
- cd python-package && python setup.py bdist_wheel --plat-name=win-amd64 --universal
- cd ../.nuget
- python create_nuget.py
- nuget.exe pack LightGBM.nuspec
nuget: nuget:
project_feed: true project_feed: true
artifacts: artifacts:
- path: Release/lib_lightgbm.dll - path: Release/lib_lightgbm.dll
name: Library name: Library
- path: Release/lightgbm.exe - path: Release/lightgbm.exe
name: Exe name: Exe
- path: python-package/dist/*
name: Pip
- path: .nuget/*.nupkg
name: Nuget
deploy:
release: $(APPVEYOR_REPO_TAG_NAME)
provider: GitHub
auth_token:
secure: KR44XwtxY0cLlVpQwY726BvC6gzT0cYTf0ahJ4cSvvS0UVoSJxkR900ICfVXHRoT
artifact: Library,Exe,Pip,Nuget
force_update: true
draft: true
on:
appveyor_repo_tag: true
...@@ -108,6 +108,7 @@ if __name__ == "__main__": ...@@ -108,6 +108,7 @@ if __name__ == "__main__":
version=version, version=version,
description='LightGBM Python Package', description='LightGBM Python Package',
install_requires=[ install_requires=[
'wheel',
'numpy', 'numpy',
'scipy', 'scipy',
'scikit-learn' 'scikit-learn'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment