-
-
Notifications
You must be signed in to change notification settings - Fork 1
359 lines (295 loc) · 17 KB
/
release.yaml
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
name: Release-local
on:
push:
tags:
- v*.*.*
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
outputs:
linuxArtifact: ${{ steps.build_linux.outputs.file_name_lin }}
windowsArtifact: ${{ steps.build_windows.outputs.file_name_win }}
version: ${{ steps.get_version.outputs.version }}
strategy:
fail-fast: true
matrix:
# We use self-hosted because this action often runs out of memory on github's own servers.
#os: [self-hosted-windows, self-hosted-linux]
os: [self-hosted-windows]
include:
# Old windows configuration.
# No longer used due to memory problems on compilation.
#- {os: windows-latest, TARGET: x86_64-pc-windows-msvc, EXTENSION: zip, MIME: application/x-zip-compressed, DDISK: D}
# Self-hosted windows requires:
# - Windows 10 x64.
# - VSTools installed.
# - 2 disks (C: and E:).
- {os: self-hosted-windows, TARGET: x86_64-pc-windows-msvc, EXTENSION: zip, MIME: application/x-zip-compressed, DDISK: E}
# Self-hosted linux requires:
# - Archlinux Docker with some custom stuff.
#- {os: self-hosted-linux, TARGET: x86_64-unknown-linux-gnu, EXTENSION: tar.zst, MIME: application/tar+zstd}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2.2.1
#- name: Build Runcher (Linux)
# if: matrix.os == 'self-hosted-linux'
# shell: bash
# run: |
# cd /usr/src/app/_work/runcher/runcher
# cargo build --release
- name: Build Runcher (Windows)
id: build_windows
if: matrix.os == 'self-hosted-windows'
shell: pwsh
run: |
echo "file_name_win=runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}" >> $env:GITHUB_OUTPUT
${{ matrix.DDISK }}:\Craft\craft\craftenv.ps1
cd E:\runner_runcher\_work\runcher\runcher
# Build the exes in release mode.
$env:CARGO_NET_GIT_FETCH_WITH_CLI = 'true'
cargo build --release
# - name: Prepare Assets for Release (Linux)
# id: build_linux
# if: matrix.os == 'self-hosted-linux'
# run: |
# echo "file_name_lin=runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}" >> $GITHUB_OUTPUT
#
# # Go back one folder to not put the built files in the repo.
# cd /usr/src/app/_work/runcher/
#
# mkdir -p build/usr/bin/
# cp -R runcher/target/release/runcher build/usr/bin/runcher
#
# # The dark theme. May be removed in a future cleanup.
# mkdir -p build/usr/share/runcher/
# cp -R runcher/dark-theme.qss build/usr/share/runcher/dark-theme.qss
#
# # The icons.
# mkdir -p build/usr/share/runcher/icons/
# cp -R runcher/icons/* build/usr/share/runcher/icons/
#
# # The language files.
# mkdir -p build/usr/share/runcher/locale/
# cp -R runcher/locale/* build/usr/share/runcher/locale/
#
# # The UI files.
# mkdir -p build/usr/share/runcher/ui/
# cp -R runcher/ui_templates/* build/usr/share/runcher/ui/
#
# # Shortcuts.
# mkdir -p build/usr/share/applications
# cp -R runcher/install/arch/runcher.desktop build/usr/share/applications/runcher.desktop
#
# # License.
# mkdir -p build/usr/share/licenses/runcher
# cp -R runcher/LICENSE build/usr/share/licenses/runcher/LICENSE
#
# # And finally create the compressed file.
# tar --zstd -cf runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }} -C build usr
- name: Prepare Assets for Release (Windows)
if: matrix.os == 'self-hosted-windows'
run: |
cd ${{ matrix.DDISK }}:\
rm -r -fo ${{ matrix.DDISK }}:\deploy
mkdir deploy
cd deploy
mkdir runcher-release-assets
cd runcher-release-assets
# Copy Breeze icons into the release.
mkdir -p data/icons
cp "${{ matrix.DDISK }}:\Craft\bin\data\icons\breeze" "${{ matrix.DDISK }}:\deploy\runcher-release-assets\data\icons\" -recurse
cp "${{ matrix.DDISK }}:\Craft\bin\data\icons\breeze-dark" "${{ matrix.DDISK }}:\deploy\runcher-release-assets\data\icons\" -recurse
# Here we copy all the dlls required by runcher. Otherwise we'll have to manually update them on every freaking release, and for 2 months that's been a royal PITA.
mkdir designer
cp ${{ matrix.DDISK }}:\Craft\plugins\designer\*.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\designer\
mkdir iconengines
cp ${{ matrix.DDISK }}:\Craft\plugins\iconengines\KIconEnginePlugin.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\iconengines\
cp ${{ matrix.DDISK }}:\Craft\plugins\iconengines\qsvgicon.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\iconengines\
mkdir imageformats
cp ${{ matrix.DDISK }}:\Craft\plugins\imageformats\*.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\imageformats\
# TODO: Check if we have to copy the kf5 folder.
mkdir platforms
cp ${{ matrix.DDISK }}:\Craft\plugins\platforms\qwindows.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\platforms\
mkdir styles
cp ${{ matrix.DDISK }}:\Craft\plugins\styles\qwindowsvistastyle.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\styles\
cp ${{ matrix.DDISK }}:\Craft\bin\d3dcompiler_47.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\dbus-1-3.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\editorconfig.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\freetype.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\harfbuzz.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\iconv.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\icudt??.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\icuin??.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\icuuc??.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\intl-8.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\jpeg62.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5Archive.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5Codecs.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5ConfigCore.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5ConfigGui.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5ConfigWidgets.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5CoreAddons.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5GuiAddons.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5I18n.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5IconThemes.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\KF5WidgetsAddons.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libbzip2.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libcrypto*.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libEGL.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libGLESV2.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\liblzma.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libpng16.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\libssl*.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
# Are these still neccesary?
cp ${{ matrix.DDISK }}:\Craft\bin\msvcp140.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\msvcp140_1.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\msvcp140_2.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\pcre2-8.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\pcre2-16.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\Qt5DBus.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\Qt5Svg.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
# Same as before. Still neccesary?
cp ${{ matrix.DDISK }}:\Craft\bin\vcruntime140.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\vcruntime140_1.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\tiff.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\zlib1.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp ${{ matrix.DDISK }}:\Craft\bin\zstd.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
# Here we copy files generated from the compilation.
cp E:\runner_runcher\_work\runcher\runcher/target/release/runcher.exe ${{ matrix.DDISK }}:\deploy\runcher-release-assets
cp E:\runner_runcher\_work\runcher\runcher/target/release/runcher.pdb ${{ matrix.DDISK }}:\deploy\runcher-release-assets
# Workshopper for workshop and steam launch support.
cp ${{ matrix.DDISK }}:\steam_api64.dll ${{ matrix.DDISK }}:\deploy\runcher-release-assets\
cp E:\runner_runcher\_work\runcher\runcher/target/release/workshopper.exe ${{ matrix.DDISK }}:\deploy\runcher-release-assets
# TWPatcher for load order patching support.
cp E:\runner_runcher\_work\runcher\runcher/target/release/twpatcher.exe ${{ matrix.DDISK }}:\deploy\runcher-release-assets
# Here we copy assets from the repo.
mkdir icons
mkdir locale
mkdir ui
cp E:\runner_runcher\_work\runcher\runcher/LICENSE ${{ matrix.DDISK }}:\deploy\runcher-release-assets
cp E:\runner_runcher\_work\runcher\runcher/CHANGELOG.md ${{ matrix.DDISK }}:\deploy\runcher-release-assets
cp E:\runner_runcher\_work\runcher\runcher/CHANGELOG.md ${{ matrix.DDISK }}:\deploy\runcher-release-assets\CHANGELOG.txt
cp E:\runner_runcher\_work\runcher\runcher/dark-theme.qss ${{ matrix.DDISK }}:\deploy\runcher-release-assets
cp E:\runner_runcher\_work\runcher\runcher/icons/* ${{ matrix.DDISK }}:\deploy\runcher-release-assets\icons\
cp E:\runner_runcher\_work\runcher\runcher/locale/* ${{ matrix.DDISK }}:\deploy\runcher-release-assets\locale\
cp E:\runner_runcher\_work\runcher\runcher/ui_templates/* ${{ matrix.DDISK }}:\deploy\runcher-release-assets\ui\
# Execute windeployqt to add missing translations and the vcredist if needed.
${{ matrix.DDISK }}:\Craft\craft\craftenv.ps1
cd ${{ matrix.DDISK }}:\deploy\runcher-release-assets
windeployqt runcher.exe
# Remove extra files that are not really needed for execution.
rm -fo ${{ matrix.DDISK }}:\deploy\runcher-release-assets\vc_redist.x64.exe
rm -fo ${{ matrix.DDISK }}:\deploy\runcher-release-assets\icons\breeze-icons.rcc
rm -fo ${{ matrix.DDISK }}:\deploy\runcher-release-assets\icons\breeze-icons-dark.rcc
7z a runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }} .\**
#- name: Upload build artifact (Linux)
# id: upload-release-asset-linux
# if: matrix.os == 'self-hosted-linux'
# uses: actions/upload-artifact@v4
# with:
# name: runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}
# path: /usr/src/app/_work/runcher/runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}
- name: Upload build artifact (Windows)
id: upload-release-asset-windows
if: matrix.os == 'self-hosted-windows'
uses: actions/upload-artifact@v4
with:
name: runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}
path: ${{ matrix.DDISK }}:/deploy/runcher-release-assets/runcher-${{ steps.get_version.outputs.version }}-${{ matrix.TARGET }}.${{ matrix.EXTENSION }}
create_release:
name: Create Release
needs:
- build
runs-on: ubuntu-latest
outputs:
# Concatenated because it's either one or the other.
upload_url: ${{ steps.create_release_beta.outputs.upload_url }}${{ steps.create_release_stable.outputs.upload_url }}
is_beta: ${{ steps.check_version_format_bash.outputs.is_beta }}
steps:
- uses: actions/checkout@v2
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
path: ./CHANGELOG.md
- name: Check Version Format in Tag
id: check_version_format
uses: nowsprinting/check-version-format-action@v3.2.4
- name: Check the release type
id: check_version_format_bash
shell: bash
run: |
if [[ ${{ steps.check_version_format.outputs.patch }} -gt 99 ]]; then
echo "is_beta=1" >> $GITHUB_OUTPUT
else
echo "is_beta=0" >> $GITHUB_OUTPUT
fi
- name: Create Release (beta)
id: create_release_beta
if: steps.check_version_format_bash.outputs.is_beta == 1
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release beta ${{ github.ref }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: true
prerelease: true
- name: Create Release (stable)
id: create_release_stable
if: steps.check_version_format_bash.outputs.is_beta == 0
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
[][Patreon]
${{ steps.changelog_reader.outputs.changes }}
[Patreon]: https://www.patreon.com/RPFM
draft: true
prerelease: false
upload_release_assets:
name: Upload Release Assets
needs:
- build
- create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./downloads
- name: List downloads
run: |
ls -lR downloads
# TODO: Move the mimes out.
#- name: Upload Release Asset (Linux)
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: ./downloads/${{ needs.build.outputs.linuxArtifact }}/${{ needs.build.outputs.linuxArtifact }}
# asset_name: ${{ needs.build.outputs.linuxArtifact }}
# asset_content_type: application/tar+zstd
- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./downloads/${{ needs.build.outputs.windowsArtifact }}/${{ needs.build.outputs.windowsArtifact }}
asset_name: ${{ needs.build.outputs.windowsArtifact }}
asset_content_type: application/x-zip-compressed