yubioath-flutter/appveyor.yml

103 lines
4.3 KiB
YAML
Raw Normal View History

2017-03-01 17:59:05 +03:00
# appveyor.yml
# Building, testing and deployment for Windows
# Syntax for this file:
# https://www.appveyor.com/docs/appveyor-yml
image: Visual Studio 2015
2017-08-02 14:52:40 +03:00
environment:
LIBU2F_HOST_VERSION: "1.1.4"
YKPERS_VERSION: "1.18.1"
2017-08-02 14:52:40 +03:00
LIBUSB_VERSION: "1.0.21"
PY_VERSION: "3.6.4"
PYOTHERSIDE_VERSION: "1.5.3"
2017-08-02 14:52:40 +03:00
2017-03-01 17:59:05 +03:00
init:
# Needed for jom to work.
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
# Add python and Qt to PATH
- set PATH=C:\Python36;C:\Python36\Scripts;C:\Qt\5.9\msvc2015\bin;C:\Qt\Tools\QtCreator\bin;%PATH%
2017-12-12 16:05:49 +03:00
- python --version
2017-03-01 17:59:05 +03:00
install:
2017-09-27 17:40:13 +03:00
- choco upgrade -y all
- choco install swig -y --allow-empty-checksums
2017-08-02 14:52:40 +03:00
- choco upgrade swig
# Compute version before dirtying directory with PyOtherSide build
- python compute-version.py yubioath-desktop- > VERSION
2017-03-01 17:59:05 +03:00
# Build and install PyOtherSide
# Reference: https://pyotherside.readthedocs.io/en/latest/#building-for-windows
2018-02-09 10:46:34 +03:00
- 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%
2017-03-01 17:59:05 +03:00
- ps: (Get-Content .\src\qmldir).replace('pyothersideplugin', 'pyothersideplugin1') | Set-Content .\src\qmldir
- ps: Clear-Content python.pri
2017-03-23 15:16:18 +03:00
- ps: Add-Content python.pri "PYTHON_CONFIG = python3-config`nQMAKE_LIBS += -LC:\Python36\libs -lpython36`nQMAKE_CXXFLAGS += -IC:\Python36\include`n"
2017-03-01 17:59:05 +03:00
- qmake
- jom
- jom install
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- qmake yubioath-desktop.pro
- jom
after_build:
2017-08-02 14:52:40 +03:00
- ps: wget "https://developers.yubico.com/libu2f-host/Releases/libu2f-host-$env:LIBU2F_HOST_VERSION-win32.zip" -OutFile "libu2f-host-$env:LIBU2F_HOST_VERSION-win32.zip"
- 7z x libu2f-host-%LIBU2F_HOST_VERSION%-win32.zip -o".\libu2f-host"
2017-03-02 11:26:17 +03:00
- ps: Copy-Item .\libu2f-host\bin\*.dll .\release -Force
2017-08-02 14:52:40 +03:00
- ps: wget "https://developers.yubico.com/yubikey-personalization/Releases/ykpers-$env:YKPERS_VERSION-win32.zip" -OutFile "ykpers-$env:YKPERS_VERSION-win32.zip"
- 7z x ykpers-%YKPERS_VERSION%-win32.zip -o".\ykpers"
2017-03-02 11:26:17 +03:00
- ps: Copy-Item .\ykpers\bin\*.dll .\release -Force
2017-08-02 14:52:40 +03:00
- 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"
2017-03-02 11:26:17 +03:00
- ps: Copy-Item .\libusb\MS32\dll\*.dll .\release -Force
2017-08-02 14:52:40 +03:00
2017-09-15 14:16:07 +03:00
- ps: wget https://www.python.org/ftp/python/$env:PY_VERSION/python-$env:PY_VERSION-embed-win32.zip -OutFile python-$env:PY_VERSION-embed-win32.zip
- 7z x python-%PY_VERSION%-embed-win32.zip -o".\release"
2017-03-01 17:59:05 +03:00
# Use Qt deployment tool on executable
- windeployqt .\release\yubioath-desktop.exe --qmldir=qml --no-translations --angle --release
# Workaround:
# Manually add pyotherside plugin to release folder.
# Should be handled by windeployqt, but doesn't seem to be when QML Settings are used (?).
- ps: Copy-Item C:\Qt\5.9\msvc2015\qml\io .\release -recurse -Force
2017-03-01 17:59:05 +03:00
# Add python dependencies to release folder
2017-03-02 11:26:17 +03:00
- ps: Copy-Item .\pymodules .\release -recurse
2017-03-01 17:59:05 +03:00
# 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
2017-03-23 15:44:31 +03:00
# Remove .cpp source files
- ps: Get-ChildItem -Include *.cpp -Recurse | Remove-Item -Force
2017-03-13 14:38:53 +03:00
# Remove object files
- ps: Get-ChildItem -Include *.obj -Recurse | Remove-Item -Force
# Remove vcruntime140.dll and sqllite3.dll from python-embed
- ps: Get-ChildItem -Include vcruntime140.dll -Recurse | Remove-Item -Force
2017-03-23 16:07:00 +03:00
- ps: Get-ChildItem -Include sqlite3.dll -Recurse | Remove-Item -Force
- ps: Get-ChildItem -Include _sqlite3.pyd -Recurse | Remove-Item -Force
2017-03-01 17:59:05 +03:00
# Create zip for deployment
- set ARTIFACT_NAME=%APPVEYOR_REPO_BRANCH%
- if defined APPVEYOR_REPO_TAG_NAME set ARTIFACT_NAME=%APPVEYOR_REPO_TAG_NAME%
- 7z a yubioath-desktop-%ARTIFACT_NAME%-win.zip .\release\*
2017-03-01 17:59:05 +03:00
- cd %APPVEYOR_BUILD_FOLDER%
artifacts:
- path: yubioath-desktop-$(ARTIFACT_NAME)-win.zip
2017-09-13 15:08:49 +03:00
2017-03-01 17:59:05 +03:00
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