-
-
Notifications
You must be signed in to change notification settings - Fork 121
320 lines (280 loc) · 9.72 KB
/
push-master.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
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
name: HyperHDR CI Build
on:
push:
env:
USE_CACHE: "1"
RESET_CACHE: "0"
USE_CODEQL: "0"
BUILD_ARCHIVES: ${{ startsWith(github.event.ref, 'refs/tags') && 1 || 0 }}
jobs:
######################
###### Linux #########
######################
Linux:
name: ${{ matrix.dockerName }}
runs-on: ubuntu-22.04
strategy:
matrix:
linuxVersion: [ bullseye ]
dockerImage: [ x86_64, arm-32bit-armv6l, arm-64bit-aarch64 ]
include:
- dockerImage: x86_64
linuxVersion: bullseye
dockerName: Debian Bullseye (x86_64)
platform: linux
- dockerImage: x86_64
linuxVersion: bookworm
dockerName: Debian Bookworm (x86_64)
platform: linux
- dockerImage: x86_64
linuxVersion: jammy
dockerName: Ubuntu 22.04 LTS (x86_64)
platform: linux
- dockerImage: arm-32bit-armv6l
linuxVersion: bullseye
dockerName: Debian Bullseye (ARM 32-bit Raspberry Pi OS)
platform: rpi
- dockerImage: arm-64bit-aarch64
linuxVersion: bullseye
dockerName: Debian Bullseye (ARM 64-bit Raspberry Pi OS)
platform: rpi
- dockerImage: arm-32bit-armv6l
linuxVersion: bookworm
dockerName: Debian Bookworm (ARM 32-bit Raspberry Pi OS)
platform: rpi
- dockerImage: arm-64bit-aarch64
linuxVersion: bookworm
dockerName: Debian Bookworm (ARM 64-bit Raspberry Pi OS)
platform: rpi
- dockerImage: x86_64
linuxVersion: ArchLinux
dockerName: Arch Linux (x86_64)
platform: linux
- dockerImage: x86_64
linuxVersion: Fedora_38
dockerName: Fedora 38 (x86_64)
platform: linux
steps:
# checkout
- uses: actions/checkout@v3
with:
submodules: true
# generate cache id
- name: Prepare ccache timestamp
if: env.USE_CACHE == '1'
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
# download cache
- name: ccache cache files
if: ( env.USE_CACHE == '1' )
uses: actions/cache@v3
with:
path: .ccache
key: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache-
- name: Check testing version
if: matrix.linuxVersion == 'bookworm'
run: |
echo "USE_STANDARD_INSTALLER_NAME=ON" >> $GITHUB_ENV
- name: Build packages
env:
DOCKER_IMAGE: ${{ matrix.dockerImage }}
DOCKER_TAG: ${{ matrix.linuxVersion }}
DOCKER_NAME: ${{ matrix.dockerName }}
PLATFORM: ${{ matrix.platform }}
USE_CCACHE: ${{ env.USE_CACHE }}
RESET_CACHE: ${{ env.RESET_CACHE }}
shell: bash
run: |
./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
path: deploy/Hyper*
# Upload artifacts from commit
- name: Upload artifacts from commit
if: (startsWith(github.event.ref, 'refs/tags') != true) && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: Linux-${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-installer
path: |
deploy/Hyper*.deb
deploy/Hyper*.zst
deploy/Hyper*.rpm
######################
####### macOS ########
######################
macOS:
name: macOS
runs-on: macos-12
env:
QT_VERSION: "5"
steps:
# Checkout
- uses: actions/checkout@v3
with:
submodules: true
# Generate cache id
- name: Prepare ccache timestamp
if: env.USE_CACHE == '1'
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
# Download cache
- name: ccache cache files
if: ( env.USE_CACHE == '1' )
uses: actions/cache@v3
with:
path: .ccache
key: macOS-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: macOS-ccache-
# Install deps
- name: Install deps
shell: bash
run: brew install qt@${{ env.QT_VERSION }} xz ccache
# Set env
- name: Set QT5 env
if: ( env.QT_VERSION == '5' )
shell: bash
run: |
export Qt5_DIR=`brew --prefix qt5`;
echo "Qt5_DIR=$Qt5_DIR" >> $GITHUB_ENV
# Build process
- name: Build packages
env:
PLATFORM: osx
USE_CCACHE: ${{ env.USE_CACHE }}
RESET_CACHE: ${{ env.RESET_CACHE }}
shell: bash
run: ./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
path: build/Hyper*.dmg
# Upload artifacts from commit
- name: Upload artifacts from commit
if: (startsWith(github.event.ref, 'refs/tags') != true) && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: Apple_macOS_x64_DMG_installer
path: build/Hyper*.dmg
######################
###### Windows #######
######################
windows:
name: Windows
runs-on: windows-2022
env:
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
QT_VERSION: 6.2.4
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Cache Qt
uses: actions/cache@v3
id: cache-qt-windows
with:
path: ${{ runner.workspace }}/Qt
key: ${{ runner.os }}-Qt.${{ env.QT_VERSION }}
- name: Install QT
if: steps.cache-qt-windows.outputs.cache-hit != 'true'
run: |
pip install aqtinstall
aqt install-qt -O ${{ runner.workspace }}/Qt windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 -m qtserialport
- name: Set up x64 build architecture environment
shell: cmd
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
# Build packages
- name: Build packages
env:
PLATFORM: windows
CMAKE_PREFIX_PATH: "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/lib/cmake/"
USE_CCACHE: ${{ env.USE_CACHE }}
shell: bash
run: |
./.ci/ci_build.sh
# Upload artifacts (only on tagged commit)
- name: Upload artifacts
if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
path: build/Hyper*
# Upload artifacts from commit
- name: Upload artifacts from commit
if: (startsWith(github.event.ref, 'refs/tags') != true) && github.event_name != 'pull_request'
uses: actions/upload-artifact@v3
with:
name: Windows_x64_setup
path: build/Hyper*.exe
################################
####### CodeQL support #########
################################
analyze:
name: Analyze (CodeQL)
runs-on: ubuntu-latest
if: ( false )
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Run composite CodeQL job for '${{matrix.language}}' language
uses: ./.github/actions/codeql
with:
language: ${{matrix.language}}
################################
###### Publish Releases ########
################################
publish:
name: Publish Releases
if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request'
needs: [Linux, windows, macOS]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
# generate environment variables
- name: Generate environment variables from version and tag
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "VERSION=$(tr -d '\n' < version)" >> $GITHUB_ENV
echo "preRelease=false" >> $GITHUB_ENV
# If version contains alpha or beta, mark draft release as pre-release
- name: Mark release as pre-release
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
run: echo "preRelease=true" >> $GITHUB_ENV
# Download artifacts from previous build process
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
# create draft release and upload artifacts
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
name: HyperHDR ${{ env.VERSION }}
tag_name: ${{ env.TAG }}
files: "artifacts/**"
draft: true
prerelease: ${{ env.preRelease }}