-
-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (113 loc) · 4.48 KB
/
msbuild.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
name: Windows Build
on: [push]
env:
# Path to the solution file relative to the root of the project.
# -G "Visual Studio 16 2019"
SOLUTION_FILE_PATH: .
VSCP_PATH: ${{github.workspace}}/third_party/vscp
ENVIRONMENT_SCRIPT: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
GENERATORS: "Visual Studio 17 2022"
BUILD_CONFIGURATION: Release
TRIPLET: x64-windows
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
#
# https://github.com/marketplace/actions/run-vcpkg
# https://github.com/ilammy/msvc-dev-cmd
jobs:
build:
name: Windows x64
runs-on: windows-latest
steps:
- name: Install ms-dev environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# https://ddalcino.github.io/aqt-list-server/ qtserialbus qtserialport
- name: Prepare Qt Libraries
uses: jurplel/install-qt-action@v3
with:
version: '6.8.0'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2022_64'
modules: 'qtcharts'
archives: 'qtbase qtsvg qttools qtwebsockets qtdeclarative'
cache: 'true'
cache-key-prefix: 'install-qt-action'
setup-python: 'true'
tools: 'tools_qtcreator,qt.tools.qtcreator'
set-env: 'true'
tools-only: 'false'
aqtversion: '==3.1.*'
py7zrversion: '==0.20.*'
extra: '--external 7z'
- name: Clone
uses: actions/checkout@v4
with:
submodules: 'recursive'
# - name: Install vcpkg
# uses: lukka/run-vcpkg@v2
# with:
# vcpkgDirectory: 'C:/vcpkg/'
# vcpkgArguments: '@C:/vcpkg/.txt'
# appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
# Install latest CMake.
- name: Get latest CMake and ninja
uses: lukka/get-cmake@latest
with:
# Just install vcpkg for now, do not install any ports in this step yet.
setupOnly: true
# Location of the vcpkg as submodule of the repository.
vcpkgDirectory: 'C:/vcpkg/'
# Since the cache must be invalidated when content of the vcpkg.json file changes, let's
# compute its hash and append this to the computed cache's key.
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: '${{ env.TRIPLET }}'
# Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed'.
additionalCachedPaths: '${{ env.buildDir }}/vcpkg_installed'
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Install 7Zip PowerShell Module
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose
#- name: Prepare Qt Libraries
# uses: jurplel/install-qt-action@v2
# - name: Cache vcpkg
# id: cache-vcpkg
# uses: actions/cache@v2
# with:
# path: vcpkg
# key: ${{ runner.os }}-vcpkg
# - name: Checkout vcpkg repo
# uses: actions/checkout@v4
# with:
# repository: microsoft/vcpkg
# path: C:/vcpkg
- name: Integrate with development environment and install
shell: cmd
working-directory: C:/vcpkg/
run: |
call C:/vcpkg/vcpkg.exe/bootstrap-vcpkg.bat
C:/vcpkg/vcpkg.exe integrate install
C:/vcpkg/vcpkg.exe install curl:x64-windows
C:/vcpkg/vcpkg.exe install expat:x64-windows
C:/vcpkg/vcpkg.exe install spdlog:x64-windows
C:/vcpkg/vcpkg.exe install libmosquitto:x64-windows
C:/vcpkg/vcpkg.exe install mosquitto:x64-windows
C:/vcpkg/vcpkg.exe install pthread:x64-windows
C:/vcpkg/vcpkg.exe install dlfcn-win32:x64-windows
C:/vcpkg/vcpkg.exe install openssl:x64-windows
C:/vcpkg/vcpkg.exe install paho-mqtt:x64-windows
C:/vcpkg/vcpkg.exe install libwebsockets:x64-windows
- name: Configure CMake and build
run: |
mkdir build
cd build
cmake -S .. -B . -G "${{ env.GENERATORS }}" -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows -D"CMAKE_BUILD_TYPE=${{ env.BUILD_CONFIGURATION }}" -D"CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake --build . --config "${{ env.BUILD_CONFIGURATION }}"
# msbuild libvscphelper.sln /p:Configuration=Release
#cpack .