-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathappveyor.yml
132 lines (112 loc) · 5.65 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
environment:
global:
# without this flag, debugging is a nightmare :)
APPVEYOR_SAVE_CACHE_ON_ERROR: true
matrix:
# Unfortunately this build does not work with miniconda 32 bit, or so it seems. To re-test one of these days...
# - PYTHON_VERSION: "3.5"
# # PYTHON: "C:\\Python35"
# MINICONDA: "C:\\Miniconda35"
- PYTHON_VERSION: "3.6"
# PYTHON: "C:\\Python35-x64"
MINICONDA: "C:\\Miniconda35-x64"
QT_VER: 5.6.3
QT_DIR_REL: Qt5.6.3
PYQT_VER: 5.6
PYQT_DIR_REL: PyQt5.6-with_src
# This folder has to have the same same than the python package!
PYQT_DIST_REL: PyQt5
MSYS2_DIR: "C:\\msys64"
MSYSTEM: MINGW64
cache:
# caching MSYS2 takes more time than installing, so only cache Qt target and PyQt directories.
# note: the cache automatically depends on the environment variables matrix (e.g. python version)
- '%QT_DIR_REL%'
- '%PYQT_DIR_REL% -> ci_tools\build_pyqt.bat'
init:
- "ECHO %PYTHON_VERSION% %MINICONDA%" # %PYTHON%
# **** Miniconda version ****
install:
- set QT_DIR=%APPVEYOR_BUILD_FOLDER%\%QT_DIR_REL%
- set PYQT_DIR=%APPVEYOR_BUILD_FOLDER%\%PYQT_DIR_REL%
# (a) setup msys2+mingw 64 (caching MSYS2 takes more time than installing it)
- echo "Setting up msys2 mingw 64 environment" & call ./ci_tools/setup_msys.bat
# (b) setup conda, see https://www.appveyor.com/docs/build-environment/#miniconda and http://help.appveyor.com/discussions/questions/6802-appveyor-with-conda
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no
# - conda update -q conda NO !!!! # conda info -a # Use this to debug conda
# (c) base conda environment
- conda create -n envswitch python=%PYTHON_VERSION%
- activate envswitch
- conda install "python=%PYTHON_VERSION%" "sip" "pip>=9.0.1" "setuptools=36" -q
# (d) Compile and install Qt if needed (if no cache available)
- if not exist %QT_DIR%\bin\Qt5Core.dll (
echo "No cache found, building qt" &
call ./ci_tools/build_install_qt.bat
) else (
echo "Found existing cache in %QT_DIR%" &
dir %QT_DIR%
)
- echo "Adding Qt to PATH" & set PATH=%QT_DIR%/bin;%PATH%
# (e) Compile PyQt if needed (if no cache available)
# Note: conda should be BEFORE MSYS2 in path for that
- if not exist %PYQT_DIR%\QtGui\QtGui.pyd (
echo "No cache found, building pyqt" &
RMDIR /S /Q %PYQT_DIR% &
call ./ci_tools/build_pyqt.bat
) else (
echo "Found existing cache in %PYQT_DIR%" &
dir %PYQT_DIR%
)
- echo "Installing PyQt to python site-packages" & cd "%PYQT_DIR%" & mingw32-make -j 4 install
build: off
test_script:
- echo "No tests here, but we want after_test to trigger :)"
after_test:
# ***packaging for releases***
- echo "Creating the appropriate archives into dist/" &
cd %APPVEYOR_BUILD_FOLDER% &
mkdir dist &
set SUF=minimal-Windows-x86_64-MinGW64
# Qt
- echo "Creating Qt archive" &
7z a -ttar -so Qt%QT_VER%_lgpl_%SUF%.tar %QT_DIR_REL% | 7z a -si dist/Qt%QT_VER%_lgpl_%SUF%.tar.gz
# PyQt sources+binaries
- echo "Creating PyQt+src archive" &
7z a -ttar -so PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%-with_src.tar %PYQT_DIR_REL% | 7z a -si dist/PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%-with_src.tar.gz
# PyQt binaries only (note: we dont include the *.dll since they dont seem to be needed, they are not copied by the standard pyqt installer)
- echo "Creating PyQt archive" &
mkdir %PYQT_DIST_REL% &
cd %PYQT_DIR_REL%
# the for loop seems to include the following lines when this is all in the same command. Splitting.
- echo "copy all interesting files *.pyi *.pyd" & for /r %%i in (*pyi *pyd) do xcopy /Y "%%i" "%APPVEYOR_BUILD_FOLDER%/%PYQT_DIST_REL%"
- echo "copy __init__.py" & xcopy /Y .\__init__.py "%APPVEYOR_BUILD_FOLDER%/%PYQT_DIST_REL%"
# this was a bad idea, cx freeze is able to better handle the qt dependency (and the platforms plugins) when qt is on the PATH.
# besides there are also the msys2 dependencies to install.
# If one day we want to be able to ship like 'conda install' then we will need to recompilet against MSVC and to ship also a Qt wheel (see conda)
#- echo "copy qt files inside pyqt5" & cd %APPVEYOR_BUILD_FOLDER%/%QT_DIR_REL%/bin & for /r %%i in (*Core.dll *Gui.dll *Widgets.dll) do xcopy /Y "%%i" "%APPVEYOR_BUILD_FOLDER%/%PYQT_DIST_REL%"
# - echo "copy qt platform file inside pyqt5"
# - mkdir "%APPVEYOR_BUILD_FOLDER%/%PYQT_DIST_REL%/platforms"
# - xcopy "%APPVEYOR_BUILD_FOLDER%/%QT_DIR_REL%/plugins/platforms/qwindows.dll" "%APPVEYOR_BUILD_FOLDER%/%PYQT_DIST_REL%/platforms"
- echo "finally create the archive" & cd %APPVEYOR_BUILD_FOLDER% &
7z a -ttar -so PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%.tar %PYQT_DIST_REL% | 7z a -si dist/PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%.tar.gz
artifacts:
- path: 'dist/Qt%QT_VER%_lgpl_%SUF%.tar.gz'
- path: 'dist/PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%.tar.gz'
- path: 'dist/PyQt%PYQT_VER%_gpl_py%PYTHON_VERSION%_%SUF%-with_src.tar.gz'
on_success:
# You can use this step to upload your artifacts to a public website.
# See Appveyor's documentation for more details. Or you can simply
# access your wheels from the Appveyor "artifacts" tab for your build.
deploy:
# release: myproduct-v$(appveyor_build_version)
description: ''
provider: GitHub
auth_token:
secure: 'SYd5+MMCyCHhSsQ8ZLPnbBC0KbUv/DVDUFTkdCkYd+wJCa2lsxo9w0HzA8Zg11iG' # encrypted token from GitHub
# artifact: /.*\.nupkg/ # upload all
draft: false
prerelease: false
on:
branch: master # release from master branch only
appveyor_repo_tag: true # deploy on tag push only