@@ -53,231 +53,6 @@ jobs:
53
53
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
54
54
echo "shorthash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
55
55
56
- windows-sdl :
57
- runs-on : windows-latest
58
- needs : get-info
59
- steps :
60
- - uses : actions/checkout@v4
61
- with :
62
- submodules : recursive
63
-
64
- - name : Cache CMake Configuration
65
- uses : actions/cache@v4
66
- env :
67
- cache-name : ${{ runner.os }}-sdl-ninja-cache-cmake-configuration
68
- with :
69
- path : |
70
- ${{github.workspace}}/build
71
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
72
- restore-keys : |
73
- ${{ env.cache-name }}-
74
-
75
- - name : Cache CMake Build
76
- uses :
hendrikmuhs/[email protected]
77
- env :
78
- cache-name : ${{ runner.os }}-sdl-cache-cmake-build
79
- with :
80
- append-timestamp : false
81
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
82
-
83
- - name : Setup VS Environment
84
-
85
- with :
86
- arch : amd64
87
-
88
- - name : Configure CMake
89
- 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
90
-
91
- - name : Build
92
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
93
-
94
- - name : Upload Windows SDL artifact
95
- uses : actions/upload-artifact@v4
96
- with :
97
- name : shadps4-win64-sdl-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
98
- path : ${{github.workspace}}/build/shadPS4.exe
99
-
100
- windows-qt :
101
- runs-on : windows-latest
102
- needs : get-info
103
- steps :
104
- - uses : actions/checkout@v4
105
- with :
106
- submodules : recursive
107
-
108
- - name : Setup Qt
109
- uses : jurplel/install-qt-action@v4
110
- with :
111
- version : 6.7.3
112
- host : windows
113
- target : desktop
114
- arch : win64_msvc2019_64
115
- archives : qtbase qttools
116
- modules : qtmultimedia
117
-
118
- - name : Cache CMake Configuration
119
- uses : actions/cache@v4
120
- env :
121
- cache-name : ${{ runner.os }}-qt-ninja-cache-cmake-configuration
122
- with :
123
- path : |
124
- ${{github.workspace}}/build
125
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
126
- restore-keys : |
127
- ${{ env.cache-name }}-
128
-
129
- - name : Cache CMake Build
130
- uses :
hendrikmuhs/[email protected]
131
- env :
132
- cache-name : ${{ runner.os }}-qt-cache-cmake-build
133
- with :
134
- append-timestamp : false
135
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
136
-
137
- - name : Setup VS Environment
138
-
139
- with :
140
- arch : amd64
141
-
142
- - name : Configure CMake
143
- 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
144
-
145
- - name : Build
146
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
147
-
148
- - name : Deploy and Package
149
- run : |
150
- mkdir upload
151
- move build/shadPS4.exe upload
152
- windeployqt --no-compiler-runtime --no-system-d3d-compiler --no-system-dxc-compiler --dir upload upload/shadPS4.exe
153
- Compress-Archive -Path upload/* -DestinationPath shadps4-win64-qt-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}.zip
154
-
155
- - name : Upload Windows Qt artifact
156
- uses : actions/upload-artifact@v4
157
- with :
158
- name : shadps4-win64-qt-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
159
- path : upload/
160
-
161
- macos-sdl :
162
- runs-on : macos-latest
163
- needs : get-info
164
- steps :
165
- - uses : actions/checkout@v4
166
- with :
167
- submodules : recursive
168
-
169
- - name : Setup latest Xcode
170
- uses : maxim-lobanov/setup-xcode@v1
171
- with :
172
- xcode-version : latest
173
-
174
- - name : Install MoltenVK
175
- run : |
176
- arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
177
- arch -x86_64 /usr/local/bin/brew install molten-vk
178
-
179
- - name : Cache CMake Configuration
180
- uses : actions/cache@v4
181
- env :
182
- cache-name : ${{ runner.os }}-sdl-cache-cmake-configuration
183
- with :
184
- path : |
185
- ${{github.workspace}}/build
186
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
187
- restore-keys : |
188
- ${{ env.cache-name }}-
189
-
190
- - name : Cache CMake Build
191
- uses :
hendrikmuhs/[email protected]
192
- env :
193
- cache-name : ${{runner.os}}-sdl-cache-cmake-build
194
- with :
195
- append-timestamp : false
196
- create-symlink : true
197
- key : ${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
198
- variant : sccache
199
-
200
- - name : Configure CMake
201
- 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
202
-
203
- - name : Build
204
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
205
-
206
- - name : Package and Upload macOS SDL artifact
207
- run : |
208
- mkdir upload
209
- mv ${{github.workspace}}/build/shadps4 upload
210
- cp $(arch -x86_64 /usr/local/bin/brew --prefix)/opt/molten-vk/lib/libMoltenVK.dylib upload
211
- tar cf shadps4-macos-sdl.tar.gz -C upload .
212
- - uses : actions/upload-artifact@v4
213
- with :
214
- name : shadps4-macos-sdl-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
215
- path : shadps4-macos-sdl.tar.gz
216
-
217
- macos-qt :
218
- runs-on : macos-latest
219
- needs : get-info
220
- steps :
221
- - uses : actions/checkout@v4
222
- with :
223
- submodules : recursive
224
-
225
- - name : Setup latest Xcode
226
- uses : maxim-lobanov/setup-xcode@v1
227
- with :
228
- xcode-version : latest
229
-
230
- - name : Install MoltenVK and Setup Qt
231
- run : |
232
- arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
233
- arch -x86_64 /usr/local/bin/brew install molten-vk
234
- - uses : jurplel/install-qt-action@v4
235
- with :
236
- version : 6.7.3
237
- host : mac
238
- target : desktop
239
- arch : clang_64
240
- archives : qtbase qttools
241
- modules : qtmultimedia
242
-
243
- - name : Cache CMake Configuration
244
- uses : actions/cache@v4
245
- env :
246
- cache-name : ${{ runner.os }}-qt-cache-cmake-configuration
247
- with :
248
- path : |
249
- ${{github.workspace}}/build
250
- key : ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
251
- restore-keys : |
252
- ${{ env.cache-name }}-
253
-
254
- - name : Cache CMake Build
255
- uses :
hendrikmuhs/[email protected]
256
- env :
257
- cache-name : ${{runner.os}}-qt-cache-cmake-build
258
- with :
259
- append-timestamp : false
260
- create-symlink : true
261
- key : ${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
262
- variant : sccache
263
-
264
- - name : Configure CMake
265
- 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
266
-
267
- - name : Build
268
- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(sysctl -n hw.ncpu)
269
-
270
- - name : Package and Upload macOS Qt artifact
271
- run : |
272
- mkdir upload
273
- mv ${{github.workspace}}/build/shadps4.app upload
274
- macdeployqt upload/shadps4.app
275
- tar cf shadps4-macos-qt.tar.gz -C upload .
276
- - uses : actions/upload-artifact@v4
277
- with :
278
- name : shadps4-macos-qt-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
279
- path : shadps4-macos-qt.tar.gz
280
-
281
56
linux-sdl :
282
57
runs-on : ubuntu-24.04
283
58
needs : get-info
@@ -380,102 +155,3 @@ jobs:
380
155
with :
381
156
name : shadps4-linux-qt-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}
382
157
path : Shadps4-qt.AppImage
383
-
384
- pre-release :
385
- if : github.ref == 'refs/heads/main' && github.repository == 'shadps4-emu/shadPS4' && github.event_name == 'push'
386
- needs : [get-info, windows-sdl, windows-qt, macos-sdl, macos-qt, linux-sdl, linux-qt]
387
- runs-on : ubuntu-latest
388
- steps :
389
- - name : Download all artifacts
390
- uses : actions/download-artifact@v4
391
- with :
392
- path : ./artifacts
393
-
394
- - name : Compress individual directories (without parent directory)
395
- run : |
396
- cd ./artifacts
397
- for dir in */; do
398
- if [ -d "$dir" ]; then
399
- dir_name=${dir%/}
400
- echo "Creating zip for $dir_name"
401
- (cd "$dir_name" && zip -r "../${dir_name}.zip" .)
402
- fi
403
- done
404
-
405
- - name : Get latest release information
406
- id : get_latest_release
407
- env :
408
- GITHUB_TOKEN : ${{ secrets.SHADPS4_TOKEN_REPO }}
409
- run : |
410
- api_url="https://api.github.com/repos/${{ github.repository }}"
411
- latest_release_info=$(curl -H "Authorization: token $GITHUB_TOKEN" "$api_url/releases/latest")
412
- echo "last_release_tag=$(echo "$latest_release_info" | jq -r '.tag_name')" >> $GITHUB_ENV
413
-
414
- - name : Create Pre-Release on GitHub
415
- id : create_release
416
- uses : ncipollo/release-action@v1
417
- with :
418
- token : ${{ secrets.SHADPS4_TOKEN_REPO }}
419
- name : " Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}"
420
- tag : " Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}"
421
- draft : false
422
- prerelease : true
423
- 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 }})"
424
- artifacts : ./artifacts/*.zip
425
-
426
- - name : Get current pre-release information
427
- env :
428
- GITHUB_TOKEN : ${{ secrets.SHADPS4_TOKEN_REPO }}
429
- run : |
430
- api_url="https://api.github.com/repos/${{ github.repository }}/releases"
431
-
432
- # Get all releases (sorted by date)
433
- releases=$(curl -H "Authorization: token $GITHUB_TOKEN" "$api_url")
434
-
435
- # Capture the most recent pre-release (assuming the first one is the latest)
436
- current_release=$(echo "$releases" | jq -c '.[] | select(.prerelease == true) | .published_at' | sort -r | head -n 1)
437
-
438
- # Remove extra quotes from captured date
439
- current_release=$(echo $current_release | tr -d '"')
440
-
441
- # Export the current published_at to be available for the next step
442
- echo "CURRENT_PUBLISHED_AT=$current_release" >> $GITHUB_ENV
443
-
444
- - name : Delete old pre-releases and tags
445
- env :
446
- GITHUB_TOKEN : ${{ secrets.SHADPS4_TOKEN_REPO }}
447
- run : |
448
- api_url="https://api.github.com/repos/${{ github.repository }}/releases"
449
-
450
- # Get current pre-releases
451
- releases=$(curl -H "Authorization: token $GITHUB_TOKEN" "$api_url")
452
-
453
- # Remove extra quotes from captured date
454
- CURRENT_PUBLISHED_AT=$(echo $CURRENT_PUBLISHED_AT | tr -d '"')
455
-
456
- # Convert CURRENT_PUBLISHED_AT para timestamp Unix
457
- current_published_ts=$(date -d "$CURRENT_PUBLISHED_AT" +%s)
458
-
459
- # Identify pre-releases
460
- echo "$releases" | jq -c '.[] | select(.prerelease == true)' | while read -r release; do
461
- release_date=$(echo "$release" | jq -r '.published_at')
462
- release_id=$(echo "$release" | jq -r '.id')
463
- release_tag=$(echo "$release" | jq -r '.tag_name')
464
-
465
- # Remove extra quotes from captured date
466
- release_date=$(echo $release_date | tr -d '"')
467
-
468
- # Convert release_date para timestamp Unix
469
- release_date_ts=$(date -d "$release_date" +%s)
470
-
471
- # Compare timestamps and delete old pre-releases
472
- if [[ "$release_date_ts" -lt "$current_published_ts" ]]; then
473
- echo "Deleting old pre-release: $release_id from $release_date with tag: $release_tag"
474
- # Delete the pre-release
475
- curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" "$api_url/$release_id"
476
- # Delete the tag
477
- curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/${{ github.repository }}/git/refs/tags/$release_tag"
478
- else
479
- echo "Skipping pre-release: $release_id (newer or same date)"
480
- fi
481
- done
0 commit comments