-
Notifications
You must be signed in to change notification settings - Fork 226
403 lines (381 loc) · 15.5 KB
/
Copy pathreleases.yml
File metadata and controls
403 lines (381 loc) · 15.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
on:
push:
branches: [ develop ]
workflow_dispatch:
inputs:
tag:
description: 'Tag for the new release. Use semantic versioning e.g. v1.0.0. Leave empty to only update the nightly build.'
type: string
required: false
default: ''
prerelease:
description: 'Set as a pre-release.'
type: boolean
required: false
default: false
makeLatest:
description: 'Set as the latest release.'
type: boolean
required: false
default: true
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: ''
permissions:
checks: write
contents: write
name: releases
jobs:
tag:
name: prepare tag
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
outputs:
version: ${{ env.version }}
buildTime: ${{ env.buildTime }}
#previousTag: ${{ steps.previousTag.outputs.tag }}
steps:
- uses: actions/checkout@v6
#- name: Get previous tag
# id: previousTag
# uses: actions-ecosystem/action-get-latest-tag@v1
# with:
# semver_only: true
- name: Set version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
else
echo "version=nightly" >> $GITHUB_ENV
fi
echo "buildTime=$(date '+%Y.%m.%d')" >> $GITHUB_ENV
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
runs-on: ${{ matrix.cfg.os }}
steps:
- uses: actions/checkout@v6
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v5
with:
go-version: ~1.20
#go-version-file: go.mod
#cache-key-suffix: -ikemen
- 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
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: Build (POSIX)
if: ${{ runner.os != 'Windows' }}
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 (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 == 'windows' }}
id: artifacts_ffmpeg
shell: bash
run: |
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
id: artifacts
shell: bash
run: |
echo "Preparing files for deployment"
mkdir -p deploy
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-Elecbyte-Screenpack.git
cp -r data font external \
Ikemen_GO-Elecbyte-Screenpack/chars \
Ikemen_GO-Elecbyte-Screenpack/data \
Ikemen_GO-Elecbyte-Screenpack/font \
Ikemen_GO-Elecbyte-Screenpack/sound \
Ikemen_GO-Elecbyte-Screenpack/stages \
Ikemen_GO-Elecbyte-Screenpack/video \
deploy/
# 3) Include readme
cp README.md deploy/
# 4) Build a single LICENSES.txt dynamically
{
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-Elecbyte-Screenpack/LICENCE.txt:"
echo
cat Ikemen_GO-Elecbyte-Screenpack/LICENCE.txt
echo
echo "Note: Some assets in the engine repo are under CC-BY 3.0 as noted in the MIT section above."
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 FFmpeg shared libraries are included in this archive so the app runs out of the box."
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 (from FFmpeg/COPYING.LGPLv2.1):"
echo "----------------------------------------------------------------"
cat build/ffmpeg-src/COPYING.LGPLv2.1
echo
echo "3.2 FFmpeg LICENSE.md:"
echo "----------------------"
cat build/ffmpeg-src/LICENSE.md
echo
echo "3.3 FFmpeg CREDITS:"
echo "-------------------"
cat build/ffmpeg-src/CREDITS
echo
echo "3.4 FFmpeg shared objects shipped in this archive:"
echo "-----------------------------------------------"
if [ "$RUNNER_OS" = "Windows" ]; then
( cd deploy/lib 2>/dev/null && ls -1 *.dll 2>/dev/null || true )
elif [ "$RUNNER_OS" = "Linux" ]; then
( cd deploy/lib 2>/dev/null && ls -1 *.so* 2>/dev/null || true )
else
( cd deploy/I.K.E.M.E.N-Go.app/Contents/Frameworks 2>/dev/null && ls -1 *.dylib 2>/dev/null || true )
fi
echo
echo "Section 4: libxmp and Notices"
echo "-----------------------------"
echo "This program dynamically links libxmp for module music playback."
echo "Upstream: https://github.com/libxmp/libxmp"
echo
echo "libxmp LICENSE (fetched from upstream README at build time):"
echo "-----------------------------------------------------------"
set -o pipefail
curl -fsSL https://raw.githubusercontent.com/libxmp/libxmp/master/README | awk '/^LICENSE$/{p=1} p'
echo
echo "Section 5: SDL2 and Notices"
echo "---------------------------"
echo "This program uses SDL2 for windowing, input, controller support."
echo "Upstream: https://github.com/libsdl-org/SDL"
echo
echo "SDL2 LICENSE (zlib, fetched from upstream LICENSE.txt):"
echo "-------------------------------------------------------"
curl -fsSL https://raw.githubusercontent.com/libsdl-org/SDL/main/LICENSE.txt
echo
} > deploy/LICENSES.txt
# 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 [ "${{ github.event.inputs.tag }}" = "" ]; 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.version }}-${{ 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: Update dev release
if: "${{ github.event.inputs.tag == '' }}"
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.IKEMEN_TOKEN }}
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "${{ steps.artifacts.outputs.artifact }},${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}"
body: |
The nightly release, or more precisely, the latest development version, is generated after each commit and always represents the most up-to-date iteration of the source code. It features the newest development version of the engine and screenpack files, making it ready for testing straightaway. Using it can eliminate the need to compile the source code for the latest, cutting-edge updates. However, as a consequence, it may sometimes contain regressions that were not yet discovered and/or outpace the documentation that corresponds to stable releases with version numbers like v x.x.x.
discussionCategory: ""
draft: false
generateReleaseNotes: false
makeLatest: false
name: nightly
omitBody: false
omitBodyDuringUpdate: false
omitDraftDuringUpdate: true
omitName: false
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
prerelease: true
removeArtifacts: false
replacesArtifacts: true
skipIfReleaseExists: false
tag: nightly
updateOnlyUnreleased: false
- name: Create Release
if: "${{ github.event.inputs.tag != '' }}"
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.IKEMEN_TOKEN }}
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "${{ steps.artifacts.outputs.artifact }},${{ steps.artifacts_ffmpeg.outputs.artifact_ffsrc }}"
# body: |
# ${{ needs.tag.outputs.changelog }}
discussionCategory: ${{ github.event.inputs.discussionCategory }}
draft: ${{ github.event.inputs.draft }}
generateReleaseNotes: true
makeLatest: ${{ github.event.inputs.makeLatest }}
name: ${{ needs.tag.outputs.version }}
omitBody: false
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitName: false
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
prerelease: ${{ github.event.inputs.prerelease }}
removeArtifacts: false
replacesArtifacts: true
skipIfReleaseExists: false
tag: ${{ needs.tag.outputs.version }}
updateOnlyUnreleased: false