-
Notifications
You must be signed in to change notification settings - Fork 723
586 lines (494 loc) · 19.8 KB
/
rolling-release.yml
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
name: Create rolling release
on:
pull_request:
paths-ignore:
- '**.md'
- 'appveyor.yml'
- 'scripts/*'
- '.github/ISSUE_TEMPLATE/*'
push:
branches:
- master
- dev
paths-ignore:
- '**.md'
- 'appveyor.yml'
- 'scripts/*'
- '.github/ISSUE_TEMPLATE/*'
workflow_dispatch:
jobs:
windows-x64-build:
name: Windows x64 Build
runs-on: windows-2022
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: |
dep/msvc/deps-arm64
dep/msvc/deps-x64
key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }}
- name: Build x64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-x64.bat
- name: Build ARM64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-arm64.bat
- name: Initialize Build Tag
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-release.zip" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as Rolling Release Build
if: github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h
- name: Update RC Version Fields
shell: cmd
run: |
cd src\scmversion
call update_rc_version.bat
cd ..\..
git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc
- name: Compile x64 Release Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
msbuild duckstation.sln -t:Build -p:Platform=x64;Configuration=ReleaseLTCG-Clang
- name: Create x64 Symbols Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-release-symbols.zip ./bin/x64/*.pdb
- name: Remove Extra Bloat Before Archiving
shell: cmd
run: |
del /Q bin\x64\*.pdb bin\x64\*.exp bin\x64\*.lib bin\x64\*.iobj bin\x64\*.ipdb bin\x64\common-tests*
rename bin\x64\updater-x64-ReleaseLTCG.exe updater.exe
- name: Create x64 Release Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-release.zip ./bin/x64/*
- name: Upload x64 Release Artifact
uses: actions/[email protected]
with:
name: "windows-x64"
path: "duckstation-windows-x64-release*.zip"
windows-x64-sse2-build:
name: Windows x64 SSE2 Build
runs-on: windows-2022
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: |
dep/msvc/deps-arm64
dep/msvc/deps-x64
key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }}
- name: Build x64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-x64.bat
- name: Build ARM64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-arm64.bat
- name: Initialize Build Tag
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-sse2-release.zip" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as Rolling Release Build
if: github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h
- name: Update RC Version Fields
shell: cmd
run: |
cd src\scmversion
call update_rc_version.bat
cd ..\..
git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc
- name: Compile x64 Release Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
msbuild duckstation.sln -t:Build -p:Platform=x64;Configuration=ReleaseLTCG-Clang
- name: Create x64 Symbols Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-sse2-release-symbols.zip ./bin/x64/*.pdb
- name: Remove Extra Bloat Before Archiving
shell: cmd
run: |
del /Q bin\x64\*.pdb bin\x64\*.exp bin\x64\*.lib bin\x64\*.iobj bin\x64\*.ipdb bin\x64\common-tests*
rename bin\x64\updater-x64-ReleaseLTCG-SSE2.exe updater.exe
- name: Create x64 Release Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-sse2-release.zip ./bin/x64/*
- name: Upload x64 Release Artifact
uses: actions/[email protected]
with:
name: "windows-x64-sse2"
path: "duckstation-windows-x64-sse2-release*.zip"
windows-arm64-build:
name: Windows ARM64 Build
runs-on: windows-2022
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: |
dep/msvc/deps-arm64
dep/msvc/deps-x64
key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }}
- name: Build x64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-x64.bat
- name: Build ARM64 Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
DEBUG: 0
run: scripts/deps/build-dependencies-windows-arm64.bat
- name: Initialize Build Tag
shell: cmd
run: |
echo #pragma once > src/scmversion/tag.h
echo #define SCM_RELEASE_ASSET "duckstation-windows-arm64-release.zip" >> src/scmversion/tag.h
echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as Rolling Release
if: github.ref == 'refs/heads/dev'
shell: cmd
run: |
echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h
- name: Update RC Version Fields
shell: cmd
run: |
cd src\scmversion
call update_rc_version.bat
cd ..\..
git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc
- name: Compile ARM64 Release Build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64
msbuild duckstation.sln -t:Build -p:Platform=ARM64;Configuration=ReleaseLTCG-Clang
- name: Create ARM64 symbols archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-arm64-release-symbols.zip ./bin/ARM64/*.pdb
- name: Remove Extra Bloat Before Archiving
shell: cmd
run: |
del /Q bin\ARM64\*.pdb bin\ARM64\*.exp bin\ARM64\*.lib bin\ARM64\*.iobj bin\ARM64\*.ipdb bin\ARM64\common-tests*
rename bin\ARM64\updater-ARM64-ReleaseLTCG.exe updater.exe
- name: Create ARM64 Release Archive
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-arm64-release.zip ./bin/ARM64/*
- name: Upload ARM64 Release Artifact
uses: actions/[email protected]
with:
name: "windows-arm64"
path: "duckstation-windows-arm64-release*.zip"
linux-x64-appimage-build:
name: Linux x64 AppImage
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install Packages
run: scripts/appimage/install-packages.sh
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: ~/deps
key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh', 'scripts/deps/build-ffmpeg-linux.sh') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-dependencies-linux.sh "$HOME/deps"
- name: Build FFmpeg
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-ffmpeg-linux.sh "$HOME/deps"
- name: Initialize Build Tag
run: |
echo '#pragma once' > src/scmversion/tag.h
echo '#define SCM_RELEASE_ASSET "DuckStation-x64.AppImage"' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
run: |
echo '#define SCM_RELEASE_TAG "preview"' >> src/scmversion/tag.h
- name: Tag as Rolling Release
if: github.ref == 'refs/heads/dev'
run: |
echo '#define SCM_RELEASE_TAG "latest"' >> src/scmversion/tag.h
- name: Compile Build
shell: bash
run: |
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" ..
cmake --build . --parallel
cd ..
scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64
- name: Upload Qt AppImage
uses: actions/[email protected]
with:
name: "linux-x64-appimage"
path: "DuckStation-x64.AppImage"
linux-x64-sse2-appimage-build:
name: "Linux x64 SSE2 AppImage"
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install Packages
run: scripts/appimage/install-packages.sh
- name: Cache Dependencies
id: cache-deps
uses: actions/[email protected]
with:
path: ~/deps
key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh', 'scripts/deps/build-ffmpeg-linux.sh') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-dependencies-linux.sh "$HOME/deps"
- name: Build FFmpeg
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/deps/build-ffmpeg-linux.sh "$HOME/deps"
- name: Initialize Build Tag
run: |
echo '#pragma once' > src/scmversion/tag.h
echo '#define SCM_RELEASE_ASSET "DuckStation-x64.AppImage"' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
run: |
echo '#define SCM_RELEASE_TAG "preview"' >> src/scmversion/tag.h
- name: Tag as Rolling Release
if: github.ref == 'refs/heads/dev'
run: |
echo '#define SCM_RELEASE_TAG "latest"' >> src/scmversion/tag.h
- name: Compile Build
shell: bash
run: |
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DDISABLE_SSE4=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" ..
cmake --build . --parallel
cd ..
scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64-SSE2
- name: Upload Qt AppImage
uses: actions/[email protected]
with:
name: "linux-x64-sse2-appimage"
path: "DuckStation-x64-SSE2.AppImage"
linux-flatpak-build:
name: Linux Flatpak Build
runs-on: ubuntu-22.04
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.7
options: --privileged
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
set-safe-directory: ${{ env.GITHUB_WORKSPACE }}
# Work around container ownership issue
- name: Set Safe Directory
shell: bash
run: git config --global --add safe.directory "*"
- name: Initialize Build Tag
run: |
echo '#pragma once' > src/scmversion/tag.h
- name: Generate AppStream XML
run: |
scripts/generate-metainfo.sh scripts/flatpak
cat scripts/flatpak/org.duckstation.DuckStation.metainfo.xml
- name: Validate AppStream XML
run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml
- name: Validate Manifest
run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml
- name: Build Flatpak
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with:
bundle: duckstation-x64.flatpak
upload-artifact: false
manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml
arch: x86_64
build-bundle: true
verbose: true
mirror-screenshots-url: https://dl.flathub.org/media
branch: stable
cache: true
restore-cache: true
cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }}
- name: Validate Build
run: |
flatpak-builder-lint repo repo
- name: Push To Flathub Stable
if: github.ref == 'refs/heads/dev'
uses: flathub-infra/flatpak-github-actions/flat-manager@b6c92176b7f578aedd80cac74cd8f0336f618e89
with:
flat-manager-url: https://hub.flathub.org/
repository: stable
token: ${{ secrets.FLATHUB_STABLE_TOKEN }}
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Upload Flatpak
uses: actions/[email protected]
with:
name: "linux-flatpak"
path: "duckstation-x64.flatpak"
macos-build:
name: MacOS Universal Build
runs-on: macos-14
timeout-minutes: 120
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Use Xcode 15.4
run: sudo xcode-select -s /Applications/Xcode_15.4.app
- name: Install packages
shell: bash
run: |
brew install ninja
- name: Cache Dependencies
id: cache-deps-mac
uses: actions/[email protected]
with:
path: ~/deps
key: deps-mac ${{ hashFiles('scripts/deps/build-dependencies-mac.sh') }}
- name: Build Dependencies
if: steps.cache-deps-mac.outputs.cache-hit != 'true'
run: scripts/deps/build-dependencies-mac.sh "$HOME/deps"
- name: Initialize Build Tag
run: |
echo '#pragma once' > src/scmversion/tag.h
- name: Tag as Preview Release
if: github.ref == 'refs/heads/master'
run: |
echo '#define SCM_RELEASE_ASSET "duckstation-mac-release.zip"' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAG "preview"' >> src/scmversion/tag.h
- name: Tag as Rolling Release
if: github.ref == 'refs/heads/dev'
run: |
echo '#define SCM_RELEASE_ASSET "duckstation-mac-release.zip"' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h
echo '#define SCM_RELEASE_TAG "latest"' >> src/scmversion/tag.h
- name: Compile and Zip .app
shell: bash
run: |
mkdir build
cd build
export MACOSX_DEPLOYMENT_TARGET=11.0
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja ..
cmake --build . --parallel
mv bin/DuckStation.app .
codesign -s - --deep -f -v DuckStation.app
zip -r duckstation-mac-release.zip DuckStation.app/
- name: Upload MacOS .app
uses: actions/[email protected]
with:
name: "macos"
path: "build/duckstation-mac-release.zip"
create-release:
needs: [windows-x64-build, windows-x64-sse2-build, windows-arm64-build, linux-x64-appimage-build, linux-x64-sse2-appimage-build, linux-flatpak-build, macos-build]
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
steps:
- name: Download Artifacts
uses: actions/[email protected]
with:
path: ./artifacts/
- name: Display Downloaded Artifacts
run: find ./artifacts/
- name: Create Preview Release
if: github.ref == 'refs/heads/master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "preview"
prerelease: true
title: "Latest Preview Build"
files: |
./artifacts/windows-x64/duckstation-windows-x64-release.zip
./artifacts/windows-x64/duckstation-windows-x64-release-symbols.zip
./artifacts/windows-x64-sse2/duckstation-windows-x64-sse2-release.zip
./artifacts/windows-x64-sse2/duckstation-windows-x64-sse2-release-symbols.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip
./artifacts/linux-x64-appimage/DuckStation-x64.AppImage
./artifacts/linux-x64-sse2-appimage/DuckStation-x64-SSE2.AppImage
./artifacts/linux-flatpak/duckstation-x64.flatpak
./artifacts/macos/duckstation-mac-release.zip
- name: Create Rolling Release
if: github.ref == 'refs/heads/dev'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest Rolling Release"
files: |
./artifacts/windows-x64/duckstation-windows-x64-release.zip
./artifacts/windows-x64/duckstation-windows-x64-release-symbols.zip
./artifacts/windows-x64-sse2/duckstation-windows-x64-sse2-release.zip
./artifacts/windows-x64-sse2/duckstation-windows-x64-sse2-release-symbols.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip
./artifacts/linux-x64-appimage/DuckStation-x64.AppImage
./artifacts/linux-x64-sse2-appimage/DuckStation-x64-SSE2.AppImage
./artifacts/linux-flatpak/duckstation-x64.flatpak
./artifacts/macos/duckstation-mac-release.zip