Skip to content

Commit f5e6bdd

Browse files
authored
Merge branch 'hyperion-project:master' into hyperion-project#1740
2 parents d58a46f + 33b5c6f commit f5e6bdd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1553
-1334
lines changed

.github/scripts/build.sh

-57
This file was deleted.

.github/workflows/qt5_6.yml

+73-73
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ on:
2525
default: false
2626
required: false
2727

28-
env:
29-
ghcr: hyperion-project
30-
3128
jobs:
3229

3330
######################
@@ -36,7 +33,7 @@ jobs:
3633

3734
Linux:
3835
name: 🐧 ${{ matrix.os.description }}
39-
runs-on: ubuntu-latest
36+
runs-on: ${{ matrix.os.architecture[0] == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
4037
strategy:
4138
fail-fast: false
4239
matrix:
@@ -49,6 +46,7 @@ jobs:
4946
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 2), architecture: [ armv7, linux/arm/v7 ], platform: rpi },
5047
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 3/4/5 & Zero 2), architecture: [ arm64, linux/arm64 ], platform: rpi }
5148
]
49+
target_lookup: [{ 'arm64': 'arm64', 'armv6': 'armv6l', 'armv7': 'armv7l' }]
5250
isQt5:
5351
- ${{ inputs.qt_version == '5' }}
5452
exclude:
@@ -63,24 +61,29 @@ jobs:
6361
with:
6462
submodules: recursive
6563

66-
- name: 🔧 Prepare
64+
- name: 🔧 Append PR number to version (PR only)
65+
if: ${{ inputs.event_name == 'pull_request' }}
6766
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
7568

7669
- name: 👷 Build
7770
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"
7981
env:
8082
DOCKER_IMAGE: ${{ matrix.os.distribution }}
8183
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])]) || '' }}
8487

8588
- name: 📦 Upload
8689
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -96,40 +99,44 @@ jobs:
9699
######################
97100

98101
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+
101109
steps:
102110
- name: ⬇ Checkout
103111
uses: actions/checkout@v4
104112
with:
105113
submodules: recursive
106114

107-
- name: 🔧 Prepare
115+
- name: 🔧 Append Pull Request number to version (PR only)
116+
if: ${{ inputs.event_name == 'pull_request' }}
108117
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
116119

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
125122
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 }}
127125

128126
- name: 👷 Build
129127
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
131138
env:
132-
PLATFORM: osx
139+
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
133140

134141
- name: 📦 Upload
135142
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -138,7 +145,7 @@ jobs:
138145
name: ${{ inputs.event_name == 'pull_request' && env.NAME || format('artifact-{0}', env.NAME) }}
139146
path: 'build/Hyperion-*'
140147
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) }}
142149

143150
######################
144151
###### Windows #######
@@ -148,41 +155,40 @@ jobs:
148155
name: 🪟 Windows x64
149156
runs-on: windows-2022
150157
env:
151-
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
158+
LIBJPEG_TURBO_VERSION: 3.0.1
152159
steps:
153160
- name: ⬇ Checkout
154161
uses: actions/checkout@v4
155162
with:
156163
submodules: recursive
157164

158-
- name: 🔧 Prepare PR
165+
- name: 🔧 Append Pull Request number to version (PR only)
159166
if: ${{ inputs.event_name == 'pull_request' }}
160167
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
166169

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
169172
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
172176

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
175185
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
182188
183-
- name: Install Vulkan SDK
189+
- name: 📥 Install Vulkan SDK
184190
if: ${{ inputs.qt_version == '6' }}
185-
uses: jakoch/install-vulkan-sdk-action@v1.0.6
191+
uses: jakoch/install-vulkan-sdk-action@v1
186192
with:
187193
install_runtime: false
188194
cache: true
@@ -198,19 +204,15 @@ jobs:
198204
cache-key-prefix: 'cache-qt-windows'
199205

200206
- 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
208208

209209
- 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%
212214
env:
213-
PLATFORM: windows
215+
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
214216

215217
- name: 📦 Upload
216218
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -236,13 +238,11 @@ jobs:
236238

237239
- name: 🔧 Prepare
238240
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
243243
244244
- name: 💾 Artifact download
245-
uses: actions/download-artifact@v4.1.8
245+
uses: actions/download-artifact@v4
246246
with:
247247
pattern: artifact-*
248248
path: all-artifacts

0 commit comments

Comments
 (0)