openlp/appveyor.yml

124 lines
5.4 KiB
YAML
Raw Permalink Normal View History

2016-11-30 20:54:06 +00:00
version: OpenLP-win-ci-b{build}
2016-11-29 13:07:21 +00:00
cache:
- '%LOCALAPPDATA%\pip\Cache'
2020-07-10 19:45:00 +00:00
- /Users/appveyor/Libraries/Caches/pip
stack: python 3.11
2019-02-14 21:19:26 +00:00
2016-11-29 13:07:21 +00:00
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PY_DIR: C:\\Python311-x64
2020-07-10 19:45:00 +00:00
CHOCO_VLC_ARG:
2023-01-13 04:00:53 +00:00
FORCE_PACKAGING: 0
PYICU_PACK: https://github.com/cgohlke/pyicu-build/releases/download/v2.11/PyICU-2.11-cp311-cp311-win_amd64.whl
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PY_DIR: C:\\Python311
2020-07-10 19:45:00 +00:00
CHOCO_VLC_ARG: --forcex86
2023-01-13 04:00:53 +00:00
FORCE_PACKAGING: 0
PYICU_PACK: https://github.com/cgohlke/pyicu-build/releases/download/v2.11/PyICU-2.11-cp311-cp311-win32.whl
- APPVEYOR_BUILD_WORKER_IMAGE: macos-catalina
2020-07-10 19:45:00 +00:00
QT_QPA_PLATFORM: offscreen
2023-01-13 04:00:53 +00:00
FORCE_PACKAGING: 0
2022-08-12 05:44:34 +00:00
HOMEBREW_FORCE_BREWED_CURL: 1
HOMEBREW_NO_AUTO_UPDATE: 1
2020-07-10 19:45:00 +00:00
init:
2022-08-12 05:44:34 +00:00
- cmd: set PATH=%PY_DIR%;%PY_DIR%\Scripts;%PATH%
2016-11-29 13:07:21 +00:00
install:
2020-07-10 19:45:00 +00:00
# Update pip
- python -m pip install --upgrade pip
# Install generic dependencies from pypi.
- python -m pip install sqlalchemy alembic platformdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets waitress six requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc flask-cors pytest-qt pyenchant pysword qrcode flask packaging
2020-07-10 19:45:00 +00:00
# Install Windows only dependencies
- cmd: python -m pip install pyodbc pypiwin32
- cmd: choco install vlc %CHOCO_VLC_ARG% --no-progress --limit-output
# Download and install pyicu for windows from https://github.com/cgohlke/pyicu-build
- cmd: python -m pip install %PYICU_PACK%
2020-07-10 19:45:00 +00:00
# Mac only dependencies
2022-08-12 05:44:34 +00:00
- sh: brew install --cask vlc
- sh: brew install pkg-config icu4c
- sh: PATH="/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin:$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" python -m pip install pyicu
- sh: python -m pip install Pyro5 pyobjc-core pyobjc-framework-Cocoa py-applescript
2016-11-29 13:07:21 +00:00
build: off
test_script:
2021-09-02 18:10:46 +00:00
- ps: >-
If (($env:APPVEYOR_REPO_TAG -eq $False)) {
cd $env:APPVEYOR_BUILD_FOLDER
# Run the tests
python -m pytest tests
2024-02-16 13:39:01 +00:00
if ($LastExitCode -ne 0) {
2024-02-15 21:48:22 +00:00
throw "The tests failed!"
}
2021-09-02 18:10:46 +00:00
# Go back to the user root folder
cd ..
}
2016-11-29 13:07:21 +00:00
after_test:
# Only package on the master repo
- ps: >-
2020-12-22 07:19:38 +00:00
If (($env:APPVEYOR_REPO_TAG -eq $True) -Or ($env:APPVEYOR_SCHEDULED_BUILD -eq $True) -Or ($env:FORCE_PACKAGING -eq 1)) {
# Continue on error
2020-07-10 19:45:00 +00:00
$ErrorActionPreference = "Continue"
# This is where we create a package using PyInstaller
2020-12-20 21:07:49 +00:00
# Install PyInstaller
python -m pip install --no-warn-script-location pyinstaller
2020-07-10 19:45:00 +00:00
# Some windows only stuff...
If ($isWindows) {
# Disabled portable installers - can't figure out how to make them silent
# - curl -L -O http://downloads.sourceforge.net/project/portableapps/PortableApps.com%20Installer/PortableApps.comInstaller_3.4.4.paf.exe
# - PortableApps.comInstaller_3.4.4.paf.exe /S
# - curl -L -O http://downloads.sourceforge.net/project/portableapps/PortableApps.com%20Launcher/PortableApps.comLauncher_2.2.1.paf.exe
# - PortableApps.comLauncher_2.2.1.paf.exe /S
# - curl -L -O http://downloads.sourceforge.net/project/portableapps/NSIS%20Portable/NSISPortable_3.0_English.paf.exe
# - NSISPortable_3.0_English.paf.exe /S
# Download and unpack portable-bundle
appveyor DownloadFile https://get.openlp.org/win-sdk/portable-setup.7z
7z x portable-setup.7z
# Install VLC - Windows only
choco install vlc $env:CHOCO_VLC_ARG --no-progress --limit-output
}
Else {
2020-07-10 19:45:00 +00:00
# Install Mac only stuff
# install dmgbuild tool
python -m pip install --no-warn-script-location dmgbuild
# use brew to build enchant, needed for pyenchant
brew install enchant
}
# Get the packaging code
2020-07-10 19:45:00 +00:00
Invoke-WebRequest -Uri "https://gitlab.com/openlp/packaging/-/archive/master/packaging-master.zip" -OutFile packaging-master.zip
Expand-Archive -Path packaging-master.zip -DestinationPath .
cd packaging-master
If ($env:APPVEYOR_REPO_TAG -eq $True) {
2020-07-10 19:45:00 +00:00
# If this is a release build, set release argument
$releaseArg = "--release ""$env:APPVEYOR_REPO_TAG_NAME"""
2020-07-10 19:45:00 +00:00
If ($isWindows) {
$cmd = "python builders/windows-builder.py $releaseArg --skip-update -c windows/config-appveyor.ini -b ""$env:APPVEYOR_BUILD_FOLDER"" --portable"
2020-12-22 07:19:38 +00:00
iex $cmd
2020-07-10 19:45:00 +00:00
} else {
$cmd = "python builders/macosx-builder.py $releaseArg --skip-update -c osx/config-appveyor.ini -b ""$env:APPVEYOR_BUILD_FOLDER"""
2020-12-22 07:19:38 +00:00
iex $cmd
2020-07-10 19:45:00 +00:00
}
}
Else {
2020-07-10 19:45:00 +00:00
If ($isWindows) {
python builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER" --portable
}
Else {
2020-07-10 19:45:00 +00:00
python builders/macosx-builder.py --skip-update --skip-translations -c osx/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER"
}
}
}
2016-11-30 20:54:06 +00:00
artifacts:
- path: dist\*.exe
2020-07-10 19:45:00 +00:00
name: Windows Portable-installer
- path: dist\*.msi
2020-07-10 19:45:00 +00:00
name: Windows Installer
- path: dist\*.dmg
name: MacOSX Installer