yubioath-flutter/.github/workflows/windows-x64.yml
2019-11-28 09:09:59 +01:00

140 lines
5.5 KiB
YAML

name: windows 64 bit
on: [push, pull_request]
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- name: Download dependencies
run: |
wget https://download.qt.io/official_releases/jom/jom.zip -OutFile jom.zip
wget https://github.com/thp/pyotherside/archive/1.5.3.zip -OutFile pyotherside-1.5.3.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win64.zip -OutFile ykpers-1.20.0-win64.zip
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win64.zip.sig -OutFile ykpers-1.20.0-win64.zip.sig
wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z -OutFile libusb-1.0.22.7z
wget https://www.python.org/ftp/python/3.6.8/python-3.6.8-embed-amd64.zip -OutFile python-3.6.8-embed-amd64.zip
shell: powershell
- name: Fetch GPG keys
run: gpg --no-default-keyring --keyring yubico --recv-keys 0A3B0262BCA1705307D5FF06BCA00FD4B2168C0A
- name: Verify signature/checksums of downloaded files
run: |
sha256sum -c ./.github/workflows/windows-libs.sha256sum
gpg --no-default-keyring --keyring yubico --verify ykpers-1.20.0-win64.zip.sig ykpers-1.20.0-win64.zip
- name: Install QT and jom
run: |
pip install aqtinstall
python -m aqt install 5.13.1 windows desktop win64_msvc2017_64
7z x jom.zip
- name: Prepare pyotherside
run: |
7z x pyotherside-1.5.3.zip
cd pyotherside-1.5.3
(Get-Content .\src\qmldir).replace('pyothersideplugin', 'pyothersideplugin1') | Set-Content .\src\qmldir
Clear-Content python.pri
Add-Content python.pri "PYTHON_CONFIG = python3-config`nQMAKE_LIBS += -LC:\hostedtoolcache\windows\Python\3.6.8\x64\libs -lpython36`nQMAKE_CXXFLAGS += -IC:\hostedtoolcache\windows\Python\3.6.8\x64\include`n"
shell: powershell
- name: Build and install pyotherside
run: |
set PATH=D:\a\yubioath-desktop\yubioath-desktop\Qt5.13.1\5.13.1\msvc2017_64\bin;D:\a\yubioath-desktop\yubioath-desktop;%PATH%
call C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
cd pyotherside-1.5.3
qmake
jom
jom install
shell: cmd
- name: Build app
run: |
set PATH=D:\a\yubioath-desktop\yubioath-desktop\Qt5.13.1\5.13.1\msvc2017_64\bin;D:\a\yubioath-desktop\yubioath-desktop;%PATH%
call C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
qmake
jom
shell: cmd
- name: Copy ykpers and libusb dll files
run: |
7z x ykpers-1.20.0-win64.zip
Copy-Item .\bin\*.dll .\release -Force
7z x libusb-1.0.22.7z
Copy-Item .\MS64\dll\*.dll .\release -Force
cd .\release
7z x ..\python-3.6.8-embed-amd64.zip
shell: powershell
- name: Run windeployqt
run: |
set PATH=D:\a\yubioath-desktop\yubioath-desktop\Qt5.13.1\5.13.1\msvc2017_64\bin;D:\a\yubioath-desktop\yubioath-desktop;%PATH%
call C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
windeployqt .\release\yubioath-desktop.exe --qmldir=qml --no-translations --angle --release
shell: cmd
- name: Copy over files to release folder
shell: powershell
run: |
Copy-Item .\pymodules .\release -recurse
Get-ChildItem -File -Include *.pyc -Recurse | Remove-Item -Force
Get-ChildItem -Include __pycache__ -Recurse | Remove-Item -Force
Get-ChildItem -Include *.cpp -Recurse | Remove-Item -Force
Get-ChildItem -Include *.obj -Recurse | Remove-Item -Force
- name: Create .zip artifact
shell: powershell
run: |
$arr = $env:GITHUB_REF -split '/'
$branch = $arr[2]
7z a yubioath-desktop-$branch-win64.zip release
mkdir deploy
cp yubioath-desktop-$branch-win64.zip deploy
- name: Install Visual Studio C++ 2019 Redistributable MSMs
shell: cmd
run: |
choco install visualstudio2019community --package-parameters "--add Microsoft.VisualStudio.Component.VC.Redist.MSM"
- name: Create an unsigned .msi installer package
shell: cmd
run: |
set PATH=%WIX%\bin;%PATH%
set SRCDIR=.\release\
heat dir .\release -out fragment.wxs -gg -scom -srd -sfrag -dr INSTALLDIR -cg ApplicationFiles -var env.SRCDIR
candle .\fragment.wxs .\resources\win\yubioath-desktop.wxs -arch x64
light fragment.wixobj yubioath-desktop.wixobj -ext WixUIExtension -ext WixUtilExtension -o yubioath-desktop.msi
cp yubioath-desktop.msi deploy
- name: Run installer
shell: cmd
run: |
msiexec /i yubioath-desktop.msi /quiet /l .\log.txt
cat .\log.txt
- name: Rename installer
shell: powershell
run: |
$arr = $env:GITHUB_REF -split '/'
$branch = $arr[2]
mv .\deploy\yubioath-desktop.msi .\deploy\yubioath-desktop-$branch-win64.msi
- name: Run GUI
shell: bash
run: |
./release/yubioath-desktop --version
./release/yubioath-desktop --help
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubioath-desktop-win64
path: deploy