-
Notifications
You must be signed in to change notification settings - Fork 721
300 lines (254 loc) · 9.79 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
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-build:
runs-on: windows-2022
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: Tag as preview build
if: github.ref == 'refs/heads/master'
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
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as dev build
if: github.ref == 'refs/heads/dev'
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
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
git update-index --assume-unchanged src/duckstation-nogui/duckstation-nogui.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
- 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: Upload x64 release symbols artifact
uses: actions/upload-artifact@v1
with:
name: "windows"
path: "duckstation-windows-x64-release-symbols.zip"
- 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/upload-artifact@v1
with:
name: "windows"
path: "duckstation-windows-x64-release.zip"
windows-arm64-build:
runs-on: windows-2022
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: Tag as preview build
if: github.ref == 'refs/heads/master'
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
echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h
- name: Tag as dev build
if: github.ref == 'refs/heads/dev'
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
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
git update-index --assume-unchanged src/duckstation-nogui/duckstation-nogui.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
- 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: Upload arm64 release symbols artifact
uses: actions/upload-artifact@v1
with:
name: "windows-arm64"
path: "duckstation-windows-arm64-release-symbols.zip"
- 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/upload-artifact@v1
with:
name: "windows-arm64"
path: "duckstation-windows-arm64-release.zip"
linux-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install packages
shell: bash
run: |
# Workaround for https://github.com/actions/runner-images/issues/675
sudo scripts/retry.sh apt-get update
sudo scripts/retry.sh apt-get -y install cmake ninja-build ccache libsdl2-dev libgtk-3-dev libegl1-mesa-dev libevdev-dev libgbm-dev libdrm-dev libwayland-dev libwayland-egl-backend-dev extra-cmake-modules libcurl4-gnutls-dev libxrandr-dev llvm-12 lld-12 clang-12
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ~/deps
key: deps ${{ hashFiles('scripts/build-dependencies.sh') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: scripts/build-dependencies.sh
- name: Compile build
shell: bash
run: |
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_NOGUI_FRONTEND=OFF -DBUILD_QT_FRONTEND=ON -DUSE_DRMKMS=OFF -DUSE_EGL=ON -DUSE_SDL2=ON -DUSE_WAYLAND=ON -DUSE_X11=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH=$HOME/deps -DCMAKE_TOOLCHAIN_FILE=../scripts/clang-toolchain.cmake ..
cmake --build . --parallel
cd ..
scripts/make-appimage.sh $(realpath ./build) $(realpath .) $HOME/deps DuckStation-x64
- name: Upload Qt AppImage
uses: actions/upload-artifact@v1
with:
name: "linux-x64-appimage-qt"
path: "DuckStation-x64.AppImage"
macos-build:
runs-on: macos-11
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install packages
shell: bash
run: |
brew install curl ninja
- name: Cache Dependencies
id: cache-deps-mac
uses: actions/cache@v3
with:
path: ~/deps
key: deps-mac ${{ hashFiles('scripts/build-dependencies-mac.sh') }}
- name: Build Dependencies
if: steps.cache-deps-mac.outputs.cache-hit != 'true'
run: scripts/build-dependencies-mac.sh
- name: Compile and zip .app
shell: bash
run: |
mkdir build
cd build
../scripts/make-universal-macos-binary.sh ..
zip -r duckstation-mac-release.zip DuckStation.app/
- name: Upload macOS .app
uses: actions/upload-artifact@v1
with:
name: "macos"
path: "build/duckstation-mac-release.zip"
create-release:
needs: [windows-build, windows-arm64-build, linux-build, macos-build]
runs-on: "ubuntu-20.04"
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
steps:
- name: Download Windows Artifacts
uses: actions/download-artifact@v1
with:
name: "windows"
- name: Download Windows ARM64 Artifact
uses: actions/download-artifact@v1
with:
name: "windows-arm64"
- name: Download Qt AppImage Artifact
uses: actions/download-artifact@v1
with:
name: "linux-x64-appimage-qt"
- name: Download MacOS Artifact
uses: actions/download-artifact@v1
with:
name: "macos"
- 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: |
windows/duckstation-windows-x64-release.zip
windows/duckstation-windows-x64-release-symbols.zip
windows-arm64/duckstation-windows-arm64-release.zip
windows-arm64/duckstation-windows-arm64-release-symbols.zip
linux-x64-appimage-qt/DuckStation-x64.AppImage
macos/duckstation-mac-release.zip
- name: Create dev 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: |
windows/duckstation-windows-x64-release.zip
windows/duckstation-windows-x64-release-symbols.zip
windows-arm64/duckstation-windows-arm64-release.zip
windows-arm64/duckstation-windows-arm64-release-symbols.zip
linux-x64-appimage-qt/DuckStation-x64.AppImage
macos/duckstation-mac-release.zip