Skip to content

Commit 6637103

Browse files
remove build bash script
1 parent 56fb852 commit 6637103

File tree

2 files changed

+53
-91
lines changed

2 files changed

+53
-91
lines changed

.github/scripts/build.sh

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/qt5_6.yml

Lines changed: 53 additions & 32 deletions
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
######################
@@ -76,14 +73,22 @@ jobs:
7673
7774
- name: 👷 Build
7875
shell: bash
79-
run: ./.github/scripts/build.sh
76+
run: |
77+
mkdir deploy
78+
docker run --rm --platform=${{ matrix.os.architecture[1] }} ${{ env.ENTRYPOINT }} \
79+
-v "${{ github.workspace }}/deploy:/deploy" \
80+
-v "${{ github.workspace }}:/source:rw" \
81+
-w "/source" \
82+
ghcr.io/hyperion-project/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} \
83+
/bin/bash -c "cmake --preset linux-${{ env.BUILD_TYPE }} -DPLATFORM=${{ matrix.os.platform }} ${{ env.CPACK_SYSTEM_PROCESSOR }} &&
84+
cmake --build --preset linux-${{ env.BUILD_TYPE }} --target package --parallel $(nproc) &&
85+
cp /source/build/Hyperion-* /deploy/ 2>/dev/null"
8086
env:
8187
DOCKER_IMAGE: ${{ matrix.os.distribution }}
8288
DOCKER_TAG: ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
83-
PLATFORM: ${{ matrix.os.platform }}
89+
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
8490
ENTRYPOINT: ${{ matrix.os.architecture[0] != 'amd64' && '--entrypoint /usr/bin/env' || '' }}
8591
CPACK_SYSTEM_PROCESSOR: ${{ matrix.os.architecture[0] != 'amd64' && format('-DCPACK_SYSTEM_PROCESSOR={0}', matrix.target_lookup[format('{0}', matrix.os.architecture[0])]) || '' }}
86-
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
8792

8893
- name: 📦 Upload
8994
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -112,6 +117,22 @@ jobs:
112117
with:
113118
submodules: recursive
114119

120+
- name: 🔧 Append Pull Request number to version (PR only)
121+
if: ${{ inputs.event_name == 'pull_request' }}
122+
shell: bash
123+
run: tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
124+
125+
- name: 💾 Restore Homebrew Cache
126+
id: cache-homebrew
127+
uses: actions/cache@v4
128+
with:
129+
path: ~/Library/Caches/Homebrew/downloads
130+
key: ${{ runner.os }}-homebrew-packages-${{ inputs.qt_version }}
131+
132+
- name: 📥 Install dependencies
133+
shell: bash
134+
run: brew update -q && brew install -q qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi || true
135+
115136
- name: 🔧 Prepare
116137
shell: bash
117138
run: |
@@ -123,15 +144,17 @@ jobs:
123144
echo '::endgroup::'
124145
125146
echo '::group::Update/Install dependencies'
126-
brew update && brew upgrade || true
127-
brew install qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi || true
147+
brew update -q && brew install -q qt@${{ inputs.qt_version }} vulkan-headers ninja libftdi || true
128148
echo '::endgroup::'
129149
130150
- name: 👷 Build
131151
shell: bash
132-
run: ./.github/scripts/build.sh
152+
run: |
153+
cmake --preset macos-${{ env.BUILD_TYPE }}
154+
cmake --build --preset macos-${{ env.BUILD_TYPE }} --parallel $(sysctl -n hw.ncpu)
155+
cd build; cpack
133156
env:
134-
PLATFORM: osx
157+
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
135158

136159
- name: 📦 Upload
137160
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
@@ -151,6 +174,7 @@ jobs:
151174
runs-on: windows-2022
152175
env:
153176
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
177+
LIBJPEG_TURBO_VERSION: 3.0.1
154178
steps:
155179
- name: ⬇ Checkout
156180
uses: actions/checkout@v4
@@ -160,27 +184,27 @@ jobs:
160184
- name: 🔧 Prepare PR
161185
if: ${{ inputs.event_name == 'pull_request' }}
162186
shell: bash
163-
run: |
164-
echo '::group::Append PR number to version'
165-
tr -d '\n' < .version > temp && mv temp .version
166-
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
167-
echo '::endgroup::'
187+
run: tr -d '\n' < .version > temp && mv temp .version && echo -n "+PR${{ inputs.pull_request_number }}" >> .version
168188

169-
- name: 💾 Cache/Restore
189+
- name: 💾 Restore DirectX SDK & libjpeg-turbo
190+
id: cache-windows
170191
uses: actions/cache@v4
171192
with:
172-
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
173-
key: ${{ runner.os }}${{ '-chocolatey' }}
193+
path: ./installer
194+
key: ${{ runner.os }}-libjpeg-${{ env.LIBJPEG_TURBO_VERSION }}-dxsdk-jun10
174195

175-
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo
196+
- name: 📥 Download DirectX SDK & libjpeg-turbo
197+
if: steps.cache-windows.outputs.cache-hit != 'true'
176198
shell: powershell
177199
run: |
178-
choco install --no-progress directx-sdk -y
179-
choco install --no-progress ${{env.OPENSSL}} -y
180-
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
181-
.\libjpeg-turbo /S
182-
env:
183-
OPENSSL: ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
200+
mkdir .\installer
201+
Invoke-WebRequest -Uri https://sourceforge.net/projects/libjpeg-turbo/files/${{ env.LIBJPEG_TURBO_VERSION }}/libjpeg-turbo-${{ env.LIBJPEG_TURBO_VERSION }}-vc64.exe -OutFile ".\installer\libjpeg-turbo.exe" -UserAgent "NativeHost"
202+
Invoke-WebRequest -Uri https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe -OutFile ".\installer\dxsdk-jun10.exe" -UserAgent "NativeHost"
203+
204+
- name: 📥 Install DirectX SDK, libjpeg-turbo
205+
run: |
206+
cmd.exe /c start /wait .\installer\libjpeg-turbo.exe /S
207+
cmd.exe /c start /wait .\installer\dxsdk-jun10.exe /U /F
184208
185209
- name: Install Vulkan SDK
186210
if: ${{ inputs.qt_version == '6' }}
@@ -203,16 +227,13 @@ jobs:
203227
shell: cmd
204228
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
205229

206-
- name: Temporarily downgrade CMake to 3.28.3 # Please remove if GitHub has updated Cmake (greater than 3.30.0)
207-
uses: jwlawson/actions-setup-cmake@v2
208-
with:
209-
cmake-version: '3.28.3'
210-
211230
- name: 👷 Build
212231
shell: bash
213-
run: ./.github/scripts/build.sh
232+
run: |
233+
cmake --preset windows-${{ env.BUILD_TYPE }}
234+
cmake --build --preset windows-${{ env.BUILD_TYPE }} --target package -- -nologo -v:m -maxcpucount
214235
env:
215-
PLATFORM: windows
236+
BUILD_TYPE: ${{ inputs.event_name == 'pull_request' && 'debug' || 'release' }}
216237

217238
- name: 📦 Upload
218239
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}

0 commit comments

Comments
 (0)