-
Notifications
You must be signed in to change notification settings - Fork 3
205 lines (182 loc) · 6.45 KB
/
build-win64-msvc.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
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
name: build-swiftray-win64-msvc
on:
#workflow_dispatch:
#inputs:
# name:
# Description: 'Build message'
# default: 'Hello'
# required: false
push:
tags:
- "v*.*.*"
jobs:
setup-win-msvc-build-environment:
strategy:
fail-fast: false
matrix:
cfg:
#- { runner: windows-latest, build: 'cmake', dist: false }
- { runner: localhost-win10, build: 'cmake', dist: true}
name: ${{matrix.cfg.runner}} ${{matrix.cfg.build}}
env:
VCPKG_INSTALLATION_ROOT: 'C:\vcpkg'
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
runs-on: ${{matrix.cfg.runner}}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Conan
if: ${{matrix.cfg.runner != 'localhost-win10' }}
id: conan
uses: turtlebrowser/get-conan@main
# vcpkg cache
- name: Restore vcpkg and its artifacts.
if: ${{matrix.cfg.runner != 'localhost-win10' }}
uses: actions/cache@v3
id: vcpkg-cache
with:
path: |
vcpkg_installed
key: |
${{ hashFiles( 'vcpkg.json' ) }}-cache-key-v1
- name: Install packages with vcpkg manifest mode
#if: ${{ matrix.cfg.runner != 'localhost-win10' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
run: |
vcpkg install
- name: Restore Qt cache
if: ${{matrix.cfg.runner != 'localhost-win10' }}
uses: actions/cache@v3
id: qt5-cache
with:
path: |
${{ github.workspace }}/Qt
key: |
qt5-cache-key-v1
- name: Install Qt5
if: ${{matrix.cfg.runner != 'localhost-win10' && steps.qt5-cache.outputs.cache-hit != 'true'}}
run: |
#cd ${{ github.workspace }}
#vcpkg install qt5:x64-windows
python3 -m pip install setuptools wheel
python3 -m pip install py7zr
python3 -m pip install aqtinstall==2.1.0
python3 -m aqt install-qt windows desktop 5.15.2 win64_msvc2019_64 -m debug_info -O ${{ github.workspace }}/Qt
- name: Create build dir
if: ${{matrix.cfg.runner == 'localhost-win10'}}
shell: cmd
run: |
mkdir build
cd ${{ env.VCPKG_INSTALLATION_ROOT }}
dir
cd installed
cd x64-windows
dir include
dir lib
dir bin
- name: Create build dir
if: ${{matrix.cfg.runner != 'localhost-win10'}}
shell: pwsh
run: |
mkdir build
dir ${{ env.VCPKG_INSTALLATION_ROOT }}
if (Test-Path -Path 'vcpkg_installed') {
cd vcpkg_installed
dir
if (Test-Path -Path 'x64_windows') {
cd x64_windows
dir
}
}
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
install: >-
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-autotools
mingw-w64-x86_64-make
mingw-w64-x86_64-zlib
mingw-w64-x86_64-python-conan
#- name: Set 3GB compile memory
# shell: msys2 {0}
# run: |
# bcdedit /set IncreaseUserVa 3072
- name: Build libpotrace
shell: msys2 {0}
run: |
echo $PATH
pwd
cd third_party/libpotrace
curl https://potrace.sourceforge.net/download/1.16/potrace-1.16.tar.gz -o potrace-1.16.tar.gz
tar -xzvf potrace-1.16.tar.gz
conan install . --build=missing
conan build .
conan create . user/testing
- name: Conan install
shell: cmd
run: |
cd build
conan install .. --build=missing
dir
- name: CMake
if: ${{matrix.cfg.runner != 'localhost-win10' }}
run: |
#cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo
#cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_INSTALLATION_ROOT }}\scripts\buildsystems\vcpkg.cmake" -DOpenCV_DIR="${{ env.VCPKG_INSTALLATION_ROOT }}\packages\opencv4_x64-windows\share\opencv4" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/5.15.2/msvc2019_64/lib/cmake
cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_SPARKLE=TRUE -DENABLE_SENTRY=${{secrets.SENTRY_DSN}} -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_INSTALLATION_ROOT }}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/5.15.2/msvc2019_64/lib/cmake
- name: CMake
if: ${{matrix.cfg.runner == 'localhost-win10' }}
shell: cmd
run: |
cmake -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_SPARKLE=TRUE -DENABLE_SENTRY=${{secrets.SENTRY_DSN}} -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_INSTALLATION_ROOT }}\scripts\buildsystems\vcpkg.cmake" -DCMAKE_PREFIX_PATH=C:/Dev/Qt/5.15.2/msvc2019_64/lib/cmake
- name: Build
shell: cmd
run: |
dir
cmake --build ./build --config RelWithDebInfo --parallel
cd build
dir
dir bin
- name: Deploy
if: ${{matrix.cfg.runner != 'localhost-win10' }}
run: |
${{ github.workspace }}/Qt/5.15.2/msvc2019_64/bin/windeployqt.exe --qmldir src/windows/qml --compiler-runtime build/bin/Swiftray.exe
cd build
ls bin
- name: Deploy
if: ${{matrix.cfg.runner == 'localhost-win10' }}
shell: cmd
run: |
C:/Dev/Qt/5.15.2/msvc2019_64/bin/windeployqt.exe --qmldir src/windows/qml --compiler-runtime build/bin/Swiftray.exe
cd build
dir bin
- name: Setup Sentry CLI
if: ${{ matrix.cfg.dist }}
uses: mathieu-bour/[email protected]
with:
version: latest # optional if 'latest'
token: ${{ SECRETS.SENTRY_TOKEN }} # from GitHub secrets
organization: flux3dp
project: swiftray
- name: Upload debug symbol to sentry
if: ${{ matrix.cfg.dist }}
shell: cmd
run: |
cd build
cd bin
sentry-cli upload-dif -o flux3dp -p swiftray Swiftray.pdb
#- name: Sign the executable
# run: |
#
#- name: Create installer
# run: |
#
#- name: Sign the installer
# run: |
#
- uses: actions/upload-artifact@v3
if: ${{ matrix.cfg.dist }}
with:
name: msvc-build-exec
path: |
build/bin/