forked from secup/ProjectUltra
-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (178 loc) · 6.1 KB
/
build-matrix.yml
File metadata and controls
212 lines (178 loc) · 6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Build Matrix
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- "v*"
- "0.2.0-alpha*"
permissions:
contents: write
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux
- os: macos-latest
target: macos
- os: windows-latest
target: windows
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux GUI Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libgl1-mesa-dev
- name: Install macOS GUI Dependencies
if: runner.os == 'macOS'
run: brew install sdl2
- name: Install Windows GUI Dependencies
if: runner.os == 'Windows'
shell: pwsh
run: |
vcpkg install sdl2:x64-windows
"VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure CMake (Linux/macOS)
if: runner.os != 'Windows'
run: >
cmake -S . -B build
-DCMAKE_BUILD_TYPE=Release
-DULTRA_BUILD_TESTS=OFF
-DULTRA_BUILD_GUI=ON
-DULTRA_USE_FFTW=OFF
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: >
cmake -S . -B build -A x64
-DCMAKE_BUILD_TYPE=Release
-DULTRA_BUILD_TESTS=OFF
-DULTRA_BUILD_GUI=ON
-DULTRA_USE_FFTW=OFF
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
-DVCPKG_TARGET_TRIPLET=x64-windows
- name: Build (Linux/macOS)
if: runner.os != 'Windows'
run: cmake --build build --parallel
- name: Build (Windows)
if: runner.os == 'Windows'
run: cmake --build build --config Release --parallel
- name: Collect Bundle Files
shell: bash
run: |
set -euo pipefail
pkg_root="package/projectultra-${{ matrix.target }}"
mkdir -p "$pkg_root"
bins=(ultra ultra_gui cli_simulator threaded_simulator profile_acquisition test_waveform_simple)
found_binary=0
for b in "${bins[@]}"; do
for p in "build/${b}" "build/Release/${b}" "build/${b}.exe" "build/Release/${b}.exe"; do
if [[ -f "$p" ]]; then
cp "$p" "$pkg_root/"
found_binary=1
fi
done
done
if [[ "$found_binary" -eq 0 ]]; then
echo "No binaries found to package."
exit 1
fi
if [[ "${{ matrix.target }}" == "windows" ]]; then
# Include MSVC debug symbols when available so crash dumps can be symbolized.
for b in "${bins[@]}"; do
for p in "build/${b}.pdb" "build/Release/${b}.pdb"; do
if [[ -f "$p" ]]; then
cp "$p" "$pkg_root/"
fi
done
done
sdl_found=0
declare -a dll_candidates=()
if [[ -n "${VCPKG_ROOT:-}" ]]; then
vcpkg_unix="$VCPKG_ROOT"
if command -v cygpath >/dev/null 2>&1; then
vcpkg_unix="$(cygpath -u "$VCPKG_ROOT")"
fi
dll_candidates+=("${vcpkg_unix}/installed/x64-windows/bin/SDL2.dll")
dll_candidates+=("${vcpkg_unix}/installed/x64-windows/bin/SDL2d.dll")
fi
dll_candidates+=("/c/vcpkg/installed/x64-windows/bin/SDL2.dll")
dll_candidates+=("/c/vcpkg/installed/x64-windows/bin/SDL2d.dll")
for dll in "${dll_candidates[@]}"; do
if [[ -f "$dll" ]]; then
cp "$dll" "$pkg_root/"
sdl_found=1
fi
done
if [[ "$sdl_found" -eq 0 ]]; then
echo "SDL2 runtime DLL was not found. Expected from vcpkg install."
exit 1
fi
fi
cp README.md "$pkg_root/"
cat > "$pkg_root/RUNNING.md" <<'EOF'
ProjectUltra Bundle
Included programs:
- ultra
- ultra_gui
- cli_simulator
- threaded_simulator
- profile_acquisition
- test_waveform_simple
Notes:
- Windows bundle includes SDL2 runtime DLL and .pdb symbols (when available).
- Linux/macOS may still require system SDL2/OpenGL runtime packages.
EOF
ls -la "$pkg_root"
- name: Create ZIP Bundle (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
cd package
zip -r "projectultra-${{ matrix.target }}.zip" "projectultra-${{ matrix.target }}"
- name: Create ZIP Bundle (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive -Path "package/projectultra-windows/*" -DestinationPath "package/projectultra-windows.zip" -Force
- name: Upload Bundle Artifact
uses: actions/upload-artifact@v4
with:
name: projectultra-${{ matrix.target }}
path: package/projectultra-${{ matrix.target }}.zip
if-no-files-found: error
release:
name: Publish Release Assets
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
pattern: projectultra-*
path: release-artifacts
merge-multiple: true
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release-artifacts/*.zip
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}