mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-26 10:33:15 +03:00
105 lines
3.9 KiB
YAML
105 lines
3.9 KiB
YAML
# appveyor.yml
|
|
|
|
# Building, testing and deployment for Windows
|
|
|
|
# Syntax for this file:
|
|
# https://www.appveyor.com/docs/appveyor-yml
|
|
|
|
environment:
|
|
YKPERS_VERSION: "1.18.1"
|
|
LIBUSB_VERSION: "1.0.21"
|
|
PY_VERSION: "3.6.5"
|
|
PYOTHERSIDE_VERSION: "1.5.3"
|
|
YKPERS_BASEURL: https://developers.yubico.com/yubikey-personalization/Releases
|
|
|
|
matrix:
|
|
- platform: x86
|
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
QT_VERSION: 5.10\msvc2015
|
|
PYTHON: C:\Python36
|
|
PY_ARCH: win32
|
|
WIN_ARCH: win32
|
|
LIBUSB_DLL_FOLDER: MS32
|
|
VCVARSALLPATH: C:\"Program Files (x86)\Microsoft Visual Studio 14.0"\VC\vcvarsall.bat
|
|
VCVARSALL: x86
|
|
|
|
- platform: x64
|
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
QT_VERSION: 5.9\msvc2017_64
|
|
PYTHON: C:\Python36-x64
|
|
PY_ARCH: amd64
|
|
WIN_ARCH: win64
|
|
LIBUSB_DLL_FOLDER: MS64
|
|
VCVARSALLPATH: C:\"Program Files (x86)\Microsoft Visual Studio"\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
|
|
VCVARSALL: x64
|
|
|
|
init:
|
|
# Needed for jom to work.
|
|
- call %VCVARSALLPATH% %VCVARSALL%
|
|
# Add python and Qt to PATH
|
|
- set PATH=%PYTHON%;%PYTHON%\Scripts;C:\Qt\%QT_VERSION%\bin;C:\Qt\Tools\QtCreator\bin;%PATH%
|
|
|
|
install:
|
|
- choco install swig -y
|
|
- choco upgrade swig
|
|
|
|
# Build and install PyOtherSide
|
|
# Reference: https://pyotherside.readthedocs.io/en/latest/#building-for-windows
|
|
- mkdir lib
|
|
- ps: wget "https://github.com/thp/pyotherside/archive/$env:PYOTHERSIDE_VERSION.zip" -OutFile ".\lib\pyotherside-$env:PYOTHERSIDE_VERSION.zip"
|
|
- cd .\lib
|
|
- 7z x pyotherside-%PYOTHERSIDE_VERSION%.zip
|
|
- cd .\pyotherside-%PYOTHERSIDE_VERSION%
|
|
- ps: (Get-Content .\src\qmldir).replace('pyothersideplugin', 'pyothersideplugin1') | Set-Content .\src\qmldir
|
|
- ps: Clear-Content python.pri
|
|
- ps: Add-Content python.pri "PYTHON_CONFIG = python3-config`nQMAKE_LIBS += -L$env:PYTHON\libs -lpython36`nQMAKE_CXXFLAGS += -I$env:PYTHON\include`n"
|
|
- qmake
|
|
- jom
|
|
- jom install
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
|
|
|
build_script:
|
|
- qmake yubioath-desktop.pro
|
|
- jom
|
|
|
|
after_build:
|
|
|
|
- ps: wget "$env:YKPERS_BASEURL/ykpers-$env:YKPERS_VERSION-$env:WIN_ARCH.zip" -OutFile "ykpers-$env:YKPERS_VERSION-$env:WIN_ARCH.zip"
|
|
- 7z x ykpers-%YKPERS_VERSION%-%WIN_ARCH%.zip -o".\ykpers"
|
|
- ps: Copy-Item .\ykpers\bin\*.dll .\release -Force
|
|
|
|
- ps: Invoke-WebRequest "http://prdownloads.sourceforge.net/libusb/libusb-$env:LIBUSB_VERSION.7z" -OutFile "libusb-$env:LIBUSB_VERSION.7z" -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome
|
|
- 7z x libusb-%LIBUSB_VERSION%.7z -o".\libusb"
|
|
- ps: Copy-Item ".\libusb\$env:LIBUSB_DLL_FOLDER\dll\*.dll" .\release -Force
|
|
|
|
- ps: wget https://www.python.org/ftp/python/$env:PY_VERSION/python-$env:PY_VERSION-embed-$env:PY_ARCH.zip -OutFile python-$env:PY_VERSION-embed-$env:PY_ARCH.zip
|
|
- 7z x python-%PY_VERSION%-embed-%PY_ARCH%.zip -o".\release"
|
|
# Use Qt deployment tool on executable
|
|
- windeployqt .\release\yubioath-desktop.exe --qmldir=qml --no-translations --angle --release
|
|
# Add python dependencies to release folder
|
|
- ps: Copy-Item .\pymodules .\release -recurse
|
|
# Remove .pyc files from release folder
|
|
- ps: Get-ChildItem -File -Include *.pyc -Recurse | Remove-Item -Force
|
|
- ps: Get-ChildItem -Include __pycache__ -Recurse | Remove-Item -Force
|
|
# Remove .cpp source files
|
|
- ps: Get-ChildItem -Include *.cpp -Recurse | Remove-Item -Force
|
|
# Remove object files
|
|
- ps: Get-ChildItem -Include *.obj -Recurse | Remove-Item -Force
|
|
# Create zip for deployment
|
|
- set ARTIFACT_NAME=%APPVEYOR_REPO_BRANCH%-%WIN_ARCH%
|
|
- if defined APPVEYOR_REPO_TAG_NAME set ARTIFACT_NAME=%APPVEYOR_REPO_TAG_NAME%-%WIN_ARCH%
|
|
- 7z a yubioath-desktop-%ARTIFACT_NAME%-win.zip .\release\*
|
|
- cd %APPVEYOR_BUILD_FOLDER%
|
|
|
|
artifacts:
|
|
- path: yubioath-desktop-$(ARTIFACT_NAME)-win.zip
|
|
|
|
deploy:
|
|
- provider: S3
|
|
access_key_id: $(AWS_KEY_ID)
|
|
secret_access_key: $(AWS_SECRET_KEY)
|
|
bucket: $(AWS_BUCKET)
|
|
folder: "yubioath-desktop"
|
|
region: eu-west-1
|
|
set_public: true
|