forked from eternalcodes/EternalJK
-
Notifications
You must be signed in to change notification settings - Fork 14
570 lines (495 loc) · 22 KB
/
build.yml
File metadata and controls
570 lines (495 loc) · 22 KB
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
name: build
on:
workflow_dispatch:
push:
branches:
- master
- beta
paths-ignore:
- "**.md"
- ".gitignore"
- "docs/*"
pull_request:
branches:
- master
- beta
paths-ignore:
- "**.md"
- ".gitignore"
- "docs/*"
release:
types: [published]
jobs:
msvc:
name: Windows ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: windows-2022
strategy:
matrix:
arch: [x86, x86_64]
build_type: [Debug, Release]
portable: [Portable]
exclude:
- build_type: Debug
portable: Portable
include:
- arch: x86
platform: Win32
- arch: x86_64
platform: x64
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
- name: Add msbuild to PATH
shell: pwsh
run: |
$vsWhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vsWhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
if ($vsPath) {
Write-Host "Found Visual Studio at: $vsPath"
$msBuildPath = Get-ChildItem -Path "$vsPath\MSBuild\Current\Bin\MSBuild.exe" -ErrorAction SilentlyContinue |
Select-Object -First 1 -ExpandProperty Directory
if ($msBuildPath) {
Write-Host "Found MSBuild at: $msBuildPath"
echo "$msBuildPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$env:PATH = "$msBuildPath;$env:PATH"
} else {
throw "MSBuild not found in VS installation"
}
} else {
throw "Visual Studio installation not found"
}
- name: Create Build Environment
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=bin"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
cmake $GITHUB_WORKSPACE -A ${{ matrix.platform }} $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . --config ${{ matrix.build_type }} -j $NUMBER_OF_PROCESSORS
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install . --config ${{ matrix.build_type }}
- name: Create Archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build/bin/JediAcademy
shell: bash
run: |
7z a -r TaystJK-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.zip *
- uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # v4.6.2
if: ${{ matrix.build_type == 'Release' }}
with:
name: TaystJK-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/build/bin/JediAcademy/TaystJK-windows-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.zip
if-no-files-found: error
ubuntu:
name: Ubuntu ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
build_type: [Debug, Release]
portable: [Portable]
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
- name: Create Build Environment
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install libpcre2-8-0:i386 gcc-multilib g++-multilib ninja-build libjpeg-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386 libglib2.0-dev:i386 libsdl2-dev:i386
else
sudo apt-get -qq update
sudo apt-get install libjpeg-dev libpng-dev zlib1g-dev libsdl2-dev
fi
cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
if [ ${{ matrix.arch }} == "x86" ]; then
OPTIONS+=" -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/linux-i686.cmake"
fi
cmake $GITHUB_WORKSPACE $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . -j $(nproc)
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install .
- name: Create binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: tar -czvf TaystJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # v4.6.2
if: ${{ matrix.build_type == 'Release' }}
with:
name: TaystJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{github.workspace}}/install/JediAcademy/TaystJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error
macos-x86_64:
name: macOS ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable}})
runs-on: macos-15-intel
strategy:
fail-fast: false
matrix:
arch: [x86_64]
build_type: [Debug, Release]
portable: [Portable]
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
- name: Create Build Environment
run: |
brew install sdl2
cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
cmake $GITHUB_WORKSPACE $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . -j $(getconf _NPROCESSORS_ONLN)
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install .
- name: Create TaystJK binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: |
chmod +x taystjk.${{ matrix.arch }}.app/Contents/MacOS/taystjk.${{ matrix.arch }}
chmod +x taystjkded.${{ matrix.arch }}
codesign --force --deep --sign - taystjk.${{ matrix.arch }}.app
codesign --force --deep --sign - taystjkded.${{ matrix.arch }}
tar -czvf TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # v4.6.2
if: ${{ matrix.build_type == 'Release' }}
with:
name: TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/install/JediAcademy/TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error
macos-arm64:
name: macOS ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable}})
runs-on: macos-15
strategy:
fail-fast: false
matrix:
arch: [arm64]
build_type: [Debug, Release]
portable: [Portable]
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
fetch-tags: true
- name: Create Build Environment
run: |
brew install sdl2
cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DBuildPortableVersion=ON"
else
OPTIONS+=" -DBuildPortableVersion=OFF"
fi
cmake $GITHUB_WORKSPACE $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . -j $(getconf _NPROCESSORS_ONLN)
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install .
- name: Create TaystJK binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: |
chmod +x taystjk.${{ matrix.arch }}.app/Contents/MacOS/taystjk.${{ matrix.arch }}
chmod +x taystjkded.${{ matrix.arch }}
codesign --force --deep --sign - taystjk.${{ matrix.arch }}.app
codesign --force --deep --sign - taystjkded.${{ matrix.arch }}
tar -czvf TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # v4.6.2
if: ${{ matrix.build_type == 'Release' }}
with:
name: TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{ github.workspace }}/install/JediAcademy/TaystJK-macos-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error
macos-universal2:
name: macOS universal2 Binary
needs: [macos-x86_64, macos-arm64]
runs-on: macos-15
steps:
- name: Download x86_64 artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: TaystJK-macos-x86_64-Release-Portable
path: x86_64-build
- name: Download arm64 artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: TaystJK-macos-arm64-Release-Portable
path: arm64-build
- name: Extract archives
run: |
mkdir -p x86_64-extracted
mkdir -p arm64-extracted
tar -xzf x86_64-build/TaystJK-macos-x86_64-Release-Portable.tar.gz -C x86_64-extracted
tar -xzf arm64-build/TaystJK-macos-arm64-Release-Portable.tar.gz -C arm64-extracted
- name: Create Universal 2 Binary
run: |
mkdir -p universal2-app/JediAcademy/taystjk.app/Contents/{MacOS/taystjk,Resources,Frameworks}
mkdir -p universal2-app/JediAcademy/taystjk/
cp -R x86_64-extracted/taystjk.x86_64.app/Contents/Info.plist universal2-app/JediAcademy/taystjk.app/Contents/
cp -R x86_64-extracted/taystjk.x86_64.app/Contents/PkgInfo universal2-app/JediAcademy/taystjk.app/Contents/ 2>/dev/null || true
cp -R x86_64-extracted/taystjk.x86_64.app/Contents/Resources/* universal2-app/JediAcademy/taystjk.app/Contents/Resources/
cp -R x86_64-extracted/taystjk/* universal2-app/JediAcademy/taystjk/
sed -i '' 's/x86_64/ub2/g' universal2-app/JediAcademy/taystjk.app/Contents/Info.plist
lipo -create -output "universal2-app/JediAcademy/taystjk.app/Contents/MacOS/taystjk.ub2" \
x86_64-extracted/taystjk.x86_64.app/Contents/MacOS/taystjk.x86_64 \
arm64-extracted/taystjk.arm64.app/Contents/MacOS/taystjk.arm64
lipo -create -output universal2-app/JediAcademy/taystjkded \
x86_64-extracted/taystjkded.x86_64 \
arm64-extracted/taystjkded.arm64
lipo -create -output universal2-app/JediAcademy/taystjk.app/Contents/Frameworks/libSDL2-2.0.0.dylib \
x86_64-extracted/taystjk.x86_64.app/Contents/Frameworks/libSDL2-2.0.0.dylib \
arm64-extracted/taystjk.arm64.app/Contents/Frameworks/libSDL2-2.0.0.dylib
cp -v x86_64-extracted/taystjk.x86_64.app/Contents/MacOS/rd-*_x86_64.dylib universal2-app/JediAcademy/taystjk.app/Contents/MacOS/
cp -v arm64-extracted/taystjk.arm64.app/Contents/MacOS/rd-*_arm64.dylib universal2-app/JediAcademy/taystjk.app/Contents/MacOS/
cp -v x86_64-extracted/taystjk.x86_64.app/Contents/MacOS/taystjk/*x86_64.dylib universal2-app/JediAcademy/taystjk.app/Contents/MacOS/taystjk/
cp -v arm64-extracted/taystjk.arm64.app/Contents/MacOS/taystjk/*arm64.dylib universal2-app/JediAcademy/taystjk.app/Contents/MacOS/taystjk/
- name: Create TaystJK binary archive
working-directory: ${{ github.workspace }}/universal2-app/JediAcademy/
shell: bash
run: |
chmod +x taystjk.app/Contents/MacOS/taystjk.ub2
chmod +x taystjkded
codesign --force --deep --sign - taystjk.app
codesign --force --deep --sign - taystjkded
tar -czvf TaystJK-macos-universal2-Release-Portable.tar.gz *
- uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # v4.6.2
with:
name: TaystJK-macos-universal2-Release-Portable
path: universal2-app/JediAcademy/TaystJK-macos-universal2-Release-Portable.tar.gz
if-no-files-found: error
create-latest:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [msvc, ubuntu, macos-x86_64, macos-arm64, macos-universal2]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
with:
submodules: recursive
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: artifacts
- name: Create latest build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LATEST_RELEASE_COMMIT=$(gh api repos/${{ github.repository }}/releases/tags/latest --jq '.target_commitish' 2>/dev/null || echo "")
gh release delete latest --cleanup-tag --yes || true
RELEASE_BODY="## Commits"
if [ -n "$LATEST_RELEASE_COMMIT" ]; then
COMMITS=$(git log $LATEST_RELEASE_COMMIT..HEAD --pretty=format:"%h|%s|%an")
else
COMMITS=$(git log -3 --pretty=format:"%h|%s|%an")
fi
while IFS='|' read -r hash subject author; do
if [[ $subject =~ ^Merge\ pull\ request\ \#([0-9]+) ]]; then
PR_NUM="${BASH_REMATCH[1]}"
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)"
elif [[ $subject =~ \(#([0-9]+)\)$ ]]; then
PR_NUM="${BASH_REMATCH[1]}"
subject=$(echo "$subject" | sed 's/ (#[0-9]\+)$//')
PR_LINK=" [#${PR_NUM}](https://github.com/${{ github.repository }}/pull/${PR_NUM})"
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)${PR_LINK}"
else
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)"
fi
done <<< "$COMMITS"
RELEASE_FILES=""
for artifact_dir in artifacts/*; do
if [ -d "$artifact_dir" ]; then
for file in "$artifact_dir"/*; do
if [ -f "$file" ]; then
filename=$(basename "$file" | sed -e 's/-Release-Non-Portable//' -e 's/-Release-Portable//')
cp "$file" "$filename"
RELEASE_FILES="$RELEASE_FILES $filename"
fi
done
fi
done
gh release create latest \
--title "Latest Build" \
--notes "$RELEASE_BODY" \
--target ${{ github.sha }} \
$RELEASE_FILES
create-prerelease:
if: github.event_name == 'push' && github.ref == 'refs/heads/beta'
needs: [msvc, ubuntu, macos-x86_64, macos-arm64]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
with:
submodules: recursive
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: artifacts
- name: Create latest beta build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LATEST_BETA_COMMIT=$(gh api repos/${{ github.repository }}/releases/tags/latest-beta --jq '.target_commitish' 2>/dev/null || echo "")
gh release delete latest-beta --cleanup-tag --yes || true
RELEASE_BODY="## Commits"
if [ -n "$LATEST_BETA_COMMIT" ] && git rev-parse --quiet --verify "$LATEST_BETA_COMMIT^{commit}" >/dev/null; then
COMMITS=$(git log $LATEST_BETA_COMMIT..HEAD --pretty=format:"%h|%s|%an")
else
COMMITS=$(git log -3 --pretty=format:"%h|%s|%an")
fi
while IFS='|' read -r hash subject author; do
if [[ $subject =~ ^Merge\ pull\ request\ \#([0-9]+) ]]; then
PR_NUM="${BASH_REMATCH[1]}"
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)"
elif [[ $subject =~ \(#([0-9]+)\)$ ]]; then
PR_NUM="${BASH_REMATCH[1]}"
subject=$(echo "$subject" | sed 's/ (#[0-9]\+)$//')
PR_LINK=" [#${PR_NUM}](https://github.com/${{ github.repository }}/pull/${PR_NUM})"
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)${PR_LINK}"
else
RELEASE_BODY+=$'\n'"- $hash: $subject ($author)"
fi
done <<< "$COMMITS"
RELEASE_FILES=""
for artifact_dir in artifacts/*; do
if [ -d "$artifact_dir" ]; then
for file in "$artifact_dir"/*; do
if [ -f "$file" ]; then
filename=$(basename "$file" | sed -e 's/-Release-Non-Portable//' -e 's/-Release-Portable//')
cp "$file" "$filename"
RELEASE_FILES="$RELEASE_FILES $filename"
fi
done
fi
done
gh release create latest-beta \
--title "Beta Build" \
--notes "$RELEASE_BODY" \
--target ${{ github.sha }} \
--prerelease \
$RELEASE_FILES
create-release:
if: github.event_name == 'release'
needs: [msvc, ubuntu, macos-x86_64, macos-arm64, macos-universal2]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
with:
submodules: recursive
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: artifacts
- name: Upload archives
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for artifact_dir in artifacts/*; do
if [ -d "$artifact_dir" ]; then
for file in "$artifact_dir"/*; do
if [ -f "$file" ]; then
filename=$(basename "$file" | sed -e 's/-Release-Non-Portable//' -e 's/-Release-Portable//')
gh release upload "${{ github.event.release.tag_name }}" \
"$file" \
--clobber \
--name "$filename"
fi
done
fi
done