forked from qt-creator/qt-creator
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (129 loc) · 5.87 KB
/
build_qbs.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Qbs Build Matrix
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows 2022 MSVC"
artifact: "Windows-MSVC"
os: windows-2022
qt_version: "6.7.3"
qt_arch: "win64_msvc2019_64"
qt_modules: qtimageformats qtserialport qtquicktimeline qtquick3d qt5compat qtshadertools qtmultimedia
qt_tools: tools_opensslv3_x64,qt.tools.opensslv3.win_x64
qt_version_x86: "5.15.2"
qt_arch_x86: "win32_msvc2019"
libclang_url: "https://github.com/hicknhack-software/Qt-llvm-project/releases/download/libclang-release_19.1.0_based_23-Sep-2024_14-52/libclang-release_19.1.0-based-windows-vs2019_64.7z"
jom_url: "https://download.qt.io/official_releases/jom/jom_1_1_3.zip"
qbs_url: "https://download.qt.io/official_releases/qbs/2.4.2/qbs-windows-x86_64-2.4.2.zip"
vcvars_x64: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat
vcvars_x86: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat
steps:
- name: Get LibClang
shell: cmake -P {0}
run: file(DOWNLOAD "${{ matrix.config.libclang_url }}" ./libclang.7z SHOW_PROGRESS)
- run: 7z x libclang.7z
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Get Qbs
shell: cmake -P {0}
run: file(DOWNLOAD "${{ matrix.config.qbs_url }}" ./qbs.zip)
- run: |
7z x qbs.zip -oqbs
echo "${{ github.workspace }}/qbs/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get JOM
shell: cmake -P {0}
run: file(DOWNLOAD "${{ matrix.config.jom_url }}" ./jom.zip)
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
dir: ${{ runner.workspace }}/x64
version: "${{ matrix.config.qt_version }}"
arch: "${{ matrix.config.qt_arch }}"
modules: ${{ matrix.config.qt_modules }}
tools: ${{ matrix.config.qt_tools }}
cache: true
cache-key-prefix: CacheQtx64
extra: '--external 7z'
- name: Copy OpenSSL DLLs
run: |
copy ${{ runner.workspace }}/x64/Qt/Tools/OpenSSLv3/Win_x64/bin/*.dll $Env:QT_ROOT_DIR\bin
- name: Setup Qbs
run: |
qbs setup-toolchains --type msvc $(cmd /c '"${{ matrix.config.vcvars_x64 }}" >nul & where cl') msvc-x64
qbs setup-qt $Env:QT_ROOT_DIR\bin\qmake.exe qt-x64
qbs config profiles.qt-x64.baseProfile msvc-x64
- uses: actions/checkout@v4
with:
path: Repo
- working-directory: Repo
run: |
git submodule set-url -- src/tools/perfparser https://code.qt.io/qt-creator/perfparser.git
git submodule set-url -- src/shared/qbs https://github.com/hicknhack-software/Qt-Qbs.git
git submodule update --init --recursive
- name: Build
working-directory: Repo
run: |
$Env:Path += ";${{ github.workspace }}\libclang\bin"
$Env:LLVM_INSTALL_DIR = "${{ github.workspace }}\libclang"
$Env:QTC_ENABLE_CLANG_LIBTOOLING = "true"
$Env:PYTHON_INSTALL_DIR = "$Env:pythonLocation"
qbs build -d $ENV:TMP\build `
qbs.installRoot:${{ github.workspace }}/install-root `
profile:qt-x64 config:Release qbs.defaultBuildVariant:release
- name: Deploy
working-directory: ${{ github.workspace }}/install-root
run: |
python -u ${{ github.workspace }}/Repo/scripts/deploy.py --llvm-path ${{ github.workspace }}/libclang ${{ github.workspace }}/install-root/bin/qtcreator.exe $Env:QT_ROOT_DIR/bin/qmake.exe
- name: x86 Install Qt
uses: jurplel/install-qt-action@v4
with:
dir: ${{ runner.workspace }}/x86
version: "${{ matrix.config.qt_version_x86 }}"
arch: ${{ matrix.config.qt_arch_x86 }}
cache: true
cache-key-prefix: CacheQtx86
extra: '--external 7z'
- name: x86 Setup Qbs
run: |
qbs setup-toolchains --type msvc $(cmd /c '"${{ matrix.config.vcvars_x86 }}" >nul & where cl') msvc-x86
qbs setup-qt $Env:QT_ROOT_DIR\bin\qmake.exe qt-x86
qbs config profiles.qt-x86.baseProfile msvc-x86
- name: x86 Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
architecture: 'x86'
- name: x86 Build
working-directory: Repo
run: |
$Env:PYTHON_INSTALL_DIR = "$Env:pythonLocation"
qbs build -d $ENV:TMP\build-x86 `
qbs.installRoot:${{ github.workspace }}/install-root `
profile:qt-x86 config:Release qbs.defaultBuildVariant:release `
-p qtcreatorcdbext
- name: Add JOM
run: 7z x jom.zip -o${{ github.workspace }}/install-root/bin/jom
- name: Pack
working-directory: ${{ github.workspace }}/install-root
run: 7z a ../QtCreator-${{ matrix.config.qt_arch }}-${{ github.run_id }}.7z * -r
- name: Upload
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/QtCreator-${{ matrix.config.qt_arch }}-${{ github.run_id }}.7z
name: QtCreator-${{ matrix.config.qt_arch }}-${{ github.run_id }}.7z
- name: Upload binaries to release
if: contains(github.ref, 'tags/v')
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: Release ${{ github.ref }}
# body: ${{ github.event.head_commit.message }}
overwrite: true
file: ${{ github.workspace }}/QtCreator-${{ matrix.config.qt_arch }}-${{ github.run_id }}.7z