-
-
Notifications
You must be signed in to change notification settings - Fork 327
Expand file tree
/
Copy path.appveyor.yml
More file actions
305 lines (246 loc) · 11.5 KB
/
.appveyor.yml
File metadata and controls
305 lines (246 loc) · 11.5 KB
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
# ABOUT
# Appveyor CI configuration to build Artisan install packages
# for Windows, macOS (Intel), 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 2026
# Include "skip ci" in the commit message to prevent this build process from running
environment:
# Set the default Appveyor Python version here. Can be overridden in platform environment.
PYTHON_V: 3.13
# Upgrade to specific version (for platforms supporting upgrade). Upgrade skipped if env var is missing or blank.
PYUPGRADE_WIN_VER: 3.14.3
#PYUPGRADE_MACOS_V: 3.12.1 # when upgrading see the notes in the deploy phase
matrix:
- job_name: windows
appveyor_build_worker_image: Visual Studio 2022
- job_name: macos
appveyor_build_worker_image: macos-ventura
- 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
fast_finish: false
environment:
PYTHON_V: 3.14 # Override the stack key
QT_PATH: "C:/qt/6.9/msvc2022_64" #symbolic linked to latest 6.9.x folder
PYQT: "6"
PYUIC: "pyuic6.exe"
BUILD_PYINSTALLER: "True"
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_VER is set. The upgrade happens in upgrade-py-win.bat
# Note that the paths set below may not exist yet.
- ps: |
if (Test-Path env:PYUPGRADE_WIN_VER) {
$env:PREV_PYTHON_V = $env:PYTHON_V
$env:PREV_PYTHON_PATH = "C:/Python$($env:PYTHON_V -replace '\.','')-x64"
$env:PYTHON_V = ($env:PYUPGRADE_WIN_VER -split '\.')[0..1] -join '.'
}
# derive the path to python.exe from the version number
- ps: $env:PYTHON_PATH = "C:/Python$($env:PYTHON_V -replace '\.','')-x64"
- ps: Write-Host $env:PYTHON_PATH
# upgrade the python version installed if necessary
- cmd: .ci/upgrade-py-win.bat
# update path env var
- cmd: set PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%PATH%
# expose the python version
- cmd: python -V
# generate the path to PyQt translations files
- ps: $env:QT_TRANSL = "$env:PYTHON_PATH/Lib/site-packages/PyQt6/Qt6/translations"
# pull library versions from requirements 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"
# patch for libusb_package until a Python 3.14 version is available on pypi.org
- cmd: if "%PYTHON_V%"=="3.14" (echo *** PATCH install version of libusb_package modified for Python 3.14)
- cmd: if "%PYTHON_V%"=="3.14" (pip install .ci\patches\libusb_package-1.0.26.3-py314-none-win_amd64.whl)
# run the install script
- cmd: .ci/install-win.bat
# patch for pylupdate6 until this is fixed on pypi.org
- cmd: if "%PYTHON_V%"=="3.14" (echo *** PATCH pylupdate6 for Python 3.14)
- cmd: if "%PYTHON_V%"=="3.14" (copy /Y .ci\patches\python_source.py C:\Python314-x64\Lib\site-packages\PyQt6\lupdate\python_source.py)
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:
PYTHON_UPGRADE_V: 3.14.3 # Upgrade to this version
PYTHON_V: 3.12 # Override the stack key with latest Appveyor version
ARTISAN_OS: macos
MACOSX_DEPLOYMENT_TARGET: 13.0
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
# upgrade python
- echo "Deactivating the active virtual environment"
- deactivate || echo "No active virtual environment found"
- echo "Downloading Python ${PYTHON_UPGRADE_V} installer"
- curl -O https://www.python.org/ftp/python/${PYTHON_UPGRADE_V}/python-${PYTHON_UPGRADE_V}-macos11.pkg
- echo "Installing Python ${PYTHON_UPGRADE_V}"
- sudo installer -pkg python-${PYTHON_UPGRADE_V}-macos11.pkg -target /
# Update the environment
- export PYTHON_V="${PYTHON_UPGRADE_V%.*}" # drop the dot build number
- export PYTHONSITEPKGS="/Users/appveyor/venv${PYTHON_V}/lib/python${PYTHON_V}/site-packages"
- export QT_PATH="${PYTHONSITEPKGS}/PyQt6/Qt6"
# Create and activate a new virtual environment
- echo "Creating virtual environment"
- python3 -m venv /Users/appveyor/venv${PYTHON_V}
- echo "Activating virtual environment"
- source /Users/appveyor/venv${PYTHON_V}/bin/activate
# Create symbolic link
- ln -s /Users/appveyor/venv${PYTHON_V} /Users/appveyor/venv${PYTHON_UPGRADE_V}
# run the install script
- .ci/install-macos.sh
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
# ...at present python is not updated so we can skip this and save the time
#- brew upgrade libidn2 # 2.3.4 -> 2.3.4_1
- ../.ci/upload.sh artisan-*.dmg
# # uncomment this section for ssh connection to the 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 -
-
matrix:
only:
- job_name: linux
fast_finish: false
environment:
PYTHON_UPGRADE_V: 3.14 # Upgrade to this version (installs the latest dot release)
PYTHON_V: 3.13 # Override the stack key
ARTISAN_OS: linux
PYTHONSITEPKGS: /home/appveyor/venv${PYTHON_V}/lib/python${PYTHON_V}/site-packages
QT_PATH: $PYTHON_PATH/PyQt6/Qt6
PYUIC: pyuic6
PYLUPDATE: ./pylupdate6pro.py #the dot slash is necessary
install:
#- ls -la /home/appveyor/Qt/
- echo "Linux Install"
- chmod +x .ci/*.sh
# Upgrade Python version
- echo "Upgrading Python to $PYTHON_UPGRADE_V"
- sudo apt update
- sudo apt install -y software-properties-common
- sudo add-apt-repository -y ppa:deadsnakes/ppa
- sudo apt update
- sudo apt install -y python${PYTHON_UPGRADE_V} python${PYTHON_UPGRADE_V}-venv libpython${PYTHON_UPGRADE_V}
# Create and activate virtual environment
- echo "Creating and activating virtual environment"
- python${PYTHON_UPGRADE_V} -m venv venv${PYTHON_UPGRADE_V}
- source venv${PYTHON_UPGRADE_V}/bin/activate
# Log for confirmation
- echo "Confirming Python version and location"
- python -m pip --version
- which python
- python3 -V
- echo "Finshed Upgrading Python"
# 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 -