-
-
Notifications
You must be signed in to change notification settings - Fork 68
178 lines (158 loc) · 7.38 KB
/
msvc.yml
File metadata and controls
178 lines (158 loc) · 7.38 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
# 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
os: windows-2022
qt_version: 6.9.2
qt_arch: win64_msvc2022_64
qt_modules: qtscxml qtserialport
- CMAKE_GENERATOR_PLATFORM: Win32
VCPKG_TARGET_TRIPLET: x86-windows
VCPKG_PLATFORM_TOOLSET: v143
VCPKG_MANIFEST_DIR: "\\vcpkg\\manifests"
os: windows-2022
qt_version: 5.15.2
qt_arch: win32_msvc2019
- CMAKE_GENERATOR_PLATFORM: arm64
VCPKG_TARGET_TRIPLET: arm64-windows
VCPKG_PLATFORM_TOOLSET: v143
qt_version: 6.9.2
qt_arch: win64_msvc2022_arm64
qt_modules: qtscxml qtserialport
os: windows-11-arm
# 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:
SerialPortAssistant_VERSION: v0.5.33
BUILD_DIR: ${{github.workspace}}\build
SOURCE_DIR: ${{github.workspace}}\.cache\source
TOOLS_DIR: ${{github.workspace}}\.cache\tools
INSTALL_DIR: ${{github.workspace}}\.cache\install_${{matrix.qt_arch}}_Release
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
VCPKGGITCOMMITID: 4c5ae6b55f3e3e39d291679f89822f496cf190ee
VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
VCPKG_MANIFEST_DIR: "${{github.workspace}}${{matrix.VCPKG_MANIFEST_DIR}}"
qt_modules: ${{matrix.qt_modules}}
artifact_name: build_msvc
# Map the job outputs to step outputs
outputs:
name: ${{ env.artifact_name }}
defaults:
run:
shell: cmd
steps:
- name: Checkout Repository
uses: actions/checkout@v3
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@v3
id: cache-installed
with:
path: |
${{env.INSTALL_DIR}}
key: cache-installed-msvc-${{matrix.qt_arch}}
- name: run-vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}}
vcpkgDirectory: ${{runner.workspace}}/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
- name: git clone RabbitCommon
working-directory: ${{env.SOURCE_DIR}}
run: |
git clone https://github.com/KangLin/RabbitCommon.git
- name: build SerialPortAssistant
working-directory: ${{github.workspace}}/build
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 ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install ^
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ^
-DVCPKG_MANIFEST_DIR=${{env.VCPKG_MANIFEST_DIR}} ^
-DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^
-DVCPKG_VERBOSE=ON ^
-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^
-DVCPKG_APPLOCAL_DEPS=ON ^
-DRABBIT_ENABLE_INSTALL_DEPENDENT=ON ^
-DRABBIT_ENABLE_INSTALL_QT=ON ^
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=OFF
cmake --build . --config Release
- name: Package
working-directory: ${{github.workspace}}/build
run: |
cmake --install . --config Release --component=Application
cmake --install . --config Release --component=Runtime
cmake --install . --config Release --component=DependLibraries
copy /Y vcpkg_installed\${{matrix.VCPKG_TARGET_TRIPLET}}\bin\*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\bin\*.dll install\bin
copy /Y ${{env.INSTALL_DIR}}\lib\*.dll install\bin
makensis Install.nsi
copy /Y SerialPortAssistant_Setup_${{env.SerialPortAssistant_VERSION}}.exe SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${{matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
- name: Update configure file
working-directory: ${{github.workspace}}\build
run: |
.\install\bin\SerialPortAssistant.exe ^
-f "${{github.workspace}}\build\update_${{matrix.qt_arch}}_${{matrix.qt_version}}.json" ^
--foc 1 ^
-p ${{github.workspace}}\build\SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${{ matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe ^
-m "${{env.SerialPortAssistant_VERSION}}" ^
-u "https://github.com/KangLin/SerialPortAssistant/releases/download/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${{ matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe ;https://sourceforge.net/projects/rabbitSerialPortAssistant/${{env.SerialPortAssistant_VERSION}}/SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${{ matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe?viasf=1"
- name: Update artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}_${{matrix.qt_version}}_${{matrix.qt_arch}}
path: |
${{github.workspace}}\build\SerialPortAssistant_${{env.SerialPortAssistant_VERSION}}_${{ matrix.qt_arch}}_qt${{matrix.qt_version}}_Setup.exe
${{github.workspace}}\build\update_${{matrix.qt_arch}}_${{matrix.qt_version}}.json
# - name: Upload To Github Release
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# prerelease: true
## body: |
## [:cn: 修改日志](ChangeLog_zh_CN.md) [:us: Change log](ChangeLog.md)
# files: |
# ${{github.workspace}}\build\SerialPortAssistant_Setup_${{env.SerialPortAssistant_VERSION}}.exe
# ${{github.workspace}}\build\update_windows.xml
#