-
-
Notifications
You must be signed in to change notification settings - Fork 48
106 lines (92 loc) · 3.77 KB
/
win7-msvc.yml
File metadata and controls
106 lines (92 loc) · 3.77 KB
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
# Author: Greedysky <greedysky@163.com>
name: win7-msvc
on: workflow_call
env:
TTK_MODULE: TTKTinyTools
TTK_VERSION: 3.2.0.0
jobs:
build:
name: Build on Qt5
strategy:
matrix:
arch: [32, 64]
os: [windows-2022]
include:
- arch: 32
target: x86
qt_arch: win32_msvc2019
- arch: 64
target: x64
qt_arch: win64_msvc2019_64
env:
QT_VERSION: 5.15.2
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v5
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
host: windows
arch: ${{matrix.qt_arch}}
target: desktop
cache: 'true'
- name: Add patch for Qt5.15.2
if: env.QT_VERSION == '5.15.2'
shell: bash
run: |
# fix missing <limits> include
# see QTBUG-89977 https://bugreports.qt.io/browse/QTBUG-89977
# see QTBUG-90395 https://bugreports.qt.io/browse/QTBUG-90395
# see QTBUG-93452 https://bugreports.qt.io/browse/QTBUG-93452
# see here https://codereview.qt-project.org/c/qt/qtbase/+/330713
sed -i "46i#include <limits>" "${{env.QT_ROOT_DIR}}\include\QtCore\qfloat16.h"
working-directory: ${{runner.workspace}}
- name: Create build dir
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Build project with cmake
shell: cmd
run: |
qmake -v
cmake --version
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.target}}
cmake ${{github.workspace}} -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/install -DTTK_QT_VERSION=5
set CL=/MP4
nmake && nmake install
working-directory: ${{runner.workspace}}/build
- name: Build project with qmake
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.target}}
qmake "CONFIG+=release" .
set CL=/MP4
nmake
working-directory: ${{github.workspace}}
- name: Build package
run: |
# add dependency for openssl
curl -L https://github.com/Greedysky/Resource/releases/download/1.0.0.0/openssl.7z -o openssl.7z
7z x openssl.7z
cp win${{matrix.arch}}/v1/*.dll ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}
# add dependency libraries and so on
windeployqt ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/TTKBarrage.exe
cp ${{env.QT_ROOT_DIR}}/bin/Qt5Xml.dll ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}
# remove useless library dependency
ls -Filter "*.lib" -Recurse | Remove-Item -Force
ls -Filter "*.exp" -Recurse | Remove-Item -Force
rm ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/D3D*.dll
rm ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/libEGL.dll
rm ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/libGLESv2.dll
rm ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/opengl32sw.dll
rm ${{env.TTK_MODULE}}/${{env.TTK_VERSION}}/translations -Recurse
# add portable binary package
7z a ${{env.TTK_MODULE}}-${{env.TTK_VERSION}}-win7-msvc-${{matrix.target}}.7z ${{env.TTK_MODULE}}
working-directory: ${{runner.workspace}}/install
- name: Archive artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{env.TTK_VERSION}}
token: ${{secrets.GITHUB_TOKEN}}
generate_release_notes: false
files: ${{runner.workspace}}/install/${{env.TTK_MODULE}}-${{env.TTK_VERSION}}-win7-msvc-${{matrix.target}}.7z