@@ -66,24 +66,35 @@ jobs:
66
66
shell : bash
67
67
run : tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
68
68
69
- - name : 👷 Build
69
+ - name : 💾 Download Pre-Build Dependencies
70
+ id : dependencies
71
+ uses : ./.github/actions/download-pre-built-deps
72
+ with :
73
+ os : ${{ matrix.os.distribution }}_${{ matrix.os.codename }}
74
+ architecture : ${{ matrix.os.architecture[0] }}
75
+ qt_version : ${{ inputs.qt_version }}
76
+ build_type : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
77
+
78
+ - name : 👷 Build ${{ env.HINT }}
70
79
shell : bash
71
80
run : |
72
81
mkdir deploy
73
82
docker run --rm --platform=${{ matrix.os.architecture[1] }} ${{ env.ENTRYPOINT }} \
74
83
-v "${{ github.workspace }}/deploy:/deploy" \
75
84
-v "${{ github.workspace }}:/source:rw" \
85
+ -v "/tmp/deps:/tmp/deps:rw" \
76
86
-w "/source" \
77
87
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) &&
88
+ /bin/bash -c "cmake --preset linux-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }} -DPLATFORM=${{ matrix.os.platform }} ${{ env.CPACK_SYSTEM_PROCESSOR }} &&
89
+ cmake --build --preset linux-${{ env.BUILD_TYPE }} --target package &&
80
90
cp /source/build/Hyperion-* /deploy/ 2>/dev/null"
81
91
env :
82
92
DOCKER_IMAGE : ${{ matrix.os.distribution }}
83
93
DOCKER_TAG : ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
84
94
BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
85
95
ENTRYPOINT : ${{ matrix.os.architecture[0] != 'amd64' && '--entrypoint /usr/bin/env' || '' }}
86
96
CPACK_SYSTEM_PROCESSOR : ${{ matrix.os.architecture[0] != 'amd64' && format('-DCPACK_SYSTEM_PROCESSOR={0}', matrix.target_lookup[format('{0}', matrix.os.architecture[0])]) || '' }}
97
+ HINT : ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
87
98
88
99
- name : 📦 Upload
89
100
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -120,34 +131,34 @@ jobs:
120
131
- name : 📥 Install dependencies
121
132
uses : tecolicom/actions-use-homebrew-tools@v1
122
133
with :
123
- tools : qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi
134
+ tools : qt@${{ inputs.qt_version }} vulkan-headers coreutils
124
135
key : ${{ runner.os }}-${{ matrix.architecture }}-homebrew-packages-${{ inputs.qt_version }}
125
136
126
- - name : 👷 Build
137
+ - name : 💾 Download Pre-Build Dependencies
138
+ id : dependencies
139
+ uses : ./.github/actions/download-pre-built-deps
140
+ with :
141
+ os : ' macos'
142
+ architecture : ${{ matrix.architecture }}
143
+ qt_version : ${{ inputs.qt_version }}
144
+ build_type : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
145
+
146
+ - name : 👷 Build ${{ env.HINT }}
127
147
shell : bash
128
148
run : |
129
149
# Remove once issue with Homebrew cache action is fixed
130
150
brew reinstall --formula cmake
131
151
132
152
# Build
133
- cmake --preset macos-${{ env.BUILD_TYPE }}
134
- cmake --build --preset macos-${{ env.BUILD_TYPE }} --parallel $(sysctl -n hw.ncpu)
135
-
153
+ cmake --preset macos-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }}
154
+ cmake --build --preset macos-${{ env.BUILD_TYPE }}
136
155
# CPack workaround for macOS 13
137
- attempt=0
138
- max_attempts=5
139
- while [ $attempt -lt $max_attempts ]; do
140
- if cd build && cpack; then
141
- echo "Package created successfully"
142
- break
143
- else
144
- echo "Failed to create package, retrying..."
145
- sleep 10
146
- fi
147
- attempt=$((attempt + 1))
148
- done
156
+ echo killing...; sudo pkill -9 XProtect >/dev/null || true;
157
+ echo waiting...; while pgrep XProtect; do sleep 3; done;
158
+ cd build; cpack
149
159
env :
150
160
BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
161
+ HINT : ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
151
162
152
163
- name : 📦 Upload
153
164
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -192,10 +203,12 @@ jobs:
192
203
destination : .\installer\libjpeg-turbo.exe
193
204
cache-key : libjpeg-turbo
194
205
195
- - name : 📥 Install DirectX SDK & libjpeg-turbo
206
+ - name : 📥 Extract DirectX SDK & libjpeg-turbo
196
207
run : |
197
- cmd.exe /c start /wait .\installer\libjpeg-turbo.exe /S
198
- cmd.exe /c start /wait .\installer\dxsdk-jun10.exe /U /F
208
+ 7z x -aoa .\installer\dxsdk-jun10.exe DXSDK/Include DXSDK/Lib -oC:\
209
+ echo "DXSDK_DIR=C:\DXSDK" | Out-File -FilePath $env:GITHUB_ENV -Append
210
+ 7z x -aoa .\installer\libjpeg-turbo.exe bin include lib -oC:\turbojpeg
211
+ echo "TURBOJPEG_DIR=C:\turbojpeg" | Out-File -FilePath $env:GITHUB_ENV -Append
199
212
200
213
- name : 📥 Install Vulkan SDK
201
214
if : ${{ inputs.qt_version == '6' }}
@@ -217,13 +230,23 @@ jobs:
217
230
- name : 🛠️ Setup MSVC
218
231
uses : ilammy/msvc-dev-cmd@v1
219
232
220
- - name : 👷 Build
233
+ - name : 💾 Download Pre-Build Dependencies
234
+ id : dependencies
235
+ uses : ./.github/actions/download-pre-built-deps
236
+ with :
237
+ os : ' windows'
238
+ architecture : ' x64'
239
+ qt_version : ${{ inputs.qt_version }}
240
+ build_type : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
241
+
242
+ - name : 👷 Build ${{ env.HINT }}
221
243
shell : cmd
222
244
run : |
223
- cmake --preset windows-${{ env.BUILD_TYPE }}
224
- cmake --build --preset windows-${{ env.BUILD_TYPE }} --target package --parallel %NUMBER_OF_PROCESSORS%
245
+ cmake --preset windows-${{ env.BUILD_TYPE }} ${{ steps.dependencies.outputs.cmakeArgs }}
246
+ cmake --build --preset windows-${{ env.BUILD_TYPE }} --target package
225
247
env :
226
248
BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
249
+ HINT : ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
227
250
228
251
- name : 📦 Upload
229
252
if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
0 commit comments