3
3
4
4
name : Build and Release
5
5
6
- on :
7
- push :
8
- branches : [ "*" ]
9
- pull_request :
10
- branches : [ "*" ]
6
+ on : [push, pull_request]
11
7
12
8
concurrency :
13
9
group : ci-${{ github.event_name }}-${{ github.ref }}
22
18
continue-on-error : true
23
19
steps :
24
20
- uses : actions/checkout@v4
25
- - uses : fsfe/reuse-action@v4
21
+ - uses : fsfe/reuse-action@v5
26
22
27
23
clang-format :
28
24
runs-on : ubuntu-latest
34
30
- name : Install
35
31
run : |
36
32
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
37
- sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
33
+ sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
38
34
sudo apt update
39
- sudo apt install clang-format-17
35
+ sudo apt install clang-format-18
40
36
- name : Build
41
37
env :
42
38
COMMIT_RANGE : ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
@@ -47,15 +43,18 @@ jobs:
47
43
outputs :
48
44
date : ${{ steps.vars.outputs.date }}
49
45
shorthash : ${{ steps.vars.outputs.shorthash }}
46
+ fullhash : ${{ steps.vars.outputs.fullhash }}
50
47
steps :
51
48
- uses : actions/checkout@v4
52
49
- name : Get date and git hash
53
50
id : vars
54
51
run : |
55
52
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
56
53
echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
54
+ echo "fullhash=$(git rev-parse HEAD)" >> $GITHUB_ENV
57
55
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
58
56
echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
57
+ echo "fullhash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
59
58
60
59
windows-sdl :
61
60
runs-on : windows-latest
@@ -90,10 +89,10 @@ jobs:
90
89
arch : amd64
91
90
92
91
- name : Configure CMake
93
- run : cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
92
+ run : cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
94
93
95
94
- name : Build
96
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
95
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $env:NUMBER_OF_PROCESSORS
97
96
98
97
- name : Upload Windows SDL artifact
99
98
uses : actions/upload-artifact@v4
@@ -144,10 +143,10 @@ jobs:
144
143
arch : amd64
145
144
146
145
- name : Configure CMake
147
- run : cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
146
+ run : cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
148
147
149
148
- name : Build
150
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
149
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $env:NUMBER_OF_PROCESSORS
151
150
152
151
- name : Deploy and Package
153
152
run : |
@@ -163,7 +162,7 @@ jobs:
163
162
path : upload/
164
163
165
164
macos-sdl :
166
- runs-on : macos-latest
165
+ runs-on : macos-15
167
166
needs : get-info
168
167
steps :
169
168
- uses : actions/checkout@v4
@@ -175,11 +174,6 @@ jobs:
175
174
with :
176
175
xcode-version : latest
177
176
178
- - name : Install MoltenVK
179
- run : |
180
- arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
181
- arch -x86_64 /usr/local/bin/brew install molten-vk
182
-
183
177
- name : Cache CMake Configuration
184
178
uses : actions/cache@v4
185
179
env :
@@ -202,7 +196,7 @@ jobs:
202
196
variant : sccache
203
197
204
198
- name : Configure CMake
205
- run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
199
+ run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
206
200
207
201
- name : Build
208
202
run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
@@ -211,15 +205,15 @@ jobs:
211
205
run : |
212
206
mkdir upload
213
207
mv ${{github.workspace}}/build/shadps4 upload
214
- cp $(arch -x86_64 /usr/local/bin/brew --prefix)/opt/molten-vk/lib /libMoltenVK.dylib upload
208
+ cp ${{github.workspace}}/build/externals/MoltenVK /libMoltenVK.dylib upload
215
209
tar cf shadps4-macos-sdl.tar.gz -C upload .
216
210
- uses : actions/upload-artifact@v4
217
211
with :
218
212
name : shadps4-macos-sdl-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
219
213
path : shadps4-macos-sdl.tar.gz
220
214
221
215
macos-qt :
222
- runs-on : macos-latest
216
+ runs-on : macos-15
223
217
needs : get-info
224
218
steps :
225
219
- uses : actions/checkout@v4
@@ -231,11 +225,8 @@ jobs:
231
225
with :
232
226
xcode-version : latest
233
227
234
- - name : Install MoltenVK and Setup Qt
235
- run : |
236
- arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
237
- arch -x86_64 /usr/local/bin/brew install molten-vk
238
- - uses : jurplel/install-qt-action@v4
228
+ - name : Setup Qt
229
+ uses : jurplel/install-qt-action@v4
239
230
with :
240
231
version : 6.7.3
241
232
host : mac
@@ -266,7 +257,7 @@ jobs:
266
257
variant : sccache
267
258
268
259
- name : Configure CMake
269
- run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
260
+ run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
270
261
271
262
- name : Build
272
263
run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
@@ -291,7 +282,7 @@ jobs:
291
282
submodules : recursive
292
283
293
284
- name : Install dependencies
294
- run : sudo apt-get update && sudo apt install -y libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential libasound2-dev libpulse-dev libopenal-dev
285
+ run : sudo apt-get update && sudo apt install -y libx11-dev libxext-dev libwayland-dev libdecor-0-dev libxkbcommon-dev libglfw3-dev libgles2-mesa-dev libfuse2 clang build-essential libasound2-dev libpulse-dev libopenal-dev libudev -dev
295
286
296
287
- name : Cache CMake Configuration
297
288
uses : actions/cache@v4
@@ -313,10 +304,10 @@ jobs:
313
304
key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
314
305
315
306
- name : Configure CMake
316
- run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
307
+ run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
317
308
318
309
- name : Build
319
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
310
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
320
311
321
312
- name : Package and Upload Linux(ubuntu64) SDL artifact
322
313
run : |
@@ -347,7 +338,7 @@ jobs:
347
338
submodules : recursive
348
339
349
340
- name : Install dependencies
350
- run : sudo apt-get update && sudo apt install -y libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential qt6-base-dev qt6-tools-dev qt6-multimedia-dev libasound2-dev libpulse-dev libopenal-dev
341
+ run : sudo apt-get update && sudo apt install -y libx11-dev libxext-dev libwayland-dev libdecor-0-dev libxkbcommon-dev libglfw3-dev libgles2-mesa-dev libfuse2 clang build-essential qt6-base-dev qt6-tools-dev qt6-multimedia-dev libasound2-dev libpulse-dev libopenal-dev libudev -dev
351
342
352
343
- name : Cache CMake Configuration
353
344
uses : actions/cache@v4
@@ -369,10 +360,10 @@ jobs:
369
360
key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
370
361
371
362
- name : Configure CMake
372
- run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
363
+ run : cmake --fresh -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON - DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON -DENABLE_UPDATER =ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
373
364
374
365
- name : Build
375
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
366
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
376
367
377
368
- name : Run AppImage packaging script
378
369
run : ./.github/linux-appimage-qt.sh
@@ -386,7 +377,7 @@ jobs:
386
377
path : Shadps4-qt.AppImage
387
378
388
379
pre-release :
389
- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
380
+ if : github.ref == 'refs/heads/main' && github.repository == 'shadps4-emu/shadPS4' && github. event_name == 'push'
390
381
needs : [get-info, windows-sdl, windows-qt, macos-sdl, macos-qt, linux-sdl, linux-qt]
391
382
runs-on : ubuntu-latest
392
383
steps :
@@ -424,9 +415,62 @@ jobs:
424
415
tag : " Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}"
425
416
draft : false
426
417
prerelease : true
427
- body : " Full Changelog: [${{ env.last_release_tag }}...${{ needs.get-info.outputs.shorthash }}](https://github.com/shadps4-emu/shadPS4/compare/${{ env.last_release_tag }}...${{ needs.get-info.outputs.shorthash }})"
418
+ body : " Full Changelog: [${{ env.last_release_tag }}...${{ needs.get-info.outputs.shorthash }}](https://github.com/shadps4-emu/shadPS4/compare/${{ env.last_release_tag }}...${{ needs.get-info.outputs.fullhash }})"
428
419
artifacts : ./artifacts/*.zip
429
-
420
+
421
+ - name : Publish to Release Repository
422
+ env :
423
+ GITHUB_TOKEN : ${{ secrets.SHADPS4_TOKEN_REPO }}
424
+ run : |
425
+ ARTIFACTS_DIR=./artifacts
426
+ REPO_WINDOWS="shadps4-emu/shadps4-binaries-Windows"
427
+ REPO_LINUX="shadps4-emu/shadps4-binaries-Linux"
428
+ REPO_MAC="shadps4-emu/shadps4-binaries-Mac"
429
+
430
+ for file in "$ARTIFACTS_DIR"/*.zip; do
431
+ filename=$(basename "$file")
432
+ REPO=""
433
+
434
+ # Determine repository based on file name
435
+ if [[ "$filename" == *"win64"* ]]; then
436
+ REPO=$REPO_WINDOWS
437
+ elif [[ "$filename" == *"linux"* ]] || [[ "$filename" == *"ubuntu64"* ]]; then
438
+ REPO=$REPO_LINUX
439
+ elif [[ "$filename" == *"macos"* ]]; then
440
+ REPO=$REPO_MAC
441
+ fi
442
+
443
+ # If REPO is empty, skip file
444
+ if [[ -z "$REPO" ]]; then
445
+ echo "No matching repository for $filename"
446
+ continue
447
+ fi
448
+
449
+ # Check if release already exists and get ID
450
+ release_id=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
451
+ "https://api.github.com/repos/$REPO/releases/tags/Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}" | jq -r '.id')
452
+
453
+ if [[ "$release_id" == "null" ]]; then
454
+ echo "Creating release in $REPO for $filename"
455
+ release_id=$(curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \
456
+ -H "Accept: application/vnd.github.v3+json" \
457
+ -d '{
458
+ "tag_name": "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}",
459
+ "name": "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}",
460
+ "draft": false,
461
+ "prerelease": true,
462
+ "body": "Commit: [${{ needs.get-info.outputs.fullhash }}](https://github.com/shadps4-emu/shadPS4/commit/${{ needs.get-info.outputs.fullhash }})"
463
+ }' "https://api.github.com/repos/$REPO/releases" | jq -r '.id')
464
+ else
465
+ echo "Release already exists in $REPO with ID $release_id"
466
+ fi
467
+
468
+ # Artifact upload
469
+ echo "Uploading $filename to release $release_id in $REPO"
470
+ upload_url="https://uploads.github.com/repos/$REPO/releases/$release_id/assets?name=$filename"
471
+ curl -X POST -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: application/octet-stream" --data-binary @"$file" "$upload_url"
472
+ done
473
+
430
474
- name : Get current pre-release information
431
475
env :
432
476
GITHUB_TOKEN : ${{ secrets.SHADPS4_TOKEN_REPO }}
0 commit comments