@@ -66,24 +66,35 @@ jobs:
6666 shell : bash
6767 run : tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
6868
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 }}
7079 shell : bash
7180 run : |
7281 mkdir deploy
7382 docker run --rm --platform=${{ matrix.os.architecture[1] }} ${{ env.ENTRYPOINT }} \
7483 -v "${{ github.workspace }}/deploy:/deploy" \
7584 -v "${{ github.workspace }}:/source:rw" \
85+ -v "/tmp/deps:/tmp/deps:rw" \
7686 -w "/source" \
7787 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 &&
8090 cp /source/build/Hyperion-* /deploy/ 2>/dev/null"
8191 env :
8292 DOCKER_IMAGE : ${{ matrix.os.distribution }}
8393 DOCKER_TAG : ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
8494 BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
8595 ENTRYPOINT : ${{ matrix.os.architecture[0] != 'amd64' && '--entrypoint /usr/bin/env' || '' }}
8696 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)' }}
8798
8899 - name : 📦 Upload
89100 if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -120,34 +131,34 @@ jobs:
120131 - name : 📥 Install dependencies
121132 uses : tecolicom/actions-use-homebrew-tools@v1
122133 with :
123- tools : qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi
134+ tools : qt@${{ inputs.qt_version }} vulkan-headers coreutils
124135 key : ${{ runner.os }}-${{ matrix.architecture }}-homebrew-packages-${{ inputs.qt_version }}
125136
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 }}
127147 shell : bash
128148 run : |
129149 # Remove once issue with Homebrew cache action is fixed
130150 brew reinstall --formula cmake
131151
132152 # 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 }}
136155 # 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
149159 env :
150160 BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
161+ HINT : ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
151162
152163 - name : 📦 Upload
153164 if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -192,10 +203,12 @@ jobs:
192203 destination : .\installer\libjpeg-turbo.exe
193204 cache-key : libjpeg-turbo
194205
195- - name : 📥 Install DirectX SDK & libjpeg-turbo
206+ - name : 📥 Extract DirectX SDK & libjpeg-turbo
196207 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
199212
200213 - name : 📥 Install Vulkan SDK
201214 if : ${{ inputs.qt_version == '6' }}
@@ -217,13 +230,23 @@ jobs:
217230 - name : 🛠️ Setup MSVC
218231 uses : ilammy/msvc-dev-cmd@v1
219232
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 }}
221243 shell : cmd
222244 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
225247 env :
226248 BUILD_TYPE : ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
249+ HINT : ${{ steps.dependencies.outputs.cmakeArgs != '' && '(with pre-built dependencies)' || '(full build)' }}
227250
228251 - name : 📦 Upload
229252 if : ${{ inputs.publish || inputs.event_name == 'pull_request' }}
0 commit comments