-
Notifications
You must be signed in to change notification settings - Fork 2.9k
264 lines (217 loc) · 8.01 KB
/
spine-godot-extension-v4.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
name: Build spine-godot GDExtension (Godot 4.x)
on:
workflow_call:
inputs:
godot_tag:
required: true
type: string
default: "Godot tag not specified!"
godot_version:
required: true
type: string
default: "Godot version not specified!"
dev:
required: true
type: boolean
default: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
GODOT_TAG: ${{ inputs.godot_tag }}
GODOT_VERSION: ${{ inputs.godot_version }}
DEV_BUILD: ${{ inputs.dev }}
jobs:
build-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Build GDExtension
shell: bash
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
./build-extension.sh windows
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-windows-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/windows/*.dll
build-linux-x86_64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev
- name: Build GDExtension
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
./build-extension.sh linux
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-linux-x86_64-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/linux/*.so
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Build GDExtension
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
./build-extension.sh macos
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-macos-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/macos/macos.framework/*
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Build GDExtension
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
./build-extension.sh ios
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-ios-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/ios/*.xcframework/**/*
build-android:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f spine-godot/build/sources.lst /etc/apt/sources.list
sudo apt-get update
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Android SDK & NDK
uses: android-actions/setup-android@v2
- name: Install NDK
run: |
yes | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;23.2.8568313"
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Build GDExtension
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/23.2.8568313 ./build-extension.sh android
ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/23.2.8568313 ./build-extension.sh android x86_64
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-android-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/android/*.so
build-web:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.26
- name: Setup python and scons
uses: ./.github/actions/setup-godot-deps-4
- name: Build GDExtension
run: |
cd spine-godot/build
./setup-extension.sh $GODOT_TAG $DEV_BUILD
./build-extension.sh web
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdextension-web-${{ env.GODOT_TAG }}
path: spine-godot/example-v4-extension/bin/web/*.wasm
upload-to-s3:
needs: [build-windows, build-linux-x86_64, build-macos, build-ios, build-android, build-web]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download windows artifact
uses: actions/download-artifact@v4
with:
name: gdextension-windows-${{ env.GODOT_TAG }}
path: artifacts/gdextension-windows-${{ env.GODOT_TAG }}
- name: Download linux-x86_64 artifact
uses: actions/download-artifact@v4
with:
name: gdextension-linux-x86_64-${{ env.GODOT_TAG }}
path: artifacts/gdextension-linux-x86_64-${{ env.GODOT_TAG }}
- name: Download macos artifact
uses: actions/download-artifact@v4
with:
name: gdextension-macos-${{ env.GODOT_TAG }}
path: artifacts/gdextension-macos-${{ env.GODOT_TAG }}
- name: Download ios artifact
uses: actions/download-artifact@v4
with:
name: gdextension-ios-${{ env.GODOT_TAG }}
path: artifacts/gdextension-ios-${{ env.GODOT_TAG }}
- name: Download android artifact
uses: actions/download-artifact@v4
with:
name: gdextension-android-${{ env.GODOT_TAG }}
path: artifacts/gdextension-android-${{ env.GODOT_TAG }}
- name: Download web artifact
uses: actions/download-artifact@v4
with:
name: gdextension-web-${{ env.GODOT_TAG }}
path: artifacts/gdextension-web-${{ env.GODOT_TAG }}
- name: Package and upload artifacts
shell: bash
if: env.AWS_ACCESS_KEY_ID != null
run: |
BRANCH=${GITHUB_REF#refs/heads/}
echo "branch: $BRANCH"
cd artifacts
# Create directories matching the expected structure
mkdir -p bin/{windows,linux,macos/macos.framework,ios,android,web}
# Ensure gdextension file is in root
cp ../spine-godot/spine_godot_extension.gdextension bin/
# Move artifacts to their correct locations
mv gdextension-windows-$GODOT_TAG/* bin/windows/
mv gdextension-linux-x86_64-$GODOT_TAG/* bin/linux/
mv gdextension-macos-$GODOT_TAG/* bin/macos/macos.framework/
mv gdextension-ios-$GODOT_TAG/* bin/ios/
mv gdextension-android-$GODOT_TAG/* bin/android/
mv gdextension-web-$GODOT_TAG/* bin/web/
# Create the final zip with branch and tag
zip -r ../spine-godot-extension-$BRANCH-$GODOT_TAG.zip spine_godot_extension.gdextension bin/
cd ..
aws s3 cp spine-godot-extension-$BRANCH-$GODOT_TAG.zip s3://spine-godot/$BRANCH/$GODOT_TAG/