-
Notifications
You must be signed in to change notification settings - Fork 244
285 lines (241 loc) · 9.39 KB
/
validate.yml
File metadata and controls
285 lines (241 loc) · 9.39 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: validate
on:
workflow_call:
secrets:
ASSET_REPO:
required: true
ASSET_REPO_TOKEN:
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-24.04
strategy:
matrix:
preset: ["linux-debug", "linux-release", "linux-relwithdebinfo"]
env:
LLVM_VERSION: 18
CMAKE_PRESET: ${{ matrix.preset }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Private Repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.ASSET_REPO }}
token: ${{ secrets.ASSET_REPO_TOKEN }}
path: ./private
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ runner.os }}-${{ matrix.preset }}
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
./thirdparty/vcpkg/downloads
./thirdparty/vcpkg/packages
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-
- name: Install Dependencies (Linux)
run: |-
sudo apt update
sudo apt install -y ninja-build llvm-${{ env.LLVM_VERSION }}-dev libgtk-3-dev libasound2-dev libpulse-dev libpipewire-0.3-dev
- name: Cache ccache Directory
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ccache-${{ runner.os }}-${{ matrix.preset }}
- name: Prepare Project
run: cp ./private/* ./UnleashedRecompLib/private
- name: Configure Project
env:
CCACHE_DIR: /tmp/ccache
run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
- name: Build Project
env:
CCACHE_DIR: /tmp/ccache
run: cmake --build ./out/build/${{ env.CMAKE_PRESET }} --target UnleashedRecomp
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: UnleashedRecomp-Linux-${{ env.CMAKE_PRESET }}
path: ./out/build/${{ env.CMAKE_PRESET }}/UnleashedRecomp/UnleashedRecomp
build-windows:
name: Build Windows
runs-on: windows-latest
strategy:
matrix:
preset: ["x64-Clang-Debug", "x64-Clang-Release", "x64-Clang-RelWithDebInfo"]
env:
CMAKE_PRESET: ${{ matrix.preset }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout private repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.ASSET_REPO }}
token: ${{ secrets.ASSET_REPO_TOKEN }}
path: .\private
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ runner.os }}-${{ matrix.preset }}
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
./thirdparty/vcpkg/downloads
./thirdparty/vcpkg/packages
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-
- name: Install dependencies
run: |
choco install ninja
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
- name: Configure Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Prepare Project
run: |
$commitMessage = git log -1 --pretty=%s
Add-Content -Path $env:GITHUB_ENV -Value "commit_message=$commitMessage"
copy .\private\* .\UnleashedRecompLib\private
- name: Configure Project
run: cmake . --preset ${{ env.CMAKE_PRESET }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
- name: Build Project
run: cmake --build .\out\build\${{ env.CMAKE_PRESET }} --target UnleashedRecomp
- name: Pack Release
run: |
New-Item -ItemType Directory -Path .\release
New-Item -ItemType Directory -Path .\release\D3D12
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\D3D12\D3D12Core.dll" -Destination ".\release\D3D12\D3D12Core.dll"
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxcompiler.dll" -Destination ".\release\dxcompiler.dll"
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\dxil.dll" -Destination ".\release\dxil.dll"
Move-Item -Path ".\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.exe" -Destination ".\release\UnleashedRecomp.exe"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: UnleashedRecomp-Windows-${{ env.CMAKE_PRESET }}
path: .\release
- name: Upload PDB
uses: actions/upload-artifact@v4
if: ${{ matrix.preset != 'x64-Clang-Release' }}
with:
name: UnleashedRecomp-Windows-${{ env.CMAKE_PRESET }}-PDB
path: .\out\build\${{ env.CMAKE_PRESET }}\UnleashedRecomp\UnleashedRecomp.pdb
build-flatpak:
name: Build Flatpak
runs-on: ubuntu-24.04
env:
FLATPAK_ID: io.github.hedge_dev.unleashedrecomp
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Private Repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.ASSET_REPO }}
token: ${{ secrets.ASSET_REPO_TOKEN }}
path: ./private
- name: Install Dependencies
run: |-
sudo apt update
sudo apt install -y flatpak-builder ccache
- name: Setup ccache
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ccache-${{ runner.os }}
- name: Prepare Project
run: cp ./private/* ./UnleashedRecompLib/private
- name: Prepare Flatpak
run: |
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Build Flatpak
run: |
echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
export CCACHE_DIR=/tmp/ccache
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo --ccache builddir ./flatpak/${{ env.FLATPAK_ID }}.json
flatpak build-bundle repo ./${{ env.FLATPAK_ID }}.flatpak ${{ env.FLATPAK_ID }} --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: UnleashedRecomp-Flatpak
path: ./${{ env.FLATPAK_ID }}.flatpak
build-macos:
name: Build macOS
runs-on: macos-15
strategy:
matrix:
arch: [ "arm64" ]
preset: ["macos-debug", "macos-release", "macos-relwithdebinfo"]
env:
CMAKE_PRESET: ${{ matrix.preset }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Private Repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.ASSET_REPO }}
token: ${{ secrets.ASSET_REPO_TOKEN }}
path: ./private
- name: Setup latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.preset }}
- name: Cache vcpkg
uses: actions/cache@v4
with:
path: |
./thirdparty/vcpkg/downloads
./thirdparty/vcpkg/packages
key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-${{ matrix.arch }}-
- name: Install Dependencies (macOS)
run: |
brew install ninja
- name: Cache ccache Directory
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ccache-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.preset }}
- name: Prepare Project
run: |
cp ./private/* ./UnleashedRecompLib/private
- name: Configure Project
env:
CCACHE_DIR: /tmp/ccache
run: cmake . --preset ${{ env.CMAKE_PRESET }} -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DSDL2MIXER_VORBIS=VORBISFILE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
- name: Build Project
env:
CCACHE_DIR: /tmp/ccache
run: cmake --build ./out/build/${{ env.CMAKE_PRESET }} --target UnleashedRecomp
- name: Pack Release
run: |
codesign --deep -fs - "./out/build/${{ env.CMAKE_PRESET }}/UnleashedRecomp/Unleashed Recompiled.app"
tar -czf UnleashedRecomp-macOS-${{ matrix.arch }}-${{ env.CMAKE_PRESET }}.tar.gz -C ./out/build/${{ env.CMAKE_PRESET }}/UnleashedRecomp "Unleashed Recompiled.app"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: UnleashedRecomp-macOS-${{ matrix.arch }}-${{ env.CMAKE_PRESET }}
path: UnleashedRecomp-macOS-${{ matrix.arch }}-${{ env.CMAKE_PRESET }}.tar.gz