forked from RSDKModding/RSDKv5-Decompilation
-
Notifications
You must be signed in to change notification settings - Fork 6
173 lines (170 loc) · 6.97 KB
/
build.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
name: Build RSDKv5
on:
push:
branches:
- master
env:
GENERAL_FLAGS: "-DRETRO_DISABLE_PLUS=ON -DCMAKE_BUILD_TYPE=Release"
V5_FLAGS: "-DRETRO_REVISION=2"
V5U_FLAGS: "-DRETRO_REVISION=3"
# Normally you would use $VCPKG_INSTALLATION_PATH, but it's broken...so hardcode C:/vcpkg
GENERAL_WIN_FLAGS: "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
WIN32_FLAGS: "-DVCPKG_TARGET_TRIPLET=x86-windows-static -A Win32"
WIN64_FLAGS: "-DVCPKG_TARGET_TRIPLET=x64-windows-static"
# FIXME: For some reason ubuntu enables _FORTIFY_SOURCE by default, so let's override it to prevent IO bugs
GENERAL_LINUX_FLAGS: "-DCMAKE_CXX_FLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0'"
jobs:
v5-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: vcpkg install libtheora libogg --triplet=x86-windows-static
- name: Build RSDKv5 + U
run: |
cmake -B build_v5 ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN32_FLAGS}} ${{env.V5_FLAGS}}
cmake --build build_v5 --parallel --config Release
cmake -B build_v5U ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN32_FLAGS}} ${{env.V5U_FLAGS}}
cmake --build build_v5U --parallel --config Release
- name: Move artifacts
run: |
mkdir artifacts
mv ./build_*/Release/*.exe ./artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: v5-windows
path: artifacts
v5-windows-x64:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: vcpkg install libtheora libogg --triplet=x64-windows-static
- name: Build RSDKv5 + U
run: |
cmake -B build_v5 ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN64_FLAGS}} ${{env.V5_FLAGS}}
cmake --build build_v5 --parallel --config Release
cmake -B build_v5U ${{env.GENERAL_FLAGS}} ${{env.GENERAL_WIN_FLAGS}} ${{env.WIN64_FLAGS}} ${{env.V5U_FLAGS}}
cmake --build build_v5U --parallel --config Release
- name: Move artifacts
run: |
mkdir artifacts
mv ./build_*/Release/*.exe ./artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: v5-windows-x64
path: artifacts
v5-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libogg-dev libtheora-dev libglew-dev libglfw3-dev
- name: Build RSDKv5 + U OGL
run: |
cmake -B build_v5 ${{env.GENERAL_FLAGS}} ${{env.GENERAL_LINUX_FLAGS}} ${{env.V5_FLAGS}}
cmake --build build_v5 --parallel
cmake -B build_v5U ${{env.GENERAL_FLAGS}} ${{env.GENERAL_LINUX_FLAGS}} ${{env.V5U_FLAGS}}
cmake --build build_v5U --parallel
# tar the executables so that they don't lose exec permissions
# see: https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- name: Move artifacts
run: |
mkdir artifacts
mv ./build_*/RSDKv5* ./artifacts
tar -czvf linux.tar.gz -C ./artifacts .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: v5-linux
path: linux.tar.gz
v5-android:
runs-on: ubuntu-latest
steps:
- name: Checkout RSDKv5
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout Sonic Mania
uses: actions/checkout@v4
with:
repository: "RSDKModding/Sonic-Mania-Decompilation"
path: "Sonic-Mania-Decompilation"
- name: Checkout Example-Mods
uses: actions/checkout@v4
with:
repository: "RSDKModding/RSDKv5-Example-Mods"
path: "RSDKv5-Example-Mods"
- name: Checkout GameAPI
uses: actions/checkout@v4
with:
repository: "RSDKModding/RSDKv5-GameAPI"
path: "RSDKv5-GameAPI"
- name: Setup RSDKv5 dependencies
working-directory: ./dependencies/android
run: |
curl -L -O https://downloads.xiph.org/releases/ogg/libogg-1.3.5.zip
curl -L -O https://downloads.xiph.org/releases/theora/libtheora-1.1.1.zip
unzip \*.zip
rm *.zip
rsync -ar libogg-*/* libogg
mv libtheora-* libtheora
- name: Setup RSDKv5 & mods symlinks
run: |
rm Game
rmdir $PWD/Sonic-Mania-Decompilation/dependencies/RSDKv5
ln -s $PWD $PWD/Sonic-Mania-Decompilation/dependencies/RSDKv5
ln -s $PWD/RSDKv5-GameAPI RSDKv5-Example-Mods/ManiaTouchControls/GameAPI
ln -s $PWD/RSDKv5-GameAPI RSDKv5-Example-Mods/UltrawideMania/GameAPI
ln -s $PWD/Sonic-Mania-Decompilation ./android/app/jni/Game
ln -s $PWD/RSDKv5-GameAPI ./android/app/jni/GameAPI
ln -s $PWD/RSDKv5-Example-Mods/ManiaTouchControls ./android/app/jni/MTC
ln -s $PWD/RSDKv5-Example-Mods/UltrawideMania ./android/app/jni/UWM
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Build Mania+RSDKv5 Android
working-directory: ./android
run: |
./gradlew assemble --no-daemon -PABIFILTERS="armeabi-v7a;arm64-v8a" -PRETRO_DISABLE_PLUS -PRETRO_REVISION=3
mv app/build/outputs/apk/release/*.apk rsdkv5u_mania.apk
./gradlew clean
./gradlew assemble --no-daemon -PABIFILTERS="armeabi-v7a;arm64-v8a" -PRETRO_DISABLE_PLUS -PRETRO_REVISION=2
mv app/build/outputs/apk/release/*.apk rsdkv5_mania.apk
- name: Bundle APK & mods
run: |
mkdir -p artifacts/mods
cp -r android/*.apk artifacts
mkdir -p artifacts/mods/MTC
cp -r android/app/jni/MTC/build/* artifacts/mods/MTC
mkdir -p artifacts/mods/UWM
cp -r android/app/jni/UWM/build/* artifacts/mods/UWM
mkdir -p artifacts/mods/GLShaders/Data/Shaders
cp -r RSDKv5/Shaders/OGL artifacts/mods/GLShaders/Data/Shaders
printf "Name=GLShaders\nDescription=OGLShaders\nAuthor=Ducky\nVersion=1.0.0\nTargetVersion=5\n" > artifacts/mods/GLShaders/mod.ini
printf "[Mods]\nMTC=y\nUWM=y\nGLShaders=y\n" > artifacts/mods/modconfig.ini
# HACK: Remove RSDKv5 symlink in Mania to prevent warning in post checkout cleanup
- name: Cleanup
run: rm $PWD/Sonic-Mania-Decompilation/dependencies/RSDKv5
- name: Upload artifact Android
uses: actions/upload-artifact@v4
with:
name: v5-android
path: artifacts