-
-
Notifications
You must be signed in to change notification settings - Fork 260
/
.appveyor.yml
318 lines (252 loc) · 11.5 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# ABOUT
# Appveyor CI configuration to build Artisan install packages
# for Windows, Windows legacy, macOS, and Linux
#
# LICENSE
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 2 of the License, or
# version 3 of the License, or (at your option) any later versison. It is
# provided for educational purposes and is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# AUTHOR
# Dave Baxter, Marko Luther 2023
# Include "skip ci" in the commit message to prevent this build process from running
environment:
# Set the default Appveyor Python version here. Does not affect windows_legacy. Can be overridden in platform environment.
PYTHON_V: 3.12
# Upgrade to specific version (for platforms supporting upgrade). Upgrade skipped if env var is missing or blank.
#PYUPGRADE_WIN_V: 3.11.6
#PYUPGRADE_MACOS_V: 3.12.1
matrix:
- job_name: windows_legacy
appveyor_build_worker_image: Visual Studio 2019
- job_name: windows
appveyor_build_worker_image: Visual Studio 2022
- job_name: macos
appveyor_build_worker_image: macos-monterey # macos-bigsur (macOS 11 not support by brew any longer)
- job_name: linux
appveyor_build_worker_image: Ubuntu2204
# Generic build number, later set to commit hash by init
version: '{build}'
# Do not build on tags
skip_tags: true
clone_depth: 1
init:
# Sets the commit hash to "build version number" shown in appveyor build status, the build number keeps it unique
- ps: Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_COMMIT.substring(0,7)) ($env:APPVEYOR_BUILD_NUMBER)"
# Env used to enable artifact upload for PR builds by providing a valid file name, invalid for REPO builds
- ps: |
$env:artifact_prefix = 'disable_artifact'
if ([bool]$env:APPVEYOR_PULL_REQUEST_NUMBER -eq $true) {
$env:artifact_prefix = 'artisan'
}
branches:
only:
- master
stack:
python ${PYTHON_V}
for:
-
matrix:
only:
- job_name: windows_legacy
fast_finish: false
environment:
PYTHON_PATH: "C:/Python38-x64"
QT_PATH: "C:/qt/5.15/msvc2019_64"
PYUIC: "pyuic5.exe"
PYQT: "5"
BUILD_PYINSTALLER: "True"
ARTISAN_LEGACY: "True"
VC_REDIST: "https://aka.ms/vs/16/release/vc_redist.x64.exe" #redistributable for VS 2015-2019
VCVARSALL: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat"
install:
- cmd: echo Windows Legacy Install
# generate the path to PyQt translations files
- ps: $env:QT_TRANSL = "$env:PYTHON_PATH/Lib/site-packages/PyQt5/Qt5/translations"
# pull library versions from requirments file
- ps: $env:PYINSTALLER_VER = Select-String -Path ./src/requirements.txt "pyinstaller==([\d\.]*).*platform_system='Windows'" -List | ForEach-Object {$_.Matches.Groups[1].Value}
- ps: Write-Host "PYINSTALLER_VER= $env:PYINSTALLER_VER"
# update path env var
- cmd: set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%
# run the install script
- cmd: .ci\install-win.bat
build_script:
- cmd: echo Windows Legacy Build
- cmd: cd src
#update the copyright year used by pyinstaller to set exe properties for Windows
- ps: $YEAR=(Get-Date).year
- ps: gc version-metadata.yml | %{ $_ -replace "yyyy", "$YEAR" } | out-file newfile -encoding ascii
- ps: move -force newfile version-metadata.yml
# update the __revision__ field with the left seven of the GIT commit hash
- ps: $GIT_VERSION=git rev-parse --verify --short HEAD
- ps: gc artisanlib/__init__.py | %{ $_ -replace "__revision__ = '.*'", "__revision__ = '$GIT_VERSION'" } | out-file newfile -encoding ascii
- ps: move -force newfile artisanlib/__init__.py
# run the build script
- cmd: build-win3-pi.bat
# test_script:
# - cmd: python -m unittest discover
artifacts:
# - path: 'generated-win-legacy.zip'
- path: 'src\%artifact_prefix%-win*setup.exe'
deploy_script:
- cmd: bash ../.ci/upload.sh artisan-win*setup.exe
# # uncomment this section for remote desktop connection to build image
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-
matrix:
only:
- job_name: windows
fast_finish: false
environment:
QT_PATH: "C:/qt/6.5.1/msvc2019_64" #there is no msvc2022_64 under /qt*
PYQT: "6"
PYUIC: "pyuic6.exe"
BUILD_PYINSTALLER: "True"
ARTISAN_LEGACY: "False"
VC_REDIST: "https://aka.ms/vs/17/release/vc_redist.x64.exe" #redistributable for VS 2015-2022
VCVARSALL: "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat"
install:
- cmd: echo Windows Install
# Update the Python version when PYUPGRADE_WIN_V is set. The upgrade happens in install-win.bat
# Note that the paths set below may not exist yet.
- ps: |
if (Test-Path env:PYUPGRADE_WIN_V) {
$env:PREV_PYTHON_V = $env:PYTHON_V
$env:PYTHON_V = ($env:PYUPGRADE_WIN_V -split '\.')[0..1] -join '.'
}
# derive the python path from the version number
- ps: $env:PYTHON_PATH = "C:/Python$($env:PYTHON_V -replace '\.','')-x64"
- ps: Write-Host $env:PYTHON_PATH
# generate the path to PyQt translations files
- ps: $env:QT_TRANSL = "$env:PYTHON_PATH/Lib/site-packages/PyQt6/Qt6/translations"
# pull library versions from requirments file
- ps: $env:PYINSTALLER_VER = Select-String -Path ./src/requirements.txt "pyinstaller==([\d\.]*).*platform_system='Windows'" -List | ForEach-Object {$_.Matches.Groups[1].Value}
- ps: Write-Host "PYINSTALLER_VER= $env:PYINSTALLER_VER"
# update path env var
- cmd: set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%
# run the install script
- cmd: .ci/install-win.bat
build_script:
- cmd: echo Windows Build
- cmd: cd src
#update the copyright year used by pyinstaller to set exe properties for Windows
- ps: $YEAR=(Get-Date).year
- ps: gc version-metadata.yml | %{ $_ -replace "yyyy", "$YEAR" } | out-file newfile -encoding ascii
- ps: move -force newfile version-metadata.yml
# update the __revision__ field with the left seven of the GIT commit hash
- ps: $GIT_VERSION=git rev-parse --verify --short HEAD
- ps: gc artisanlib/__init__.py | %{ $_ -replace "__revision__ = '.*'", "__revision__ = '$GIT_VERSION'" } | out-file newfile -encoding ascii
- ps: move -force newfile artisanlib/__init__.py
# run the build script
- cmd: build-win3-pi.bat
# test_script:
# - cmd: python -m unittest discover
artifacts:
# - path: 'generated-win.zip'
- path: 'src\%artifact_prefix%-win*setup.exe'
deploy_script:
- cmd: bash ../.ci/upload.sh artisan-win*setup.exe
# # uncomment this section for remote desktop connection to build image
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-
matrix:
only:
- job_name: macos
fast_finish: false
environment:
ARTISAN_OS: macos
MACOSX_DEPLOYMENT_TARGET: 12.0
PYTHONSITEPKGS: /Users/appveyor/venv${PYTHON_V}/lib/python${PYTHON_V}/site-packages
QT_PATH: ${PYTHONSITEPKGS}/PyQt6/Qt6
QT_SRC_PATH: /Users/appveyor/Qt/6.6/macos
PYUIC: pyuic6
PYLUPDATE: ./pylupdate6pro.py #the dot slash is necessary
install:
- echo "MacOS Install"
- chmod +x .ci/*.sh
# update the __revision__ field with the left seven of the GIT commit hash
- export GIT_VERSION=`git rev-parse --verify --short HEAD 2>/dev/null|| echo "???"`
- sed -i'' -e "s/__revision__ = '.*'/__revision__ = '$GIT_VERSION'/" src/artisanlib/__init__.py
# run the install script
- .ci/install-macos.sh
- export PATH=/Users/appveyor/venv${PYTHON_V}/bin:${PATH} # required after updating Python in venv
build_script:
- echo "MacOS Build"
- chmod +x src/*.sh
- chmod +x src/pylupdate6pro.py
# run the build script
- cd src
- ./build-macos3.sh
# unit test fails as it runs on Py3.9 while the build installs under brew installed Py3.10 (see build-mac3.py)
# test_script:
# - python -m unittest discover -s src
artifacts:
# - path: 'generated-macos.zip'
- path: 'src/%artifact_prefix%-*.dmg'
deploy_script:
# we upgrade libidn2 and curl to prevent issues caused by the previous python update
# on running curl for later upload (libunistring.2.dylib not found)
# this is done here after generating the build to prevent SSL issues
- brew upgrade libidn2 # 2.3.4 -> 2.3.4_1
- ../.ci/upload.sh artisan-*.dmg
# # uncomment this section for vnc or ssh connection to the build image
# on_finish:
# - sh: export APPVEYOR_VNC_BLOCK=true
# - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-vnc.sh' | bash -e -
# #- sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
-
matrix:
only:
- job_name: linux
fast_finish: false
environment:
#PYTHON_V: 3.11
ARTISAN_OS: linux
PYTHONSITEPKGS: /home/appveyor/venv${PYTHON_V}/lib/python${PYTHON_V}/site-packages
QT_PATH: $PYTHON_PATH/PyQt6/Qt6
QT_SRC_PATH: /home/appveyor/Qt/6.4/gcc_64 # latest points still to 5.15.2
PYUIC: pyuic6
PYLUPDATE: ./pylupdate6pro.py #the dot slash is necessary
install:
#- ls -la /home/appveyor/Qt/
- echo "Linux Install"
- chmod +x .ci/*.sh
# pull library versions from requirments file
- ps: $env:LIBUSB_VER = Select-String -Path ./src/requirements.txt "libusb==([\d\.]*).*platform_system='Linux'" -List | ForEach-Object {$_.Matches.Groups[1].Value}
- ps: Write-Host "LIBUSB_VER= $env:LIBUSB_VER"
- ps: $env:DOTENV_VER = Select-String -Path ./src/requirements.txt "dotenv==([\d\.]*).*platform_system='Linux'" -List | ForEach-Object {$_.Matches.Groups[1].Value}
- ps: Write-Host "DOTENV_VER= $env:DOTENV_VER"
# update the __revision__ field with the left seven of the GIT commit hash
- export GIT_VERSION=`git rev-parse --verify --short HEAD 2>/dev/null|| echo "???"`
- sed -i'' -e "s/__revision__ = '.*'/__revision__ = '$GIT_VERSION'/" src/artisanlib/__init__.py
# run the install script
- .ci/install-linux.sh
build_script:
- echo "Linux Build"
- chmod +x src/*.sh
- cd src
# run the build scripts
- ./build-linux.sh
- ./build-linux-pkg.sh
# test_script:
# - QT_QPA_PLATFORM=offscreen python -m unittest discover -s src
artifacts:
# - path: 'generated-linux.zip'
- path: 'src/%artifact_prefix%-*.deb'
- path: 'src/%artifact_prefix%-*.rpm'
- path: 'src/%artifact_prefix%-*.AppImage'
deploy_script:
- ../.ci/upload.sh artisan-*.deb
- ../.ci/upload.sh artisan-*.rpm
- ../.ci/upload.sh artisan-*.AppImage
# # uncomment this section for ssh connection to build image
# on_finish:
# - sh: export APPVEYOR_SSH_BLOCK=true
# - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -