Actions: aqt fix #667
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: windows 32bit | |
on: [push, pull_request] | |
env: | |
PYTHON_VER_DIRNAME: 'python311' | |
PYOTHERSIDE_VER: '1.5.9' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: '3.11.8' | |
architecture: 'x86' | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v2.10.0 | |
with: | |
version: '5.14.1' | |
host: 'windows' | |
target: 'desktop' | |
arch: 'win32_msvc2017' | |
aqtversion: '==0.9.7' | |
- name: Download dependencies | |
run: | | |
$py_ver = python -V | |
$py_ver -match "python (?<content>.*)" | |
$version = $matches['content'] | |
wget https://download.qt.io/official_releases/jom/jom.zip -OutFile jom.zip | |
wget https://github.com/thp/pyotherside/archive/$env:PYOTHERSIDE_VER.zip -OutFile pyotherside-$env:PYOTHERSIDE_VER.zip | |
wget https://www.python.org/ftp/python/$version/python-$version-embed-win32.zip -OutFile python-$version-embed-win32.zip | |
shell: powershell | |
- name: Install swig | |
run: choco install swig | |
- name: Install jom | |
run: | | |
7z x jom.zip | |
- name: Prepare pyotherside | |
run: | | |
$py_ver = python -V | |
$py_ver -match "python (?<content>.*)" | |
$version = $matches['content'] | |
7z x pyotherside-$env:PYOTHERSIDE_VER.zip | |
cd pyotherside-$env:PYOTHERSIDE_VER | |
(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\$version\x86\libs -l$env:PYTHON_VER_DIRNAME`nQMAKE_CXXFLAGS += -IC:\hostedtoolcache\windows\Python\$version\x86\include`n" | |
shell: powershell | |
- name: Build and install pyotherside | |
shell: cmd | |
run: | | |
set PATH=D:\a\yubikey-manager-qt\yubikey-manager-qt\5.14.1\msvc2017\bin;D:\a\yubikey-manager-qt\yubikey-manager-qt;%PATH% | |
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x86 | |
cd pyotherside-%PYOTHERSIDE_VER% | |
qmake | |
jom | |
jom install | |
- name: Build app | |
shell: cmd | |
run: | | |
$py_ver = python -V | |
$py_ver -match "python (?<content>.*)" | |
$version = $matches['content'] | |
set PATH=D:\a\yubikey-manager-qt\yubikey-manager-qt\5.14.1\msvc2017\bin;D:\a\yubikey-manager-qt\yubikey-manager-qt;%PATH% | |
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x86 | |
qmake | |
jom | |
- name: Run windeployqt | |
shell: cmd | |
run: | | |
set PATH=D:\a\yubikey-manager-qt\yubikey-manager-qt\5.14.1\msvc2017\bin;D:\a\yubikey-manager-qt\yubikey-manager-qt;%PATH% | |
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x86 | |
windeployqt .\ykman-gui\release\ykman-gui.exe --qmldir=.\ykman-gui\qml --no-translations --angle --release | |
- name: Copy over files and create .zip archive | |
shell: powershell | |
run: | | |
$py_ver = python -V | |
$py_ver -match "python (?<content>.*)" | |
$version = $matches['content'] | |
Remove-Item .\ykman-gui\pymodules\bin -Force -Recurse | |
Copy-Item .\ykman-gui\pymodules .\ykman-gui\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 | |
Copy-Item .\ykman-cli\release\ykman.exe .\ykman-gui\release | |
cd .\ykman-gui\release | |
7z x ..\..\python-$version-embed-win32.zip | |
- name: Create .zip artifact | |
shell: powershell | |
run: | | |
$arr = $env:GITHUB_REF -split '/' | |
$branch = $arr[2] | |
7z a yubikey-manager-qt-$branch-win32.zip .\ykman-gui\release | |
mkdir deploy | |
cp yubikey-manager-qt-$branch-win32.zip deploy | |
- name: Run GUI | |
shell: bash | |
run: | | |
./ykman-gui/release/ykman-gui --version | |
./ykman-gui/release/ykman-gui --help | |
- name: Run CLI | |
shell: bash | |
run: | | |
./ykman-gui/release/ykman --version | |
[[ -z "$(./ykman-gui/release/ykman --version | grep -E "not found|missing")" ]] | |
- name: Upload artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: yubikey-manager-qt-win32 | |
path: deploy |