25
25
default : false
26
26
required : false
27
27
28
- env :
29
- ghcr : hyperion-project
30
-
31
28
jobs :
32
29
33
30
# #####################
36
33
37
34
Linux :
38
35
name : 🐧 ${{ matrix.os.description }}
39
- runs-on : ubuntu-latest
36
+ runs-on : ${{ matrix.os.architecture[0] == 'amd64' && ' ubuntu-24.04' || 'ubuntu-24.04-arm' }}
40
37
strategy :
41
38
fail-fast : false
42
39
matrix :
49
46
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 2), architecture: [ armv7, linux/arm/v7 ], platform: rpi },
50
47
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 3/4/5 & Zero 2), architecture: [ arm64, linux/arm64 ], platform: rpi }
51
48
]
49
+ target_lookup : [{ 'arm64': 'arm64', 'armv6': 'armv6l', 'armv7': 'armv7l' }]
52
50
isQt5 :
53
51
- ${{ inputs.qt_version == '5' }}
54
52
exclude :
@@ -63,24 +61,29 @@ jobs:
63
61
with :
64
62
submodules : recursive
65
63
66
- - name : 🔧 Prepare
64
+ - name : 🔧 Append PR number to version (PR only)
65
+ if : ${{ inputs.event_name == 'pull_request' }}
67
66
shell : bash
68
- run : |
69
- echo '::group::Append PR number to version (PR only)'
70
- if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
71
- tr -d '\n' < .version > temp && mv temp .version
72
- echo -n "+PR${{ inputs.pull_request_number }}" >> .version
73
- fi
74
- echo '::endgroup::'
67
+ run : tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
75
68
76
69
- name : 👷 Build
77
70
shell : bash
78
- run : ./.github/scripts/build.sh
71
+ run : |
72
+ mkdir deploy
73
+ docker run --rm --platform=${{ matrix.os.architecture[1] }} ${{ env.ENTRYPOINT }} \
74
+ -v "${{ github.workspace }}/deploy:/deploy" \
75
+ -v "${{ github.workspace }}:/source:rw" \
76
+ -w "/source" \
77
+ ghcr.io/hyperion-project/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} \
78
+ /bin/bash -c "cmake --preset linux-${{ env.BUILD_TYPE }} -DPLATFORM=${{ matrix.os.platform }} ${{ env.CPACK_SYSTEM_PROCESSOR }} &&
79
+ cmake --build --preset linux-${{ env.BUILD_TYPE }} --target package --parallel $(nproc) &&
80
+ cp /source/build/Hyperion-* /deploy/ 2>/dev/null"
79
81
env :
80
82
DOCKER_IMAGE : ${{ matrix.os.distribution }}
81
83
DOCKER_TAG : ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
82
- PLATFORM : ${{ matrix.os.platform }}
83
- TARGET_ARCH : ${{ matrix.os.architecture[1] }}
84
+ BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
85
+ ENTRYPOINT : ${{ matrix.os.architecture[0] != 'amd64' && '--entrypoint /usr/bin/env' || '' }}
86
+ CPACK_SYSTEM_PROCESSOR : ${{ matrix.os.architecture[0] != 'amd64' && format('-DCPACK_SYSTEM_PROCESSOR={0}', matrix.target_lookup[format('{0}', matrix.os.architecture[0])]) || '' }}
84
87
85
88
- name : 📦 Upload
86
89
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -96,40 +99,44 @@ jobs:
96
99
# #####################
97
100
98
101
macOS :
99
- name : 🍏 macOS x64
100
- runs-on : macos-latest
102
+ name : 🍏 macOS ${{ matrix.architecture }}
103
+ runs-on : ${{ matrix.architecture == 'arm64' && 'macos-14' || 'macos-13' }}
104
+ strategy :
105
+ fail-fast : false
106
+ matrix :
107
+ architecture : [ arm64, x64 ]
108
+
101
109
steps :
102
110
- name : ⬇ Checkout
103
111
uses : actions/checkout@v4
104
112
with :
105
113
submodules : recursive
106
114
107
- - name : 🔧 Prepare
115
+ - name : 🔧 Append Pull Request number to version (PR only)
116
+ if : ${{ inputs.event_name == 'pull_request' }}
108
117
shell : bash
109
- run : |
110
- echo '::group::Append PR number to version (PR only)'
111
- if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
112
- tr -d '\n' < .version > temp && mv temp .version
113
- echo -n "+PR${{ inputs.pull_request_number }}" >> .version
114
- fi
115
- echo '::endgroup::'
118
+ run : tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
116
119
117
- echo '::group::Update/Install dependencies'
118
- brew untap --force homebrew/core homebrew/cask
119
- brew update || true
120
- brew install qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi || true
121
- echo '::endgroup::'
122
-
123
- - name : Temporarily downgrade CMake to 3.28.3 # Please remove if GitHub has updated Cmake (greater than 3.30.0)
124
- uses : jwlawson/actions-setup-cmake@v2
120
+ - name : 📥 Install dependencies
121
+ uses : tecolicom/actions-use-homebrew-tools@v1
125
122
with :
126
- cmake-version : ' 3.28.3'
123
+ tools : qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi
124
+ key : ${{ runner.os }}-${{ matrix.architecture }}-homebrew-packages-${{ inputs.qt_version }}
127
125
128
126
- name : 👷 Build
129
127
shell : bash
130
- run : ./.github/scripts/build.sh
128
+ run : |
129
+ # Remove once issue with hombrew cache action is fixed
130
+ brew reinstall --formula cmake
131
+ # Build
132
+ cmake --preset macos-${{ env.BUILD_TYPE }}
133
+ cmake --build --preset macos-${{ env.BUILD_TYPE }} --parallel $(sysctl -n hw.ncpu)
134
+ # CPack workaround for macOS 13
135
+ echo killing...; sudo pkill -9 XProtect >/dev/null || true;
136
+ echo waiting...; while pgrep XProtect; do sleep 3; done;
137
+ cd build; cpack
131
138
env :
132
- PLATFORM : osx
139
+ BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
133
140
134
141
- name : 📦 Upload
135
142
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -138,7 +145,7 @@ jobs:
138
145
name : ${{ inputs.event_name == 'pull_request' && env.NAME || format('artifact-{0}', env.NAME) }}
139
146
path : ' build/Hyperion-*'
140
147
env :
141
- NAME : ${{ inputs.qt_version == '6' && 'macOS_x64_qt6' || 'macOS_x64' }}
148
+ NAME : ${{ inputs.qt_version == '6' && format('macOS_{0}_qt6', matrix.architecture) || format('macOS_{0}', matrix.architecture) }}
142
149
143
150
# #####################
144
151
# ##### Windows #######
@@ -148,41 +155,40 @@ jobs:
148
155
name : 🪟 Windows x64
149
156
runs-on : windows-2022
150
157
env :
151
- VCINSTALLDIR : ' C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC '
158
+ LIBJPEG_TURBO_VERSION : 3.0.1
152
159
steps :
153
160
- name : ⬇ Checkout
154
161
uses : actions/checkout@v4
155
162
with :
156
163
submodules : recursive
157
164
158
- - name : 🔧 Prepare PR
165
+ - name : 🔧 Append Pull Request number to version (PR only)
159
166
if : ${{ inputs.event_name == 'pull_request' }}
160
167
shell : bash
161
- run : |
162
- echo '::group::Append PR number to version'
163
- tr -d '\n' < .version > temp && mv temp .version
164
- echo -n "+PR${{ inputs.pull_request_number }}" >> .version
165
- echo '::endgroup::'
168
+ run : tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
166
169
167
- - name : 💾 Cache/ Restore
168
- uses : actions/cache@v4
170
+ - name : 💾 Restore DirectX SDK (if available)
171
+ uses : ethanjli/cached-download-action@v0.1.2
169
172
with :
170
- path : C:\Users\runneradmin\AppData\Local\Temp\chocolatey
171
- key : ${{ runner.os }}${{ '-chocolatey' }}
173
+ url : https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
174
+ destination : .\installer\dxsdk-jun10.exe
175
+ cache-key : dxsdk-jun10
172
176
173
- - name : 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo
174
- shell : powershell
177
+ - name : 💾 Restore libjpeg-turbo (if available)
178
+ uses : ethanjli/cached-download-action@v0.1.2
179
+ with :
180
+ url : https://sourceforge.net/projects/libjpeg-turbo/files/${{ env.LIBJPEG_TURBO_VERSION }}/libjpeg-turbo-${{ env.LIBJPEG_TURBO_VERSION }}-vc64.exe
181
+ destination : .\installer\libjpeg-turbo.exe
182
+ cache-key : libjpeg-turbo
183
+
184
+ - name : 📥 Install DirectX SDK & libjpeg-turbo
175
185
run : |
176
- choco install --no-progress directx-sdk -y
177
- choco install --no-progress ${{env.OPENSSL}} -y
178
- Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/3.0.1/libjpeg-turbo-3.0.1-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
179
- .\libjpeg-turbo /S
180
- env :
181
- OPENSSL : ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
186
+ cmd.exe /c start /wait .\installer\libjpeg-turbo.exe /S
187
+ cmd.exe /c start /wait .\installer\dxsdk-jun10.exe /U /F
182
188
183
- - name : Install Vulkan SDK
189
+ - name : 📥 Install Vulkan SDK
184
190
if : ${{ inputs.qt_version == '6' }}
185
- uses : jakoch/install-vulkan-sdk-action@v1.0.6
191
+ uses : jakoch/install-vulkan-sdk-action@v1
186
192
with :
187
193
install_runtime : false
188
194
cache : true
@@ -198,19 +204,15 @@ jobs:
198
204
cache-key-prefix : ' cache-qt-windows'
199
205
200
206
- name : 🛠️ Setup MSVC
201
- shell : cmd
202
- run : call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
203
-
204
- - name : Temporarily downgrade CMake to 3.28.3 # Please remove if GitHub has updated Cmake (greater than 3.30.0)
205
- uses : jwlawson/actions-setup-cmake@v2
206
- with :
207
- cmake-version : ' 3.28.3'
207
+ uses : ilammy/msvc-dev-cmd@v1
208
208
209
209
- name : 👷 Build
210
- shell : bash
211
- run : ./.github/scripts/build.sh
210
+ shell : cmd
211
+ run : |
212
+ cmake --preset windows-${{ env.BUILD_TYPE }}
213
+ cmake --build --preset windows-${{ env.BUILD_TYPE }} --target package --parallel %NUMBER_OF_PROCESSORS%
212
214
env :
213
- PLATFORM : windows
215
+ BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
214
216
215
217
- name : 📦 Upload
216
218
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -236,13 +238,11 @@ jobs:
236
238
237
239
- name : 🔧 Prepare
238
240
run : |
239
- echo '::group::Generate environment variables from .version and tag'
240
- echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
241
- echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
242
- echo '::endgroup::'
241
+ echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
242
+ echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
243
243
244
244
- name : 💾 Artifact download
245
- uses : actions/download-artifact@v4.1.8
245
+ uses : actions/download-artifact@v4
246
246
with :
247
247
pattern : artifact-*
248
248
path : all-artifacts
0 commit comments