forked from liquidctl/liquidctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
73 lines (63 loc) · 2.83 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: "{build}"
skip_commits:
message: /\[skip ci\]/
image:
- Visual Studio 2019
platform: x64
environment:
DIST_NAME: AppVeyor
LIBUSB_VERSION: 1.0.24
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:\Python39-x64\python -m pip install --upgrade pip setuptools --ignore-installed
# remaining dependencies
- cmd: C:\Python39-x64\python setup.py install
# generate list of packages that will be included
- cmd: C:\Python39-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:\Python39-x64\python -m pip install pyinstaller
- cmd: C:\Python39-x64\python -m pip freeze | find "pyinstaller" >> extra\windows\included.txt
- cmd: echo libusb %LIBUSB_VERSION% >> extra\windows\included.txt
- cmd: C:\Python39-x64\python --version >> extra\windows\included.txt
# install pytest
- cmd: C:\Python39-x64\python -m pip install pytest
build_script:
- cmd: C:\Python39-x64\Scripts\pyinstaller --add-data VS2019\MS64\dll\*;. --clean -F liquidctl\cli.py --name liquidctl --onefile --distpath .
after_build:
- cmd: mkdir %DIST_PACKAGE%\docs
- cmd: mkdir %DIST_PACKAGE%\docs\windows
- cmd: copy liquidctl.exe %DIST_PACKAGE%\
- cmd: copy README.md %DIST_PACKAGE%\
- cmd: copy docs\*.md %DIST_PACKAGE%\docs\
- cmd: copy docs\windows\*.md %DIST_PACKAGE%\docs\windows\
- 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%\
- cmd: CertUtil -hashfile liquidctl.exe SHA256
- cmd: CertUtil -hashfile %DIST_PACKAGE%.zip SHA256
test_script:
# ensure the bundled binary can find/use libusb
- cmd: liquidctl.exe list --verbose --debug
# copy the libusb DLLs and run the unit and doctests
- cmd: copy VS2019\MS64\dll\* C:\Windows\System32\
- cmd: C:\Python39-x64\python -m pytest
artifacts:
- path: "*.zip"