forked from openlp/openlp
127 lines
6.2 KiB
YAML
127 lines
6.2 KiB
YAML
version: OpenLP-win-ci-b{build}
|
|
|
|
cache:
|
|
- '%LOCALAPPDATA%\pip\Cache'
|
|
- /Users/appveyor/Libraries/Caches/pip
|
|
|
|
stack: python 3.7
|
|
|
|
environment:
|
|
matrix:
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
PY_DIR: C:\\Python37-x64
|
|
CHOCO_VLC_ARG:
|
|
FORCE_PACKAGING: 0
|
|
FORCE_PACKAGING_MANUAL: 0
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
PY_DIR: C:\\Python37
|
|
CHOCO_VLC_ARG: --forcex86
|
|
FORCE_PACKAGING: 0
|
|
FORCE_PACKAGING_MANUAL: 0
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: macos-mojave
|
|
QT_QPA_PLATFORM: offscreen
|
|
FORCE_PACKAGING: 0
|
|
FORCE_PACKAGING_MANUAL: 0
|
|
|
|
init:
|
|
- cmd: set PATH=%PY_DIR%;%PY_DIR%\Scripts;%PATH%
|
|
|
|
install:
|
|
# Update pip
|
|
- python -m pip install --upgrade pip
|
|
# Install generic dependencies from pypi
|
|
- python -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets asyncio waitress six webob requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF==1.16.7 QDarkStyle python-vlc Pyro4 zeroconf flask-cors pytest-qt pyenchant pysword
|
|
# Install Windows only dependencies
|
|
- cmd: python -m pip install pyodbc pypiwin32
|
|
# Mac only dependencies
|
|
- sh: python -m pip install pyobjc-core pyobjc-framework-Cocoa py-applescript
|
|
|
|
build: off
|
|
|
|
test_script:
|
|
- ps: cd $env:APPVEYOR_BUILD_FOLDER
|
|
# Run the tests
|
|
- python -m pytest tests
|
|
# Go back to the user root folder
|
|
- cd ..
|
|
|
|
after_test:
|
|
# Only package on the master repo
|
|
- ps: >-
|
|
If (!(Test-Path env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME) -Or ($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -eq "") -Or ($env:FORCE_PACKAGING -eq 1)) {
|
|
# Continue on eror
|
|
$ErrorActionPreference = "Continue"
|
|
# This is where we create a package using PyInstaller
|
|
# Install PyInstaller
|
|
python -m pip install --no-warn-script-location pyinstaller
|
|
# Patch pyinstaller to fix a webengine bundle issue
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/pyinstaller/pyinstaller/d08a42c612a91cc320c54f9e812fe967b9c8594a/PyInstaller/hooks/hook-PyQt5.QtWebEngineWidgets.py" -OutFile "hook-PyQt5.QtWebEngineWidgets.py"
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/pyinstaller/pyinstaller/91481570517707fc70aa70dca9eb986c61eac35d/PyInstaller/hooks/hook-pkg_resources.py" -OutFile hook-pkg_resources.py
|
|
$sitePkgFolder = python -c "import sys; site_pkg_folder = next(p for p in sys.path if 'site-packages' in p); print(site_pkg_folder.replace('\\', '/'))"
|
|
cp hook-PyQt5.QtWebEngineWidgets.py "${sitePkgFolder}/PyInstaller/hooks/hook-PyQt5.QtWebEngineWidgets.py"
|
|
cp hook-pkg_resources.py "${sitePkgFolder}/PyInstaller/hooks/hook-pkg_resources.py"
|
|
# 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
|
|
# Install HTML Help Workshop - Windows only
|
|
choco install html-help-workshop --no-progress --limit-output
|
|
}
|
|
else
|
|
{
|
|
# 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 update --quiet
|
|
brew install enchant
|
|
}
|
|
# Get the packaging code
|
|
Invoke-WebRequest -Uri "https://gitlab.com/openlp/packaging/-/archive/master/packaging-master.zip" -OutFile packaging-master.zip
|
|
Expand-Archive -Path packaging-master.zip -DestinationPath .
|
|
# If this is tag/replease we should also build the manual
|
|
If ($env:APPVEYOR_REPO_TAG -eq $True -Or $env:FORCE_PACKAGING_MANUAL -eq 1) {
|
|
python -m pip install --no-warn-script-location sphinx sphinx_rtd_theme
|
|
Invoke-WebRequest -Uri "https://gitlab.com/openlp/documentation/-/archive/master/documentation-master.zip" -OutFile documentation-master.zip
|
|
Expand-Archive -Path documentation-master.zip -DestinationPath .
|
|
# If this is a release build, set release argument
|
|
$releaseArg = ""
|
|
If ($env:APPVEYOR_REPO_TAG -eq $True) {
|
|
$releaseArg = "--release $env:APPVEYOR_REPO_TAG_NAME"
|
|
}
|
|
cd packaging-master
|
|
If ($isWindows) {
|
|
python builders/windows-builder.py $releaseArg --skip-update -c windows/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER" -d ../documentation-master --portable
|
|
} else {
|
|
# Install qt to get the lrelease tool
|
|
brew install qt
|
|
python builders/macosx-builder.py $releaseArg --skip-update -c osx/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER" -d ../documentation-master
|
|
}
|
|
} else {
|
|
cd packaging-master
|
|
If ($isWindows) {
|
|
python builders/windows-builder.py --skip-update --skip-translations -c windows/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER" --portable
|
|
} else {
|
|
python builders/macosx-builder.py --skip-update --skip-translations -c osx/config-appveyor.ini -b "$env:APPVEYOR_BUILD_FOLDER"
|
|
}
|
|
}
|
|
}
|
|
|
|
artifacts:
|
|
- path: dist\*.exe
|
|
name: Windows Portable-installer
|
|
- path: dist\*.msi
|
|
name: Windows Installer
|
|
- path: dist\*.dmg
|
|
name: MacOSX Installer
|