liquidctl/appveyor.yml

72 lines
2.9 KiB
YAML

version: "{build}"
skip_commits:
message: /\[skip ci\]/
image:
- Visual Studio 2017
platform: x64
environment:
DIST_NAME: AppVeyor
LIBUSB_VERSION: 1.0.22
for:
-
branches:
only:
- /v\d+\.\d+\.\d+.*/
environment:
is_release: true
install:
# conditionally generate DIST_PACKAGE from TAG_NAME or REPO_COMMIT:
# - because of AppVeyor limitation, do this here and not in environment;
# - don't be sane and use 'else', Windows/Cmd/AppVeyor wont like it
- cmd: if [%is_release%]==[true] set DIST_PACKAGE=liquidctl-%APPVEYOR_REPO_TAG_NAME:v=%-bin-windows-x86_64
- cmd: if [%is_release%]==[] set DIST_PACKAGE=liquidctl-%APPVEYOR_REPO_COMMIT:~0,12%-bin-windows-x86_64
- cmd: echo DIST_NAME=%DIST_NAME%; DIST_PACKAGE=%DIST_PACKAGE%; LIBUSB_VERSION=%LIBUSB_VERSION%
# libusb
- cmd: appveyor DownloadFile https://github.com/libusb/libusb/releases/download/v%LIBUSB_VERSION%/libusb-%LIBUSB_VERSION%.7z -FileName libusb.7z
- cmd: 7z x libusb.7z
# python build and package tools
- cmd: C:\Python36-x64\python -m pip install --upgrade pip setuptools --ignore-installed
# specific pyusb version and patch
# (patch dual licensed under BSD3, see https://github.com/pyusb/pyusb/pull/227#issuecomment-554752137)
- cmd: git clone --branch v1.0.2 --depth 1 https://github.com/pyusb/pyusb && cd pyusb
- cmd: git apply ..\extra\windows\0001-Fix-203-libusb-sometimes-cleaned-up-too-early.patch
- cmd: git apply ..\extra\windows\9999-Add-local-version.patch
- cmd: C:\Python36-x64\python -m pip install . && cd .. && rmdir /q /s pyusb
# remaining dependencies
- cmd: C:\Python36-x64\python setup.py install
# generate list of packages that will be included
- cmd: C:\Python36-x64\python -m pip freeze | find /V "virtualenv" > extra\windows\included.txt
# install pyinstaller last to not pollute included.txt with its dependencies
- cmd: C:\Python36-x64\python -m pip install pyinstaller
- cmd: C:\Python36-x64\python -m pip freeze | find "PyInstaller" >> extra\windows\included.txt
- cmd: echo libusb %LIBUSB_VERSION% >> extra\windows\included.txt
- cmd: C:\Python36-x64\python --version >> extra\windows\included.txt
build_script:
- cmd: C:\Python36-x64\Scripts\pyinstaller --add-data MS64\dll\*;. --clean -F liquidctl\cli.py --name liquidctl --distpath .
after_build:
- cmd: mkdir %DIST_PACKAGE%\docs
- cmd: copy liquidctl.exe %DIST_PACKAGE%\
- cmd: copy README.md %DIST_PACKAGE%\
- cmd: copy docs\*.md %DIST_PACKAGE%\docs\
- cmd: copy LICENSE.txt %DIST_PACKAGE%\
- cmd: copy extra\windows\redist-notices.txt %DIST_PACKAGE%\COPYRIGHT.txt
- cmd: copy extra\windows\included.txt %DIST_PACKAGE%\included.txt
- cmd: copy CHANGELOG.md %DIST_PACKAGE%\
- cmd: 7z a %DIST_PACKAGE%.zip %DIST_PACKAGE%\
test_script:
- cmd: liquidctl.exe --version
- cmd: liquidctl.exe list --verbose
- cmd: liquidctl.exe list --hid hid --verbose
artifacts:
- path: "*.zip"