forked from gmh5225/static-build-qt6
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 3.54 KB
/
msvc-qt.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
name: msvc-static
on: [push, workflow_dispatch]
jobs:
matrix_build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
msvc: [msvc2022, msvc2019]
arch: [win64, win32]
os: [windows-2019, windows-2022]
FEATURE_cxx20: [ON, OFF]
exclude:
- os: windows-2019
FEATURE_cxx20: ON
- os: windows-2022
FEATURE_cxx20: OFF
- os: windows-2019
msvc: msvc2022
- os: windows-2022
msvc: msvc2019
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.3.0
- run: python --version
- name: Setup the compiler target win64
if: startsWith(matrix.arch, 'win64')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: 'x64'
- name: Setup the compiler target win32
if: startsWith(matrix.arch, 'win32')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: 'x86'
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Cache huge Qt repo
id: cache-qt-repo
uses: actions/cache@v4
with:
path: ${{ runner.workspace }}/qt-source
key: qt-source-6.8.1
- name: Clone Qt repo and its submodules
working-directory: ${{ runner.workspace }}
if: steps.cache-qt-repo.outputs.cache-hit != 'true'
run: |
# Clone Qt6 repo
git clone https://github.com/qt/qt5.git -b v6.8.1 --depth 1 qt-source
cd qt-source
git apply ${{ github.workspace }}/0001-shadow-clone-for-submodules.patch
perl init-repository.pl --shallow --mirror https://github.com/qt/
- name: create build directory
working-directory: ${{ runner.workspace }}
run: mkdir qt-build
- name: configure Qt for static build
working-directory: ${{ runner.workspace }}/qt-build
run: >
..\qt-source\configure.bat -debug-and-release -static -static-runtime -no-pch -optimize-size -platform win32-msvc
-prefix "..\qt-release" -confirm-license
-no-feature-accessibility
-no-feature-valgrind
-no-feature-appstore-compliant
-no-feature-assistant
-no-feature-example-hwr
-no-feature-windeployqt
-no-feature-macdeployqt
-no-feature-androiddeployqt
-no-feature-designer
-no-feature-qdbus
-no-feature-qtdiag
-no-feature-qtplugininfo
-skip qtopcua,qtgrpc,qt3d,qtcanvas3d,qtdatavis3d,qtgamepad,qtcharts,qtconnectivity,qtmqtt,qtcoap,qtqa,qtdbus,qtremoteobjects,qtpim,qtspeech,qtfeedback,qtactiveqt,qtserialbus,qtserialport,tests
-- -DFEATURE_cxx20=${{ matrix.FEATURE_cxx20 }}
- name: build qt
working-directory: ${{ runner.workspace }}/qt-build
run: cmake --build . --parallel 4
- name: install qt to temp dir
working-directory: ${{ runner.workspace }}/qt-build
run: cmake --install .
# Create archive of the pre-built Qt binaries
- name: Package binaries
working-directory: ${{ runner.workspace }}/qt-release
run: 7z a ${{ github.workspace }}\\qt6_681_${{ matrix.arch }}-${{ matrix.msvc }}_static.zip .
- name: Release
uses: softprops/action-gh-release@v2.1.0
if: startsWith(github.ref, 'refs/tags/')
with:
files: qt6_681_${{ matrix.arch }}-${{ matrix.msvc }}_static.zip
- name: Upload artifact
uses: actions/upload-artifact@v4.4.3
with:
overwrite: true
name: qt6_681_${{ matrix.arch }}-${{ matrix.msvc }}_static
path: ${{ runner.workspace }}/qt-release