-
Notifications
You must be signed in to change notification settings - Fork 226
635 lines (576 loc) · 24.5 KB
/
Copy pathreleases.yml
File metadata and controls
635 lines (576 loc) · 24.5 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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
on:
push:
branches: [ develop, ci-test ]
workflow_dispatch:
inputs:
tag:
description: 'Version tag (e.g. v1.0.0-rc.1). Leave empty to build the selected branch; develop builds nightly.'
type: string
required: false
default: ''
draft:
description: 'Set as a draft release.'
type: boolean
required: false
default: false
discussionCategory:
description: 'When provided this will generate a discussion of the specified category, e.g. Announcements.'
type: string
required: false
default: ''
buildAndroidApk:
description: 'Build Android APK.'
type: boolean
required: false
default: true
permissions:
contents: write
name: releases
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
cancel-in-progress: true
jobs:
tag:
name: prepare tag
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
releaseTag: ${{ steps.meta.outputs.releaseTag }}
releaseKind: ${{ steps.meta.outputs.releaseKind }}
artifactVersion: ${{ steps.meta.outputs.artifactVersion }}
prerelease: ${{ steps.meta.outputs.prerelease }}
makeLatest: ${{ steps.meta.outputs.makeLatest }}
previousTag: ${{ steps.meta.outputs.previousTag }}
buildTime: ${{ steps.meta.outputs.buildTime }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.sha }}
fetch-depth: 0
- name: Set version
id: meta
shell: bash
env:
INPUT_TAG: ${{ github.event.inputs.tag }}
run: |
set -euo pipefail
ref_name="$GITHUB_REF_NAME"
input_tag="${INPUT_TAG:-}"
previous_tag=""
if [ -n "$input_tag" ]; then
tag_pattern='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc\.([1-9][0-9]*))?$'
if [[ ! "$input_tag" =~ $tag_pattern ]]; then
echo "Invalid release tag: $input_tag" >&2
echo "Use vX.Y.Z or vX.Y.Z-rc.N." >&2
exit 1
fi
release_major="${BASH_REMATCH[1]}"
release_minor="${BASH_REMATCH[2]}"
release_patch="${BASH_REMATCH[3]}"
release_branch="release/${release_major}.${release_minor}"
if [ "$ref_name" != "$release_branch" ]; then
echo "Run $input_tag from the $release_branch branch." >&2
exit 1
fi
if git ls-remote --exit-code --tags origin "refs/tags/$input_tag" >/dev/null 2>&1; then
echo "Tag $input_tag already exists and will not be replaced." >&2
exit 1
fi
git fetch --force --tags origin
latest_stable="$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -Ev -- '-' | sed -n '1p' || true)"
if [[ "$input_tag" == *-rc.* ]]; then
base_tag="${input_tag%-rc.*}"
previous_tag="$(git tag --list "${base_tag}-rc.*" --sort=-v:refname | sed -n '1p')"
fi
if [ -z "$previous_tag" ]; then
stable_pattern='v[0-9]*.[0-9]*.[0-9]*'
if [ "$release_patch" -gt 0 ]; then
stable_pattern="v${release_major}.${release_minor}.*"
fi
previous_tag="$(git tag --list "$stable_pattern" --sort=-v:refname | grep -Ev -- '-' | sed -n '1p' || true)"
fi
version="$input_tag"
release_tag="$input_tag"
artifact_version="$input_tag"
release_kind="tagged"
if [[ "$input_tag" == *-rc.* ]]; then
prerelease="true"
make_latest="false"
else
prerelease="false"
if [ -z "$latest_stable" ] || [ "$(printf '%s\n%s\n' "$latest_stable" "$input_tag" | sort -V | sed -n '$p')" = "$input_tag" ]; then
make_latest="true"
else
make_latest="false"
fi
fi
elif [ "$ref_name" = "ci-test" ]; then
version="ci-test"
release_tag="ci-test"
artifact_version="ci-test"
release_kind="ci-test"
prerelease="true"
make_latest="false"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && \
[ "$ref_name" != "develop" ]; then
version="$ref_name"
release_tag="$ref_name"
artifact_version="$(printf '%s' "$ref_name" | sed 's#[^A-Za-z0-9._-]#-#g')"
release_kind="branch"
prerelease="true"
make_latest="false"
else
version="nightly"
release_tag="nightly"
artifact_version="nightly"
release_kind="nightly"
prerelease="false"
make_latest="true"
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "releaseTag=$release_tag" >> "$GITHUB_OUTPUT"
echo "releaseKind=$release_kind" >> "$GITHUB_OUTPUT"
echo "artifactVersion=$artifact_version" >> "$GITHUB_OUTPUT"
echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT"
echo "makeLatest=$make_latest" >> "$GITHUB_OUTPUT"
echo "previousTag=$previous_tag" >> "$GITHUB_OUTPUT"
echo "buildTime=$(date -u '+%Y.%m.%d')" >> "$GITHUB_OUTPUT"
build:
name: prepare release
if: ${{ github.actor != 'dependabot[bot]' }}
needs: tag
strategy:
matrix:
cfg:
- runner_os: windows
os: windows-2022
goos: windows
goarch: amd64
bin: Ikemen_GO.exe
glibc: ''
target: ''
build_target: Win64
- runner_os: linux
os: ubuntu-22.04
goos: linux
goarch: amd64
bin: Ikemen_GO_Linux
glibc: '2.13'
target: ''
build_target: Linux
- runner_os: macos
os: macos-14 # macos-13
goos: darwin
goarch: arm64 # amd64
bin: Ikemen_GO_MacOSARM # Ikemen_GO_MacOS
glibc: ''
target: '10.7'
build_target: MacOSARM # MacOS
- runner_os: android
os: ubuntu-22.04
goos: android
goarch: arm64
bin: ikemen-go.apk
glibc: ''
target: ''
build_target: Android
runs-on: ${{ matrix.cfg.os }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.sha }}
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version: '1.20.x'
cache: true
cache-dependency-path: |
go.sum
**/go.sum
- name: Setup MSYS2 (Windows)
if: ${{ matrix.cfg.runner_os == 'windows' }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
path-type: inherit
install: >-
git
make
diffutils
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-bzip2
mingw-w64-x86_64-nasm
mingw-w64-x86_64-tools-git
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-yasm
mingw-w64-x86_64-libxmp
- name: Prepare Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.1
with:
vulkan-query-version: 1.4.304.1
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Install dependencies
if: ${{ matrix.cfg.runner_os != 'android' }}
shell: bash
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libasound2-dev libgl1-mesa-dev xorg-dev libgtk-3-dev \
build-essential pkg-config git yasm nasm curl ca-certificates libxmp-dev libsdl2-dev
fi
if [ "$RUNNER_OS" = "macOS" ]; then
# Avoid update, disable analytics, prefer taps over API, and retry.
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_FROM_API=1
brew update-reset || true
( brew install --quiet pkg-config git nasm libxmp sdl2 molten-vk ) || (
echo "First attempt failed; retrying with API mode..." >&2
unset HOMEBREW_NO_INSTALL_FROM_API
brew install --quiet pkg-config git nasm libxmp sdl2 molten-vk
)
fi
- name: Generate LICENSES.txt
shell: bash
run: |
set -euo pipefail
# One LICENSES.txt for ALL platforms (including Android).
# Must exist BEFORE Android Docker Compose runs so it is visible in the bind-mounted workspace.
FFMPEG_REV="${FFMPEG_REV:-release/7.1}"
SCREENPACK_LIC="https://raw.githubusercontent.com/ikemen-engine/Ikemen-GO-Screenpack/master/LICENCE.txt"
FFMPEG_LGPL="https://raw.githubusercontent.com/FFmpeg/FFmpeg/${FFMPEG_REV}/COPYING.LGPLv2.1"
FFMPEG_LICENSE_MD="https://raw.githubusercontent.com/FFmpeg/FFmpeg/${FFMPEG_REV}/LICENSE.md"
FFMPEG_CREDITS="https://raw.githubusercontent.com/FFmpeg/FFmpeg/${FFMPEG_REV}/CREDITS"
LIBXMP_README="https://raw.githubusercontent.com/libxmp/libxmp/master/README"
SDL2_LICENSE="https://raw.githubusercontent.com/libsdl-org/SDL/main/LICENSE.txt"
{
echo "============================="
echo " Ikemen GO - LICENSES.txt"
echo "============================="
echo
echo "Section 1: Ikemen GO (MIT)"
echo "--------------------------"
cat LICENCE.txt
echo
echo "Section 2: Bundled Assets (Creative Commons)"
echo "-------------------------------------------"
echo "Screenpack license from Ikemen-GO-Screenpack/LICENCE.txt:"
echo
curl -fsSL "$SCREENPACK_LIC"
echo
echo "Section 3: FFmpeg (LGPL v2.1) and Notices"
echo "-----------------------------------------"
echo "This program dynamically links FFmpeg under the GNU Lesser General Public License v2.1."
echo "The exact corresponding FFmpeg source is attached to the release page as:"
echo " src_ffmpeg.tar.gz"
echo
echo "3.1 Full LGPL v2.1 license text:"
echo "--------------------------------"
curl -fsSL "$FFMPEG_LGPL"
echo
echo "3.2 FFmpeg LICENSE.md:"
echo "----------------------"
curl -fsSL "$FFMPEG_LICENSE_MD"
echo
echo "3.3 FFmpeg CREDITS:"
echo "-------------------"
curl -fsSL "$FFMPEG_CREDITS"
echo
echo "Section 4: libxmp and Notices"
echo "-----------------------------"
echo "Upstream: https://github.com/libxmp/libxmp"
echo
echo "libxmp README (contains license info):"
echo "-------------------------------------"
curl -fsSL "$LIBXMP_README"
echo
echo "Section 5: SDL2 and Notices"
echo "---------------------------"
echo "Upstream: https://github.com/libsdl-org/SDL"
echo
echo "SDL2 LICENSE (zlib):"
echo "--------------------"
curl -fsSL "$SDL2_LICENSE"
echo
} > LICENSES.txt
- name: Build (POSIX)
if: ${{ runner.os != 'Windows' && matrix.cfg.runner_os != 'android' }}
shell: bash
env:
BUILD_FFMPEG: "yes"
GOOS: ${{ matrix.cfg.goos }}
GOARCH: ${{ matrix.cfg.goarch }}
CGO_ENABLED: "1"
GOEXPERIMENT: "arenas"
APP_VERSION: ${{ needs.tag.outputs.version }}
APP_BUILDTIME: ${{ needs.tag.outputs.buildTime }}
run: |
go env -w GO111MODULE=on
go mod download
./build/build.sh ${{ matrix.cfg.build_target }}
if [ "$RUNNER_OS" = "macOS" ]; then
make appbundle BINNAME=bin/${{ matrix.cfg.bin }}
fi
- name: Build Android (Docker Compose)
if: ${{ matrix.cfg.runner_os == 'android' && (github.event_name != 'workflow_dispatch' || github.event.inputs.buildAndroidApk != 'false') }}
shell: bash
env:
# Build APK is optional but enabled by default. If disabled, we skip this entire step.
BUILD_ANDROID_APK: ${{ (github.event_name != 'workflow_dispatch' || github.event.inputs.buildAndroidApk != 'false') && '1' || '0' }}
APP_VERSION: ${{ needs.tag.outputs.version }}
APP_BUILDTIME: ${{ needs.tag.outputs.buildTime }}
run: |
set -euo pipefail
echo "==> Docker sanity:"
docker version
docker compose version
echo
echo "==> Building Android (APK via Docker Compose)..."
chmod +x build/build_android.sh
./build/build_android.sh
echo
echo "==> Outputs:"
ls -lah bin/ lib/ || true
test -f bin/libmain.so
test -f bin/ikemen-go.apk
- name: Build (MSYS2)
if: ${{ runner.os == 'Windows' }}
shell: 'msys2 {0}'
env:
BUILD_FFMPEG: "yes"
GOOS: ${{ matrix.cfg.goos }}
GOARCH: ${{ matrix.cfg.goarch }}
CGO_ENABLED: "1"
GOEXPERIMENT: "arenas"
APP_VERSION: ${{ needs.tag.outputs.version }}
APP_BUILDTIME: ${{ needs.tag.outputs.buildTime }}
run: |
go env -w GO111MODULE=on
go mod download
./build/build.sh ${{ matrix.cfg.build_target }}
- name: Prepare FFmpeg artifacts
if: ${{ matrix.cfg.runner_os == 'linux' }}
id: artifacts_ffmpeg
shell: bash
run: |
# Android build runs in Docker and may create root-owned git dirs; allow them.
git config --global --add safe.directory "$GITHUB_WORKSPACE/build/ffmpeg-src" >/dev/null 2>&1 || true
mkdir -p FFmpeg-CS
# Export the *exact* tree
( cd build/ffmpeg-src && git archive --format=tar HEAD ) | tar -x -C FFmpeg-CS
cp build/ffmpeg-src/config.h FFmpeg-CS/ 2>/dev/null || true
cp build/ffmpeg-src/config.log FFmpeg-CS/ 2>/dev/null || true
cp build/ffmpeg-src/BUILDINFO.txt FFmpeg-CS/ 2>/dev/null || true
tar -czf "src_ffmpeg.tar.gz" FFmpeg-CS
echo "artifact_ffsrc=src_ffmpeg.tar.gz" >> "$GITHUB_OUTPUT"
- name: Prepare release artifacts
if: ${{ matrix.cfg.runner_os != 'android' || (github.event_name != 'workflow_dispatch' || github.event.inputs.buildAndroidApk != 'false') }}
id: artifacts
shell: bash
run: |
echo "Preparing files for deployment"
mkdir -p deploy
if [ "${{ matrix.cfg.runner_os }}" = "android" ]; then
echo "==> Preparing Android release artifact"
mkdir -p deploy/lib
cp -av bin/ikemen-go.apk deploy/ || true
cp -av bin/libmain.so bin/libmain.h deploy/ 2>/dev/null || true
cp -av lib/*.so* deploy/lib/ 2>/dev/null || true
cp README.md deploy/ 2>/dev/null || true
cp -av LICENSES.txt deploy/ 2>/dev/null || true
cd deploy
if [ "${{ needs.tag.outputs.releaseKind }}" = "nightly" ]; then
ARTIFACT_NAME=Ikemen_GO-dev-android.zip
echo "artifact=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
else
ARTIFACT_NAME=Ikemen_GO-${{ needs.tag.outputs.artifactVersion }}-android.zip
echo "artifact=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
fi
zip -r ../$ARTIFACT_NAME *
echo "Successfully prepared Android assets for deployment"
exit 0
fi
mkdir -p deploy/data
# 1) Put binary and shared libs generated by build.sh
if [ "$RUNNER_OS" = "macOS" ]; then
cp -r I.K.E.M.E.N-Go.app deploy/
mkdir -p deploy/I.K.E.M.E.N-Go.app/Contents/Frameworks
if ls lib/*.dylib >/dev/null 2>&1; then
cp -av lib/*.dylib deploy/I.K.E.M.E.N-Go.app/Contents/Frameworks/ 2>/dev/null || true
fi
else
cp "./${{ matrix.cfg.bin }}" deploy/
mkdir -p deploy/lib
cp -r lib/* deploy/lib/ 2>/dev/null || true
fi
# 2) Bring in runtime assets
git clone https://github.com/ikemen-engine/Ikemen-GO-Screenpack.git
cp -r data font external \
Ikemen-GO-Screenpack/chars \
Ikemen-GO-Screenpack/data \
Ikemen-GO-Screenpack/font \
Ikemen-GO-Screenpack/sound \
Ikemen-GO-Screenpack/stages \
Ikemen-GO-Screenpack/video \
deploy/
# 3) Include readme
cp README.md deploy/
# 4) Single LICENSES.txt
cp -av LICENSES.txt deploy/ 2>/dev/null || true
# 5) Extra runtime db
GAMEPAD_DB_URL="https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt"
echo "Downloading SDL GameController DB..."
curl -L "$GAMEPAD_DB_URL" -o deploy/external/gamecontrollerdb.txt
# 6) system.base.def
cp src/resources/defaultMotif.ini deploy/data/system.base.def
# 7) Archive
echo "Zipping deploy directory"
cd deploy
# Linux desktop integration: ship .desktop + 256px icon
if [ "$RUNNER_OS" = "Linux" ]; then
#mkdir -p icons/hicolor/256x256/apps
#cp ../external/icons/IkemenCylia_256.png icons/hicolor/256x256/apps/ikemen-go.png
cp ../external/icons/IkemenCylia_256.png ikemen-go.png
cat > Ikemen_GO.desktop <<'EOF'
[Desktop Entry]
Name=Ikemen GO
Comment=An open-source fighting game engine
TryExec=Ikemen_GO_Linux
Exec=./Ikemen_GO_Linux
Icon=ikemen-go.png
Terminal=false
Type=Application
Categories=Game;ArcadeGame;
EOF
fi
if [ "${{ needs.tag.outputs.releaseKind }}" = "nightly" ]; then
ARTIFACT_NAME=Ikemen_GO-dev-${{ matrix.cfg.runner_os }}.zip
echo "artifact=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
else
ARTIFACT_NAME=Ikemen_GO-${{ needs.tag.outputs.artifactVersion }}-${{ matrix.cfg.runner_os }}.zip
echo "artifact=$ARTIFACT_NAME" >> "$GITHUB_OUTPUT"
fi
if [ "$RUNNER_OS" = "Windows" ]; then
"/c/Program Files/7-Zip/7z.exe" a ../$ARTIFACT_NAME *
else
cp ../build/Ikemen_GO.command .
zip -r ../$ARTIFACT_NAME *
fi
echo "Successfully prepared assets for deployment"
- name: Stage release artifacts
if: ${{ steps.artifacts.outputs.artifact != '' }}
shell: bash
run: |
set -euo pipefail
mkdir -p release-files
cp -v "${{ steps.artifacts.outputs.artifact }}" release-files/
if [ "${{ matrix.cfg.runner_os }}" = "linux" ] && \
[ -n "${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}" ]; then
cp -v "${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}" release-files/
fi
- name: Upload release artifacts
if: ${{ steps.artifacts.outputs.artifact != '' }}
uses: actions/upload-artifact@v7
with:
name: release-${{ matrix.cfg.runner_os }}
path: release-files/*
if-no-files-found: error
release:
name: publish release
if: ${{ github.actor != 'dependabot[bot]' }}
needs: [tag, build]
runs-on: ubuntu-latest
steps:
- name: Check out source for rolling tag update
if: ${{ needs.tag.outputs.releaseKind == 'nightly' || needs.tag.outputs.releaseKind == 'ci-test' }}
uses: actions/checkout@v7
with:
ref: ${{ github.sha }}
fetch-depth: 0
path: source
- name: Download release artifacts
uses: actions/download-artifact@v8
with:
pattern: release-*
path: release-assets
merge-multiple: true
- name: List release artifacts
shell: bash
run: |
set -euo pipefail
find release-assets -maxdepth 1 -type f -print -exec ls -lh {} \;
- name: Generate checksums
shell: bash
run: |
set -euo pipefail
(cd release-assets && sha256sum * > SHA256SUMS.txt)
- name: Move rolling tag to this commit
if: ${{ needs.tag.outputs.releaseKind == 'nightly' || needs.tag.outputs.releaseKind == 'ci-test' }}
working-directory: source
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
tag="${{ needs.tag.outputs.releaseTag }}"
git fetch --force --tags origin
git tag -fa "$tag" "$GITHUB_SHA" -m "$tag: $GITHUB_SHA"
git push --force origin "refs/tags/$tag:refs/tags/$tag"
- name: Recreate rolling release metadata
if: ${{ needs.tag.outputs.releaseKind == 'nightly' || needs.tag.outputs.releaseKind == 'ci-test' }}
shell: bash
env:
GH_TOKEN: ${{ secrets.IKEMEN_TOKEN }}
run: |
set -euo pipefail
# The rolling tag has already been force-moved after all builds succeeded.
# Delete only the GitHub Release object so it is recreated with fresh metadata.
# Do not use --cleanup-tag, because that would delete the moved tag too.
tag="${{ needs.tag.outputs.releaseTag }}"
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release delete "$tag" --repo "$GITHUB_REPOSITORY" --yes
fi
- name: Prepare nightly release notes
if: ${{ needs.tag.outputs.releaseKind == 'nightly' }}
shell: bash
run: |
cat > nightly-release.md <<'EOF'
The nightly release is generated after each commit to `develop` and contains the newest engine and screenpack files. It is intended for testing and may contain regressions or changes not yet covered by the stable documentation.
EOF
- name: Publish release
uses: ncipollo/release-action@v1.21.0
with:
token: ${{ secrets.IKEMEN_TOKEN }}
artifactErrorsFailBuild: true
artifacts: "release-assets/*"
commit: ${{ github.sha }}
tag: ${{ needs.tag.outputs.releaseTag }}
name: ${{ needs.tag.outputs.releaseTag }}
# Rolling and temporary releases may be updated.
# Tagged RC/stable releases are immutable.
allowUpdates: ${{ needs.tag.outputs.releaseKind != 'tagged' }}
replacesArtifacts: ${{ needs.tag.outputs.releaseKind != 'tagged' }}
immutableCreate: ${{ needs.tag.outputs.releaseKind == 'tagged' && !inputs.draft }}
prerelease: ${{ needs.tag.outputs.prerelease }}
makeLatest: ${{ needs.tag.outputs.makeLatest }}
# Only tagged releases receive automatically generated notes.
generateReleaseNotes: ${{ needs.tag.outputs.releaseKind == 'tagged' }}
generateReleaseNotesPreviousTag: ${{ needs.tag.outputs.previousTag }}
# Only rolling releases use the prepared custom body.
bodyFile: ${{ needs.tag.outputs.releaseKind == 'nightly' && 'nightly-release.md' || '' }}
# These settings apply only to manually dispatched temporary or
# versioned releases. They evaluate to empty/false for rolling builds.
discussionCategory: ${{ (needs.tag.outputs.releaseKind == 'branch' || needs.tag.outputs.releaseKind == 'tagged') && inputs.discussionCategory || '' }}
draft: ${{ (needs.tag.outputs.releaseKind == 'branch' || needs.tag.outputs.releaseKind == 'tagged') && inputs.draft }}
# Preserve manually edited rolling/temporary release metadata when
# updating an existing release.
omitBodyDuringUpdate: ${{ needs.tag.outputs.releaseKind == 'branch' }}
omitDraftDuringUpdate: ${{ needs.tag.outputs.releaseKind != 'tagged' }}
omitNameDuringUpdate: ${{ needs.tag.outputs.releaseKind != 'tagged' }}
omitPrereleaseDuringUpdate: ${{ needs.tag.outputs.releaseKind != 'tagged' }}
removeArtifacts: false
skipIfReleaseExists: false
updateOnlyUnreleased: false