-
Notifications
You must be signed in to change notification settings - Fork 14
313 lines (278 loc) · 11.1 KB
/
build_all.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
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
name: Build
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
env:
BASE_BRANCH: ci
WWISE_VERSION: "2023.1.0"
GODOT_ENGINE_VERSION: "4.1.3"
GODOT_ENGINE_STAGE: "stable"
INTEGRATION_VERSION: "2.0.3"
jobs:
build-all:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows
os: "windows-2019"
sdk-platform: windows
scons-platform: windows
release-flags: use_static_cpp=true
artifact-name: windows
- name: macOS
os: "macos-11"
sdk-platform: mac
scons-platform: macos
artifact-name: macos
- name: Linux
os: "ubuntu-20.04"
sdk-platform: linux
scons-platform: linux
artifact-name: linux
- name: iOS
os: "macos-11"
sdk-platform: ios
scons-platform: ios
debug-flags: arch=arm64 ios_min_version=11.0
release-flags: arch=arm64 ios_min_version=11.0
artifact-name: ios
- name: Android
os: "ubuntu-20.04"
sdk-platform: android
scons-platform: android
debug-flags-arm64: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64
release-flags-arm64: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64
debug-flags-arm32: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm32
release-flags-arm32: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm32
artifact-name: android-lib
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup java
uses: actions/setup-java@v3
if: matrix.sdk-platform == 'android'
with:
distribution: 'temurin'
java-version: '17'
- name: Android dependencies
if: matrix.sdk-platform == 'android'
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true
- name: Wwise SDK cache
id: cache-wwise-sdk
uses: actions/cache@v3
env:
cache-name: cache-wwise-sdk
with:
path: addons/Wwise/native/wwise_sdk
key: ${{ matrix.sdk-platform }}-build-${{ env.cache-name }}-${{ env.WWISE_VERSION }}
# - name: Load .scons_cache directory
# id: cache-godot-extension
# uses: actions/cache@v3
# with:
# path: ${{github.workspace}}/.scons_cache/
# key: ${{matrix.sdk-platform}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
# restore-keys: |
# ${{matrix.sdk-platform}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
# ${{matrix.sdk-platform}}-${{env.BASE_BRANCH}}-${{github.ref}}
# ${{matrix.sdk-platform}}-${{env.BASE_BRANCH}}
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: "3.x"
architecture: "x64"
- name: Set up dependencies (Python, SCons)
run: python -m pip install scons
- name: Set up Windows dependencies
if: runner.os == 'Windows'
run: |
choco install 7zip -y
- name: Set up Linux dependencies
if: runner.os == 'Linux' && matrix.sdk-platform == 'linux'
run: |
sudo apt-get install build-essential pkg-config libx11-dev \
yasm zip unzip p7zip-full p7zip-rar
- name: Download Wwise SDK (Base)
uses: suisei-cn/actions-download-file@v1.4.0
if: steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/xlrcmxbmxsmy58tp33uiw/wwise_sdk_2023.1.0_base.zip?rlkey=30ut2n1g1bi5dp33y923epsbd&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Download Wwise SDK (Windows)
uses: suisei-cn/actions-download-file@v1.4.0
if: runner.os == 'Windows' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/kt51rpzdbvgzt6wsnclhe/wwise_sdk_2023.1.0_win.zip?rlkey=ossw4of3bxjat6fbempev6jbr&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Download Wwise SDK (macOS)
uses: suisei-cn/actions-download-file@v1.4.0
if: runner.os == 'MacOS' && matrix.sdk-platform == 'mac' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/97zus2pl7btnua0s5dhw1/wwise_sdk_2023.1.0_mac.zip?rlkey=v4io943jvor5ovbw7x6n5p6gm&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Download Wwise SDK (Linux)
uses: suisei-cn/actions-download-file@v1.4.0
if: runner.os == 'Linux' && matrix.sdk-platform == 'linux' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/76dgnud1pg6bbctiruiy4/wwise_sdk_2023.1.0_linux.zip?rlkey=8oimalx8sj8klaze2hl35pbha&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Download Wwise SDK (iOS)
uses: suisei-cn/actions-download-file@v1.4.0
if: runner.os == 'MacOS' && matrix.sdk-platform == 'ios' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/p0jknjqz3ahw4myzq5y1g/wwise_sdk_2023.1.0_ios.zip?rlkey=ybyvp3bavmh6h2r6csftsmtep&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Download Wwise SDK (Android)
uses: suisei-cn/actions-download-file@v1.4.0
if: runner.os == 'Linux' && matrix.sdk-platform == 'android' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
with:
url: "https://www.dropbox.com/scl/fi/0armk45ync2ijvrq5epgq/wwise_sdk_2023.1.0_android.zip?rlkey=twmaw7gc39bytxgenuc8baqml&dl=1"
target: ./addons/Wwise/native/wwise_sdk/
- name: Unzip SDK (Windows)
if: runner.os == 'Windows' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
run: |
cd ./addons/Wwise/native/wwise_sdk
7z x wwise_sdk_2023.1.0_base.zip
7z x wwise_sdk_2023.1.0_win.zip
cd ../../../../
- name: Unzip SDK (macOS)
if: runner.os == 'MacOS' && matrix.sdk-platform == 'mac' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
run: |
cd ./addons/Wwise/native/wwise_sdk
7z x wwise_sdk_2023.1.0_base.zip
7z x wwise_sdk_2023.1.0_mac.zip
cd ../../../../
- name: Unzip SDK (Linux)
if: runner.os == 'Linux' && matrix.sdk-platform == 'linux' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
run: |
cd ./addons/Wwise/native/wwise_sdk
7z x wwise_sdk_2023.1.0_base.zip
7z x wwise_sdk_2023.1.0_linux.zip
cd ../../../../
- name: Unzip SDK (iOS)
if: runner.os == 'MacOS' && matrix.sdk-platform == 'ios' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
run: |
cd ./addons/Wwise/native/wwise_sdk
7z x wwise_sdk_2023.1.0_base.zip
7z x wwise_sdk_2023.1.0_ios.zip
cd ../../../../
- name: Unzip SDK (Android)
if: runner.os == 'Linux' && matrix.sdk-platform == 'android' && steps.cache-wwise-sdk.outputs.cache-hit != 'true'
run: |
cd ./addons/Wwise/native/wwise_sdk
7z x wwise_sdk_2023.1.0_base.zip
7z x wwise_sdk_2023.1.0_android.zip
cd ../../../../
- name: Compile Debug library
if: matrix.sdk-platform != 'android'
shell: bash
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
SCONS_CACHE_LIMIT: 7168
run: |
cd addons/Wwise/native
mkdir -p godot-cpp/bin
scons platform=${{ matrix.scons-platform }} target=template_debug dev_build=yes asserts=true wwise_sdk=wwise_sdk -j6 ${{ matrix.debug-flags }}
cd ../../../
- name: Compile Release library
if: matrix.sdk-platform != 'android'
shell: bash
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
SCONS_CACHE_LIMIT: 7168
run: |
cd addons/Wwise/native
scons platform=${{ matrix.scons-platform }} target=template_release wwise_sdk=wwise_sdk -j6 ${{ matrix.release-flags }}
cd ../../../
- name: Compile Android libraries
if: matrix.sdk-platform == 'android'
shell: bash
run: |
cd addons/Wwise/native/wwise_sdk
WWISESDK=$(pwd)
cd ../godot-cpp
mkdir -p bin
scons platform=android target=template_debug dev_build=yes -j6 ${{ matrix.debug-flags-arm64 }}
scons platform=android target=template_debug dev_build=yes -j6 ${{ matrix.debug-flags-arm32 }}
scons platform=android target=template_release -j6 ${{ matrix.release-flags-arm64 }}
scons platform=android target=template_release -j6 ${{ matrix.release-flags-arm32 }}
cd ../android
chmod +x ./gradlew
./gradlew assemble -PWWISE_SDK="$WWISESDK"
- name: Upload libs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: addons/Wwise/native/lib
upload-addon:
runs-on: "ubuntu-20.04"
needs: [build-all]
name: Addon
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download all libs
uses: actions/download-artifact@v3
- name: Assemble all artifacts
run: |
ls
shopt -s dotglob
if [ ! -d "addons/Wwise/native/lib" ]; then
mkdir -p addons/Wwise/native/lib
fi
if [ -d windows ]; then
mv windows/* addons/Wwise/native/lib/
rm -r windows
fi
if [ -d macos ]; then
mv macos/* addons/Wwise/native/lib/
rm -r macos
fi
if [ -d linux ]; then
mv linux/* addons/Wwise/native/lib/
rm -r linux
fi
if [ -d android-lib ]; then
mv android-lib/* addons/Wwise/native/lib/
rm -r android-lib
fi
if [ -d ios ]; then
mv ios/* addons/Wwise/native/lib/
rm -r ios
fi
- name: Clean up addon
run: |
rm -r ./addons/Wwise/native/godot-cpp
rm -r ./addons/Wwise/native/src
rm -r ./addons/Wwise/native/vs2022
rm -r ./addons/Wwise/native/android
rm ./addons/Wwise/native/SConstruct
rm ./LICENSE
rm ./README.md
rm .gitattributes
rm .gitmodules
rm project.godot
rm -r ./.git
rm -r ./.github
rm -r ./addons/Wwise/tests
mkdir -p GeneratedSoundBanks
cp addons/Wwise/tools/wwise_ids.template GeneratedSoundBanks/wwise_ids.gd
rm -r ./addons/Wwise/tools
- name: Upload final artifact
uses: actions/upload-artifact@v3
with:
name: wwise-${{ env.WWISE_VERSION }}-for-godot-${{ env.GODOT_ENGINE_VERSION }}-${{ env.GODOT_ENGINE_STAGE }}-${{ env.INTEGRATION_VERSION }}
path: ./