-
-
Notifications
You must be signed in to change notification settings - Fork 261
237 lines (216 loc) · 10.7 KB
/
Copy pathmsvc.yml
File metadata and controls
237 lines (216 loc) · 10.7 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# Author: Kang Lin <kl222@126.com>
name: build_msvc
on:
workflow_call:
outputs:
name:
description: "The artifact name"
value: ${{ jobs.build_msvc.outputs.name }}
jobs:
build_msvc:
strategy:
matrix:
include:
- CMAKE_GENERATOR_PLATFORM: x64
VCPKG_TARGET_TRIPLET: x64-windows
VCPKG_PLATFORM_TOOLSET: v143
BUILD_TYPE: Release
qt_version: 6.10.3
qt_arch: win64_msvc2022_64
qt_modules: qtscxml qtmultimedia qtimageformats qt5compat qtpositioning
os: windows-2022
- CMAKE_GENERATOR_PLATFORM: arm64
VCPKG_TARGET_TRIPLET: arm64-windows
VCPKG_PLATFORM_TOOLSET: v143
BUILD_TYPE: Release
qt_version: 6.10.3
qt_arch: win64_msvc2022_arm64
qt_modules: qt5compat qtimageformats qtmultimedia qtpositioning qtscxml
os: windows-11-arm
- CMAKE_GENERATOR_PLATFORM: Win32
VCPKG_TARGET_TRIPLET: x86-windows
VCPKG_PLATFORM_TOOLSET: v143
VCPKG_OVERLAY_PORTS: "vcpkg/ports"
BUILD_TYPE: Release
#VCPKG_MANIFEST_FEATURES: "ffmpeg"
qt_version: 5.15.2
qt_arch: win32_msvc2019
qt_modules: qtwebengine
os: windows-2022
# See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners)
# See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job)
# See: https://github.com/actions/runner-images/
runs-on: ${{matrix.os}}
env:
SOURCE_DIR: ${{github.workspace}}\.cache\source
TOOLS_DIR: ${{github.workspace}}\.cache\tools
INSTALL_DIR: ${{github.workspace}}\.cache\install_${{matrix.BUILD_TYPE}}
BUILD_DIR: ${{github.workspace}}\build
VCPKGGITCOMMITID: 7213cf8135c329c37c7e2778e40774489a0583a8
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_DEFAULT_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
#VCPKG_OVERLAY_PORTS: "${{github.workspace}}/${{matrix.VCPKG_OVERLAY_PORTS}}"
#VCPKG_MANIFEST_FEATURES: ""
VCPKG_INSTALLED_DIR: ${{github.workspace}}\.cache\install
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
qt_modules: "${{matrix.qt_modules}}"
artifact_name: build_msvc
RabbitIM_VERSION: v0.1.0
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
defaults:
run:
shell: cmd
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Make directories
run: |
cmake -E make_directory ${{env.BUILD_DIR}}
cmake -E make_directory ${{env.SOURCE_DIR}}
cmake -E make_directory ${{env.TOOLS_DIR}}
cmake -E make_directory ${{env.INSTALL_DIR}}
- name: Cache installed
uses: actions/cache@v4
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: install_msvc_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}}
- name: run-vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{env.SOURCE_DIR}}/vcpkg
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
dir: '${{env.TOOLS_DIR}}/qt' # optional
version: '${{matrix.qt_version}}' # optional, default is 5.15.2
arch: '${{matrix.qt_arch}}' # optional
modules: '${{env.qt_modules}}' # optional. see: https://ddalcino.github.io/aqt-list-server/
cache: true
cache-key-prefix: cached-qt_${{matrix.qt_version}}_${{matrix.qt_arch}}
- name: build qxmpp
working-directory: ${{env.SOURCE_DIR}}
run: |
IF NOT EXIST ${{env.INSTALL_DIR}}/lib/cmake/qxmpp (
git clone https://invent.kde.org/libraries/qxmpp.git
cd qxmpp
git checkout -b v1.10.2 v1.10.2
cmake -E make_directory build
cd build
cmake .. ^
-A ${{matrix.CMAKE_GENERATOR_PLATFORM}} ^
-T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF ^
-DBUILD_DOCUMENTATION=OFF ^
-DCMAKE_INSTALL_PREFIX=${{env.INSTALL_DIR}} ^
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}/lib/cmake ^
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ^
-DVCPKG_INSTALLED_DIR=${{env.INSTALL_DIR}}/qxmpp/vcpkg_installed ^
-DVCPKG_VERBOSE=ON ^
-DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=OFF ^
-DVCPKG_APPLOCAL_DEPS=OFF ^
-DVCPKG_TRACE_FIND_PACKAGE=ON
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --install . --config ${{matrix.BUILD_TYPE}} --strip
)
- name: build qzxing
if: ${{ matrix.qt_version == '5.15.2' }}
working-directory: ${{env.SOURCE_DIR}}
run: |
IF NOT EXIST ${{env.INSTALL_DIR}}/lib/cmake/qzxing/ (
git clone https://github.com/KangLin/qzxing.git
cd qzxing
git submodule update --init --recursive
cmake -E make_directory build
cd build
cmake .. ^
-A ${{matrix.CMAKE_GENERATOR_PLATFORM}} ^
-T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DCMAKE_INSTALL_PREFIX=${{env.BUILD_DIR}}/install ^
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}}
cmake --build . --config ${{matrix.BUILD_TYPE}}
cmake --install . --config ${{matrix.BUILD_TYPE}} --strip
)
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: git clone https://github.com/KangLin/RabbitCommon.git
- name: Build RabbitIM
working-directory: ${{env.BUILD_DIR}}
env:
RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon
run: |
cmake ${{github.workspace}} ^
-A ${{matrix.CMAKE_GENERATOR_PLATFORM}} ^
-T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^
-DCMARK_SHARED=OFF ^
-DCMARK_TESTS=OFF ^
-DCMARK_STATIC=ON ^
-DWITH_CMARK=OFF ^
-DWITH_CMARK_GFM=ON ^
-DRABBIT_ENABLE_INSTALL_DEPENDENT=ON ^
-DRABBIT_ENABLE_INSTALL_QT=ON ^
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=ON ^
-DRABBIT_ENABLE_INSTALL_TARGETS=ON ^
-DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^
-DCMAKE_INSTALL_PREFIX=${{env.BUILD_DIR}}/install ^
-DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}} ^
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ^
-DVCPKG_VERBOSE=ON ^
-DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^
-DVCPKG_APPLOCAL_DEPS=ON ^
-DVCPKG_TRACE_FIND_PACKAGE=ON ^
-DENABLE_UPDATE_TRANSLATIONS=ON
cmake --build . --config ${{matrix.BUILD_TYPE}}
IF "${{matrix.BUILD_TYPE}}" == "Release" (
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: Runtime"
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Runtime --strip
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: Plugin"
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Plugin --strip
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: DependLibraries"
cmake --install . --config ${{matrix.BUILD_TYPE}} --component DependLibraries --strip
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: Application"
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Application --strip
) else (
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: Runtime Application Plugin"
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Runtime
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Plugin
cmake --install . --config ${{matrix.BUILD_TYPE}} --component DependLibraries
cmake --install . --config ${{matrix.BUILD_TYPE}} --component Application
)
- name: Package
if: ${{ matrix.BUILD_TYPE == 'Release' }}
working-directory: ${{env.BUILD_DIR}}
run: |
move /Y install\plugins\*crypto*.dll install\bin
move /Y install\plugins\*ssl*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\bin\*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\lib\*.dll install\bin
copy /Y ${{env.RUNVCPKG_VCPKG_ROOT}}\installed\${{env.RUNVCPKG_VCPKG_TRIPLET_OUT}}\bin\*.dll install\bin
makensis Install.nsi
copy /Y RabbitIM_Setup_${{env.RabbitIM_VERSION}}.exe RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
md5sum RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe > RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe.md5sum
${{github.workspace}}\build\install\bin\RabbitIMApp.exe ^
-f "update_msvc_${{matrix.qt_arch}}_qt${{matrix.qt_version}}.json" ^
-u https://github.com/KangLin/RabbitIM/releases/download/${{env.RabbitIM_VERSION}}/RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe;https://sourceforge.net/projects/RabbitIM/files/${{env.RabbitIM_VERSION}}/RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe ^
--pf RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe ^
-m "${{env.RabbitIM_VERSION}}"
- name: Update artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}
path: |
${{github.workspace}}\build\RabbitIM_${{env.RabbitIM_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
${{github.workspace}}\build\update_msvc_${{matrix.qt_arch}}_qt${{matrix.qt_version}}.json