-
Notifications
You must be signed in to change notification settings - Fork 29
126 lines (106 loc) · 4.61 KB
/
windows-x64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: windows 64bit
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: 'x64'
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.14.1'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2017_64'
- 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-amd64.zip -OutFile python-$version-embed-amd64.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\x64\libs -l$env:PYTHON_VER_DIRNAME`nQMAKE_CXXFLAGS += -IC:\hostedtoolcache\windows\Python\$version\x64\include`n"
shell: powershell
- name: Build and install pyotherside
run: |
set PATH=D:\a\yubikey-manager-qt-private\Qt\5.14.1\msvc2017_64\bin;D:\a\yubikey-manager-qt-private\yubikey-manager-qt-private;%PATH%
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
cd pyotherside-%PYOTHERSIDE_VER%
qmake
jom
jom install
shell: cmd
- name: Build app
shell: cmd
run: |
set PATH=D:\a\yubikey-manager-qt-private\yubikey-manager-qt-private\5.14.1\msvc2017_64\bin;D:\a\yubikey-manager-qt-private\yubikey-manager-qt-private;%PATH%
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
qmake
jom
- name: Run windeployqt
shell: cmd
run: |
set PATH=D:\a\yubikey-manager-qt-private\yubikey-manager-qt-private\5.14.1\msvc2017_64\bin;D:\a\yubikey-manager-qt-private\yubikey-manager-qt-private;%PATH%
call C:\"Program Files\Microsoft Visual Studio"\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat x64
windeployqt .\ykman-gui\release\ykman-gui.exe --qmldir=.\ykman-gui\qml --no-translations --angle --release
- name: Copy over files and create .zip archive
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-amd64.zip
shell: powershell
- name: Create .zip artifact
shell: powershell
run: |
$arr = $env:GITHUB_REF -split '/'
$branch = $arr[2]
7z a yubikey-manager-qt-$branch-win64.zip .\ykman-gui\release
mkdir deploy
cp yubikey-manager-qt-$branch-win64.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-win64
path: deploy