-
Notifications
You must be signed in to change notification settings - Fork 7
196 lines (166 loc) · 5.57 KB
/
build.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
name: Build
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: write
id-token: write
pages: write
env:
emsdk_cache_dir: "emsdk-cache"
jobs:
linux-qt6:
name: Linux / Qt 6.5.3
runs-on: ubuntu-22.04
steps:
- name: Clone the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup CMake
uses: ./.github/actions/cmake
with:
use_qt6: ON
modules: qtserialport qtwebsockets qtnetworkauth
additional_cmake_args: -DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/install/usr'
- name: Create AppImage
uses: ./.github/actions/appimage
with:
use_qt6: ON
linux-qt5:
name: Linux / Qt 5.15.2
runs-on: ubuntu-22.04
env:
CXXFLAGS: -Wno-stringop-overflow
steps:
- name: Clone the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup CMake
uses: ./.github/actions/cmake
with:
qt_version: 5.15.2
use_qt6: OFF
modules: ""
additional_cmake_args: -DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/install/usr'
- name: Create AppImage
uses: ./.github/actions/appimage
with:
use_qt6: OFF
windows-qt6:
name: Windows / Qt 6.5.3
runs-on: windows-2022
steps:
- name: Clone the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup CMake
uses: ./.github/actions/cmake
with:
qt_arch: win64_mingw
use_qt6: ON
modules: qtserialport qtwebsockets qtnetworkauth
additional_cmake_args: -DCMAKE_INSTALL_PREFIX='${{ github.workspace }}/install'
- name: Build
run: cmake --build '${{github.workspace}}/build' --parallel "$(nproc)"
- name: Install
run: cmake --install '${{ github.workspace }}/build'
- name: Run windeployqt
run: windeployqt -websockets -serialport '${{ github.workspace }}/install/bin/shvspy.exe'
- name: Copy MinGW runtime libraries
# windeployqt is unable to copy those, because it looks for them next to where g++.exe is. On the GitHub runner,
# they are in a different directory.
run: cp /c/mingw64/bin/{libstdc++-6.dll,libgcc_s_seh-1.dll,libwinpthread-1.dll} '${{ github.workspace }}/install/bin'
shell: bash
- name: Get app version
run: echo "VERSION=$(grep APP_VERSION shvspy/src/appversion.h | cut -d\" -f2)" >> "$GITHUB_ENV"
shell: bash
- name: Create installer
run: iscc "-DBUILD_DIR=${{ github.workspace }}/install" "-DVERSION=${{ env.VERSION }}" shvspy/shvspy.iss
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: shvspy-${{ env.VERSION }}-setup.exe
path: ${{ github.workspace }}/install/_inno/shvspy/shvspy-*-setup.exe
wasm-qt6:
name: WebAssembly / Qt 6.6.3
runs-on: ubuntu-22.04
steps:
- name: Clone the repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup emsdk cache
uses: actions/cache@v4
with:
key: emsdk-cache
path: ${{ env.emsdk_cache_dir }}
- uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.37
actions-cache-folder: ${{ env.emsdk_cache_dir }}
- name: Setup CMake
uses: ./.github/actions/cmake
with:
qt_version: 6.6.3
qt_arch: wasm_singlethread
use_qt6: ON
modules: qtwebsockets
- name: Build
run: cmake --build '${{github.workspace}}/build' --parallel "$(nproc)"
shell: bash
- name: Consolidate WebAssembly artifacts
run: |
mkdir gh-sources
cp '${{github.workspace}}'/build/shvspy/*.{js,wasm,html} gh-sources/
mv gh-sources/shvspy.html gh-sources/index.html
cp '${{github.workspace}}'/distro/shvspy.AppDir/shvspy.svg gh-sources/qtlogo.svg
shell: bash
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'gh-sources/'
deploy-github-pages:
name: Deploy GitHub Pages
if: github.ref == 'refs/heads/master'
needs: [wasm-qt6]
runs-on: ubuntu-22.04
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
create-nightly-release:
name: Create nightly
if: github.ref == 'refs/heads/master'
needs: [linux-qt6, linux-qt5, windows-qt6, wasm-qt6]
runs-on: ubuntu-22.04
steps:
- name: Consolidate artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Rename artifacts
run: |
mv artifact.tar shvspy-wasm-nightly.tar
mv shvspy-*-setup.exe shvspy-nightly-setup.exe
mv shvspy-qt5-*-x86_64.AppImage shvspy-qt5-nightly-x86_64.AppImage
mv shvspy-qt6-*-x86_64.AppImage shvspy-qt6-nightly-x86_64.AppImage
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Nightly
tag_name: nightly
fail_on_unmatched_files: true
body: |
The latest and greatest ShvSpy.
This is a nightly release. If you find any bugs, please report them to the repository's issue tracker.
files: |
shvspy-*